HELP on MODBUS firmware implimentation


Thread Starter

Chris Prozzo

I am looking for any tips, links, or resources to help me as I try to impliment modbus in an AMD188es based instrument on a 2-wire RS485 bus.
Based on my reading of the Modbus spec, both ascii and RTU mode will require slave devices to service an interrupt for every character of network traffic looking for either the ':' (ascii)or timing the silent space (RTU). This seems like a lot of overhead, if traffic is heavy it could bog down the instrument which has better things to do than check every char on the bus. Am I missing something or is this really how it works. If you have been there and done that I would appreciate any advice you can give.

C Prozzo
Designe Engineer
Janos Technology Inc.

Rob Hulsebos

That's correct. But what you could do in the interrupt-handler is to check whether you are the slave being addressed, and if not, do not pass the data on to higher layers. This saves on
context-switches in your system.

I once did a Modbus-implementation on a 10 MHz 8088, and it could easily keep up with 19.2 Kbit/s and still do something else. Efficient serial I/O drivers are important here!

Another solution could be to use a 4-wire bus, that helps a little since slaves don't receive each other's traffic.

Rob Hulsebos