2021-02-02 01:24 AM
How should a UART interface be designed so that a robust communication possible can be established between two MCUs. The following table is shown in a data sheet from Texas Instruments. You can see the error rate depending on the baud rate.
According to my research a low baud rate below 57600 bit/s and 16x oversampling is suitable for a communication over a longer distance.
1) Are the error rates manufacturer dependent?
I can't find any application notes from ST for implementing a reliable UART.
2) Are there any recommendations on which communication protocols should be used? (Something like TCP/IP over UART).
Thanks in advance
Solved! Go to Solution.
2021-02-02 05:21 AM
As mentioned previously that table you posted is for baud rate error%, not for data bit errors.
Example:
Not knowing much about your needs I'd suggest a very robust solutions as this appears to be a concern:
Beyond that - post detailed info.
Paul
2021-02-02 01:51 AM
[Edited]
For long transmission lines, RS232 transceiver chips are used transforming the logic levels to V.28 levels. There are also optical transceivers and others kinds of robust serial transmission. So, the real error rates depend heavily on your overall transmission line.
> I can't find any application notes from ST for implementing a reliable UART.
I would never assume that a serial transmission is fully reliable. Your code should handle all error flags properly and may implement some additional protocol layer to increase reliability.
> Are there any recommendations on which communication protocols should be used? (Something like TCP/IP over UART).
There are tradeoffs concerning throughput, latency, etc.. Many protocols have been developed: adding CRC, use HDLC framing, XMODEM family, PPTP, ...
2021-02-02 02:10 AM
The error in this table is the deviation from the target baud rate. The baud rate must be derived from a clock, which is 150MHz in the example, which in turn is probably generated from an external crystal using a PLL. If you calculate the error in the table yourself by using e.g. the values for the row 56000:
(150MHz/(16*Divisor*TargetBaudRate))-1
you will get the value 0.002459..., which you have to multiply by 100 to get the percentage value 0.25 (rounded).
The transmission distance for communication via UART is instead limited by the electrical behavior of RS-232 (search for keywords like distance or signaling). Depending on your definition of "longer distances" you should consider one of the alternatives mentioned there, e.g. a differential line like RS-485, which would just need another PHY like e.g. the STR485.
The communication protocol has nothing to do with the physical layer as it is part of a higher level in the OSI model. It only depends on your system requirements whether and which one should be used.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Good luck!
/Peter
2021-02-02 05:21 AM
As mentioned previously that table you posted is for baud rate error%, not for data bit errors.
Example:
Not knowing much about your needs I'd suggest a very robust solutions as this appears to be a concern:
Beyond that - post detailed info.
Paul