cancel
Showing results for 
Search instead for 
Did you mean: 

How to make UART communication faster?

arduo
Senior

Hi,

how can I get the maximal data transfer rate for my UART TX and RX Pins communicating with other devices?

3 REPLIES 3
AvaTar
Lead

Higher baudrate ?

Usually demands more resources (performance, clock frequency) and has higher costs, like better cables.

The UART should perform at a megabit or two. As speed goes higher the more appropriate other methods become, from integrity and buffering standpoints among others. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Jack Peacock_2
Senior III

There are some fundamental limitations with asynchronous serial ports, assuming that's what you mean by UART. The first is the transmission line. RS-232 has a hard limit at around 115Kbaud if you want reliability and aren't too careful about cables and connectors. That's a limitation on how fast the signal can transition between high and low voltage levels, or what's known as the slew rate. RS-232 is 1960s era technology, when 2400 baud was considered very fast.

You can move up to RS-422 or more common RS-485 differential transceivers. These can support rates up to 10Mbaud over short distances, but then you run into another problem with async serial. Since there's no separate clock, unless you use synchronous (that's the "S" in USART), you have to ensure transmitter and receiver have very accurate baud rate generators as data rates increase. Unless you are building both ends of the comm loop that's not likely to happen. Even a small deviation can cause failures at high rates, especially if you send long blocks of data without gaps between characters. That usually shows up as framing or parity errors on the receive end.

This is caused by the nature of how a receiver works for async. Each byte has a start bit, which is used to align the receiver to incoming data. If there isn't enough time to detect that start it (i.e. it arrives too soon because of clock jitter) then you wind up with framing errors. You can compensate for this with longer stop bit times plus inserting delays between characters (difficult when using buffered USARTS) but then you lose 10% or more of the higher thruput rate, a case of ever-diminishing returns.

This is why async serial isn't used with higher speed serial networks like CAN or Ethernet. If you really need reliable megabit or higher data rates look at something other than a UART.

Jack Peacock