How to check for T1.5 in Modbus RTU protocol?

test159357:
Will this provide an accurate result?

Honestly I don't know since I cannot test it but based on a previous project I did with similar requirement I should think it would.

I've added a screen shot from the doc you mention in your original post. (it hurt my head reading your reply but I think I got the point! :wink: )

so each frame has N number of bytes and the spacing between them should be no more that 1.5 characters (not sure on this point but I taking it that 1 character is 1 byte). so using my methold the interspace between the frame bytes should be not more that ((1.5 + 1)*10bits)/baudrate, +1 since the timestamp is taken AFTER the byte is received, 10bits assuming 8N1 UART.

same principle for the space between frames.

Of course this does not take into account the processing time which you can compensate for by either crunching the numbers for the clock cycles used or by trial and error!

Hope that helps and that I did not miss the point! :smiley:

ps I do have a hardware serial library which I modified for a similar purpose but I wonder with you can get a suitable buffer size for you purpose...