Skip to content
/ modbus_c Public

Modbus RTU for linux, ATmega328p, STM8S003F3, STM32F103C8.

License

Notifications You must be signed in to change notification settings

wdl83/modbus_c

Repository files navigation

Modbus RTU library for uC

Cloning

git clone --recurse-submodules https://github.com/wdl83/modbus_c

Supported targets

  1. ATmega328p, slave only
  2. STM8S003F3, slave only
  3. STM32F103C8, slave only
  4. Linux, slave and master

All targets use same implementation

Linux RTU

Utilizes linux tty device as serial I/O. Allows validation and quick prototyping.

make -f rtu_linux.mk

ATMega328p RTU

make -f rtu_atmega328p.mk

Testing

Current state of RTU tests

Building

make -f rtu_linux_tests.mk

Running

make -f rtu_linux_tests.mk run

Tests can be executed with different targets

  1. default, software RTU (linux RTU running in separate thread)
./obj/rtu_linux_tests
  1. HW loopback. Use 2 USB to SERIAL converters with crossed RX/TX pins
./obj/rtu_linux -d /dev/ttyUSB1 -a 32 -t 10000 -T 20000 -D 1024 -p E
./obj/rtu_linux_tests -d /dev/ttyUSB0 -a 32 -t 10000 -T 20000 -p E
  1. HW target. ATmega328p with obj_atmega328p/rtu_atmega328p.hex connected to PC
./obj/rtu_linux_tests -d /dev/ttyUSB0 -a 15 -p E

Same set of tests work with all targets listed above.

Coverage report

report

About

Modbus RTU for linux, ATmega328p, STM8S003F3, STM32F103C8.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published