实现FreeModbus协议所需要的软/硬件需求

来源:互联网 发布:数据库decode 编辑:程序博客网 时间:2024/06/06 09:48

 

 

实现FreeModbus协议所需要的软/硬件需求

 

 

 

 

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.

实现Modbus协议对硬件的需求是极其少的-任何一个具有串行接口和一定量的能够处理modbus数据帧的RAM就足够了。   

  • 一个支持中断的异步串行接口,该中断至少包括接收缓冲区满中断和发送寄存器空中断 
  • 一个定时器,用以产生Modbus的RTU模式所需要的T3.5个字符的超时时间

    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).

    对于软件部分而言,实现Modbus仅仅需要一个简单的事件队列。在STR71X/FreeRTOS 的移植中,使用了FreeRTOS的队列来实现了该事件队列以降低处理Modbus任务时的时间消耗。较小的微控制器往往不使用实时内核,在这种情况下,可以通过全局变量的使用来实现这个事件队列(Atmel的AVR控制器的移植中使用了该方法)。

    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.

    实际的内存需求量决定于使用的模块的多少。第一个表列出了所有功能模块所需要的内存量。对应ARM来讲,内存量的获取是通过使用GNUARM编译器在使用-O1命令下统计得来的。AVR所需要得内存量是通过WINAVR编译器在使用-Os命令下统计得来得。

     

    ModuleARM CodeARM RAM (static)AVR CodeAVR RAM (static)Modbus RTU (Required)1132Byte272Byte1456Byte266ByteModbus ASCII (Optional)1612Byte28Byte1222Byte16ByteModbus Functions [1]1180Byte34Byte1602Byte34ByteModbus Core (Required)924Byte180Byte608Byte75BytePorting Layer (Required [2])1756Byte16Byte704Byte7ByteTotals7304Byte530Byte5592Byte398Byte[1]: Actual size depends on the available Modbus functions. They are configurable in the header file mbconfig.h.
    [2]: Depends on the hardware.