Skip to content

Simple AVR Modbus Bootloader + Applications for "smarthome"

Notifications You must be signed in to change notification settings

sessl3r/avr-modbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

avr-modbus

Simple AVR Modbus Bootloader + Applications for "smarthome"

For all my little tiny sensors at home I decided to use good old MODBUS.

Why? I wanted to use RS485 in any case and there are multiple sensors out there talking MODBUS.

Protocol Definitions

Uses a basic MODBUS implementation (only the very basic commandset).

Implemented in modbus library per default

Register Read (0x03)

    * 0x00: Identification
            * 0xFF00: Bootlader
            * 0xFF01: hello_modbus

Write Single Register (0x06)

    * 0xFE: Set Modbus Address

MUST be implemented by every firmware

Write Single Register (0x06)

    * 0xFF: Reset (Magic Value = 0x42)

bootloader

Very basic MODBUS bootloader to upload firmware

Usasge

$ make
$ make erase
$ make fuse
$ make flash

bootloader-flash

Simple host side tool to download HEX-Files (applications) using the bootloader

Usage

$ make
$ ./bootloader-flash -d /dev/ttyUSB0 -f ../hello_modbus/hello_modbus.hex -A 12 # Flash firmware and set MODBUS address
$ ./bootloader-flash -d /dev/ttyUSB0 -f ../hello_modbus/hello_modbus.hex -a 12 # Flash firmware to specified MODBUS address

hello_modbus

Very basic MODBUS App example where a LED can be toggled (... magic!) There is a simple client in there also which fades the blinking.

Usasge

$ make
# Upload using bootloader
$ make client
$ ./client /dev/ttyUSB0

About

Simple AVR Modbus Bootloader + Applications for "smarthome"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published