FreeMODBUS - A Modbus ASCII/RTU and TCP implementation

latest release v1.5 - 6 June 2010
The hardware requirements are minimal - Any reasonable microcontroller with a serial interface, at least some RAM to hold the modbus frames should suffice.
  • A UART which support and interrupts and has at least an receiver buffer full and transmit buffer empty interrupt.
  • A timer capable of creating the t3.5 character timeout timer for Modbus RTU.

For the software part a simple event queue is necessary. The STR71X/FreeRTOS port uses FreeRTOS queues for this purpose to reduce the time spent in the Modbus task. Smaller microcontrollers will most likely come without an operating system. In that case a simple implementation with a global variable is possible (The Atmel AVR port uses such an implementation).

The actual memory requirements depend on the used modules. The first table shows the required memory with all supported functions compiled in. Values for the ARM where obtained using the GNUARM compiler collection 3.4.4 with -O1 in ARM mode. The AVR values where obtained using the WinAVR compiler collection 3.4.5 with -Os.

Module ARM Code ARM RAM (static) AVR Code AVR RAM (static)
Modbus RTU (Required) 1132Byte272Byte 1456Byte266Byte
Modbus ASCII (Optional) 1612Byte28Byte 1222Byte16Byte
Modbus Functions [1] 1180Byte34Byte 1602Byte34Byte
Modbus Core (Required) 924Byte180Byte 608Byte75Byte
Porting Layer (Required [2]) 1756Byte16Byte 704Byte7Byte
Totals 7304Byte530Byte 5592Byte398Byte
[1]: Actual size depends on the available Modbus functions. They are configurable in the header file mbconfig.h.
[2]: Depends on the hardware.

FreeMODBUS library and web page maintained by Christian Walter [wolti at sil dot at]
BerliOS Logo
FreeMODBUS is sponsored and provided by embedded solutions embedded solutions
Low on development resources? Try freelancer and find new skilled people for your projects. IT Projekte und Freelancer

Valid HTML 4.01 Strict