Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncommon serial setup #1

Open
GoogleCodeExporter opened this issue Mar 15, 2016 · 0 comments
Open

Uncommon serial setup #1

GoogleCodeExporter opened this issue Mar 15, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When using your library on a Arduino DUE with a RS485 sheelt I had the 
following problems:

Message framing detection did not work. The MODBUS I connect to runs at 57600 
bps. This results in modbusSlave::_frameDelay being set to 0. For all MODBUS 
messages I received the first byte was detected as a frame of only one byte 
length. All messages were then rejected as having invalid CRC.

I think the calculation is even broken for slower MODBUS buses. The current 
code calculates the time considered as a frame gap as 24000/baud (milli 
seconds). This seems to be calculated as 3 characters of 8 bit length each. But 
on the one hand a character has a length of 11 bit and on the other hand the 
spec defines the frame to be at least 3.5 characters in length. Therefore I 
think the correct division would be 38500/baud (milli seconds).

I also think, that it is incorrect to setup the serial port as 8N1. The 
required to implement mode is 8E1 (having an even parity bit). No-parity is 
allowed, but is a MAY in the specification and you need an extra stop bit in 
that case resulting in 8N2.

Original issue reported on code.google.com by m...@tthias.eu on 23 Oct 2013 at 11:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant