Serial Communications

On this page

Serial communications send data one bit at a time over a small number of wires. Despite Ethernet’s dominance, RS-232 / RS-485 still drive countless field devices, instruments, and consoles.

Overview

The basic building block is the UART: an async character with start, data, optional parity, and stop bits. Different physical layers wrap the same UART for different distance / topology.

RS-232 / RS-422 / RS-485

  • RS-232 (TIA-232-F) — single-ended, ±5 to ±15 V, point-to-point, ~15 m max, up to ~1 Mbit/s.
  • RS-422 — differential, point-to-multipoint (1 driver, up to 10 receivers), 1,200 m at 100 kbit/s.
  • RS-485 — differential, multi-drop (up to 32 unit loads), 1,200 m at 100 kbit/s. Most field use today.
  • Wire RS-485 as A (− / inverting) and B (+ / non-inverting); pull-up/pull-down for fail-safe idle.

UART Framing

  • Start bit (logic 0), data bits (5–9, usually 8), optional parity (none/odd/even/mark/space), 1 or 2 stop bits.
  • Common config “8N1” = 8 data, no parity, 1 stop.
  • Baud rate must match exactly on both ends (±2% tolerance typical).
  • Common rates: 1200, 2400, 9600, 19200, 38400, 57600, 115200.

Cabling

  • RS-232 typically DB-9 (DTE / DCE wiring difference matters).
  • RS-485: shielded twisted pair (e.g. Belden 3105A), 120 Ω characteristic impedance.
  • Terminate at both physical ends of the bus only; never daisy-chain through devices’ screw terminals into a star.
  • Bias resistors (~680 Ω) on the master to define idle state.
  • Connect signal ground / reference between all nodes.

Flow Control

  • None — most modern devices.
  • Hardware — RTS / CTS handshake (RS-232).
  • Software — XON / XOFF (ASCII characters 0x11 / 0x13).
  • For RS-485, the master controls direction; transceivers need RE/DE toggling.

Troubleshooting

  • Use a USB-to-serial adapter (FTDI FT232, Prolific PL2303) + terminal (PuTTY, Tera Term, minicom, screen).
  • Verify baud, data, parity, stop on both ends.
  • Swap A/B if RS-485 doesn’t communicate — first thing to try.
  • Check termination & biasing.
  • Confirm signal ground is connected between RS-232 nodes.
  • Use a protocol analyzer (Saleae Logic) to capture and decode UART frames.
reference page