Ground Embedded KO Subscribe

Notes / Communication Protocols

RS-232, RS-422, RS-485: sending UART further

The same UART frame, converted to other voltage levels and differential signals, travels tens of metres up to 1 km. How the three standards differ, and RS-485 direction control.

GROUND EMBEDDED · NOTECommunication Protocols 03RS-232, RS-422, RS-485UARTSPII2CCAN

An MCU's UART is a 3.3 V single-ended signal and becomes unreliable beyond 1 to 2 m. A transceiver chip changes only the shape of the signal, so the frame stays the same and travels further.

Standard Signal Distance Nodes Characteristics
RS-232 ±3 to 15 V, single-ended ~15 m 1:1 PC serial port. Logic is inverted
RS-422 Differential, one-way pairs ~1200 m 1 driver : 10 receivers Full duplex (4 wires)
RS-485 Differential, bidirectional ~1200 m 32 nodes or more Half duplex (2 wires), the industrial standard
MCU UART3.3 V single-endedTransceiverMAX3485 etc.Differential pairA, B · up to 1.2 kmTransceiverRemote UART
The MCU's UART frame stays the same; the transceiver changes only the electrical signal.

RS-232 caution

A 1 is a negative voltage. Connecting it straight to an MCU pin destroys the pin. You need a transceiver such as the MAX3232.

RS-485 in practice

DE (driver on)I sendThey send
RS-485 shares one pair by taking turns. Raise DE only while sending and lower it right after the last bit has gone.
  • Several devices share one pair (A, B), so the driver must be on only while transmitting. Turn on the transceiver's DE pin with a GPIO and turn it off after the last bit has fully left (the UART TC flag). Turn it off too early and the last byte is corrupted.
  • Put a 120 Ω termination resistor at each end of the line.
  • Put fail-safe bias resistors in one place to define the line state when nobody is talking.
  • Modbus RTU is the most widely used protocol on top of RS-485.
3D LABUART WaveformRun what this note explains and watch it respond.Open the lab →FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →