Modbus RTU Software/Hardware settings

N

Thread Starter

NoName

Hello everyone, I am trying to implement the Modbus Protocol, and have already first difficulties. I have read in the Application Paper, for the RTU Transmission Mode following is requested,

1 start bit
8 data bits
1 bit for parity
1 stop bit

Are these settings software or hardware dependent? I have the possibility to modify my microcontroller Serial Communication Interface register, by

a)enable the parity
b)set odd/even parity
c)number of stop bits
d)data length

but I dont have the start bit parameter.

Thx in advance!
 
E

Eric Ratliff

I have only ever seen 1 start bit, so I think you can stay with that. What I don't see in your question is are you coding a Modbus master or Modbus slave?

Regarding "Are these settings software or hardware dependent?", the answer depends on what you are connecting to. The supported serial modes may be hardware or software limited in these devices, but it does not matter which. You just need to know what parameters are used, and make sure your device can be compatible.

For example, a Modbus RTU slave device is M-7017. You can look in its manual, http://www.icpdas-usa.com/documentation/manuals/7017-18-19_english B17.pdf , and see "The data bits are fixed at one start bit, eight data bits, no parity and one stop bit". So if you are connecting to this device, you only need these settings. But, you could also find that specific baud rates between 1200 to 115200 are supported. So, you may wish to code foa all or at least one of those. Note that the manual does not explain if these parameters are hardware or firmware limited.

The hardware that you are programming probably has a UART chip to drive the serial bus. This will be a hardware limit on what you can support. For instance, 7 or 8 data bits may be supported, but not 5 or 6. See your hardware's documentation for this.
 
Hi, thx for your response. I am trying to develop a Slave by using microcontroller with some board. Master should be just software on the computer. So far I understood, I could leave it this way, and just set up hte necessary configuration (regarding parity, start bit...) in my microcontroller (for Slave) without facing bigger problems later.

Thank you and have a nice day!
 
Top