UART max cable length

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Hello everyone,

I am currently working on a new PCB project and aim to design an interface that allows the possibility of attaching another PCB in the future for communication via UART. While I am familiar with the RS-485 option, including devices like the SN75176B ( SN75176B data sheet, product information and support | TI.com ), I am considering alternatives to avoid using this specific device.

If I opt for a cable length of maximum 1 or 2 meters, would there be any issues, especially if I use a low baud rate by not using such device?
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
RS-232 itself supports very long cable runs. Stick with that and you should have no problems at all.
What device would you recommend using, i presuming i can use standard 22AWG wire max length 1-2 meters. I would prefer a low pin count and simple device
 

MrChips

Joined Oct 2, 2009
34,728
What device would you recommend using, i presuming i can use standard 22AWG wire max length 1-2 meters. I would prefer a low pin count and simple device
MAX485 uses a common pinout in an 8-pin package. It is available by other manufacturers under different part numbers with different characteristics (for example, SN75176B).

1709479072248.png
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Thanks

Does thes devices need 5V or could 3.3V be sufficient?

If i am correct with these devices will not TX and RX at the same time?

Does cable need to be twisted or can it be standard wires? As i need max 1-2 meters
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Hi DJ,
What is the device type that outputs the RS232 signal?

eg: MCU etc?
E
Well I am using the ATXEMGA256A3BU. I aim to have a standard UART. My design also uses UART-friendly crystal 11.0592Mhz
But i want future proof my design, in case in need to connect an external PCB for additional feature.
 

ericgibbs

Joined Jan 29, 2010
21,432
Hi DJ,
I assume you want to use +5V/0V signal levels rather than say full RS232 of ~+/-12V levels.

If yes, a regular MCU can drive 2 mtrs of cable.
Twin or Twisted pair.
E
 

ericgibbs

Joined Jan 29, 2010
21,432
hi,
9600 Baud will be OK.
If you use a RS232 device at the sending end, you will need a RS232 receiving device at the remote end.
The MAX232 IC for RS232 is an example, but for only 2 mtrs a native signal level will OK.
E
 

MrChips

Joined Oct 2, 2009
34,728
You don't need RS-232. You don't need 5V supply.
Use a 3.3V RS-485 receiver/driver.
Here are two examples. MAX3483 and SN65HVD12.
Use twisted pair cable. I would try as high as 115200 baud. For maximum speed you can try 460800 baud.
If you are comfortable with 9600 baud that's fine too.
Make sure your lines are properly biased and terminated for any speed.
It does not matter what frequency crystal you use if you are using the same MCU PCB on both ends of the cable. If both boards are sending and receiving at the same rate then they are compatible with respect to data communications.

RS-485 is good for 1000m at reduced data rates. If your cable is only 1-2m you can actually try direct connection between the two MCUs without using a receiver/transmitter IC at 9600 baud. In this case, don't use twisted cable. Use 3-wire X-over cable, RXD, TXD, GND.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Thanks I will actually place a RS-485 at least this way i am full protected if i need to extend the length in the future beyond 2 meters as well as avoid any issue with notice.

So how do i calculate the correct termination resistor to place on both sides?
 

Ian0

Joined Aug 7, 2020
13,126
One of the most important things to consider is whether the "0V" connections at each end will be at the same voltage. In other words, are they both really 0V. If they can vary, use one of the RS485 transceivers.
The termination resistor should be the characteristic impedance of the cable. If you don't know use 120Ω.
At 9600 baud, it should manage a mile with the correct termination resistors, and a few metres without any termination resistors.

If your micro has a CAN transceiver, use it. It is a pain to get all the settings correct, but it saves trouble in the long run as the hardware controls the transmit and receive, manages data collisions all by itself.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Thanks, well my other PCB could basically be additional Sensors, with maybe a FAN controller etc, just simple pheripals, but at this point it is not decided.

But i don't think it would every be more then 3-4meter, and worst case 10 meters, so i will place a standard 100ohms reistor.
 

Ian0

Joined Aug 7, 2020
13,126
If you use one of the reduced-slew-rate transducers (MAX483, for instance) you probably won't need termination resistors.
 
Top