All five send bits one after another, but they live in different places. UART, SPI and I2C usually connect chips on one board, or over very short wires, with logic-level (3.3 V or 5 V) signals; CAN and RS-485 use differential signals to connect devices tens or hundreds of metres apart. The figures below follow manufacturers' public summaries of the standards (TI SLLA067C and SLLA270, NXP UM10204).
| UART | SPI | I2C | CAN | RS-485 | |
|---|---|---|---|---|---|
| Wires | TX, RX, GND | SCK, MOSI, MISO, GND + one CS per device | SCL, SDA, GND + pull-up resistors | CAN_H, CAN_L (+ common ground) | A, B (+ SG) |
| Signal | Single-ended (logic level) | Single-ended | Open drain + pull-up | Differential (dominant/recessive) | Differential |
| Clock | None — both sides agree on the baud rate | SCK line (from the master) | SCL line (from the master) | None — resynchronizes on edges | None (UART frames on top) |
| Devices | 1:1 | 1 master + as many as CS lines | By address (112 of the 7-bit addresses after 16 reserved); bus capacitance usually limits first | ISO 11898: 30 nodes | 32 unit loads |
| Speed | Agreed by both sides (9600, 115200 bit/s …) | No standard — the chip's maximum SCK | 100 k, 400 k, 1 M, 3.4 Mbit/s | Up to 1 Mbit/s (CAN FD data phase is faster) | < 40 Mbit/s (short lines) |
| Distance | On board, short wires (no standard) | On board, short wires (no standard) | Capacitance, not length: 400 pF (550 pF in 1 Mbit/s mode) | 40 m at 1 Mbit/s to 1000 m at 50 kbit/s | < 1200 m (at low speed) |
| Termination | None | None | Pull-up value | 120 Ω at both ends | 120 Ω at both ends |
Distance and speed cannot both be at their maximum. For CAN, TI SLLA270 table 1 lowers the rate as the bus gets longer (40 m 1 Mbit/s, 100 m 500 kbit/s, 200 m 250 kbit/s, 500 m 100 kbit/s, 1000 m 50 kbit/s), and RS-485's 1200 m is also a low-speed figure.
On the board: UART, SPI, I2C
- UART — two wires (+GND), 1:1. With no clock line, both sides must use the same baud rate, data bits, parity and stop bits. Debug consoles, GPS, Bluetooth and cellular modules and USB-serial adapters work this way. Use the «UART Baud Rate Error Calculator» to see how far apart two baud rates may be.
- SPI — the master drives SCK and data goes both ways on MOSI and MISO at once. Fast and simple, but each device needs its own CS line. The mode (CPOL, CPHA) must match the device: modes 0 and 3 read data on the rising SCK edge, modes 1 and 2 on the falling edge (Microchip AVR151 table 1-3). Common for flash memory, ADCs and displays.
- I2C — several devices share two wires and are told apart by address. The lines are open drain, so pull-up resistors are required, and longer wires add capacitance that slows the rising edge (UM10204 table 11: 400 pF below the 1 Mbit/s mode). Common for sensors, EEPROMs, RTCs and power management chips. If it does not work, see «I2C troubleshooting, in order».
Between devices: CAN, RS-485
- RS-485 — defines only the electrical layer. UART frames run over it with protocols like Modbus RTU, where a master asks and slaves answer. Only one device may talk at a time, so the master sets the order. For wiring, see «RS-485 wiring checks».
- CAN — the controller handles the electrical layer plus framing, arbitration and error handling. When several nodes send at once, the frame with the lower ID (higher priority) wins, and receivers overwrite the ACK bit to say they got it. Common in vehicles, mobile machines and motor drives (CANopen). For wiring, see «CAN wiring and termination checks».
How to choose
- Several sensors on the same board, speed not critical → I2C (two wires). Fast data (flash, continuous ADC reads) → SPI.
- Text or commands with one module, or a link to a PC → UART (a USB-serial adapter on the PC side).
- Devices more than a few metres apart, one master polling in turn → RS-485 (+ Modbus RTU).
- Several nodes that send on their own and need priority and error handling → CAN.
- If UART, SPI or I2C must run over a long cable → first look at switching to a differential transceiver (RS-485, CAN). Buffer chips can extend I2C, but the capacitance limit still applies.
Common mix-ups
- «UART» is not «RS-232». The frame is the same, but RS-232 uses ± voltages with inverted logic. Do not wire an MCU pin (3.3 V or 5 V) straight to a PC's RS-232 port; use a level converter.
- When mixing 3.3 V and 5 V devices, check input thresholds. I2C reads 1 at 0.7 × VDD or above, so a 5 V device needs at least 3.5 V (UM10204 table 10).
- SPI signal names vary (MOSI, SDI, DIN; MISO, SDO, DOUT; CS, SS, nCS). Check whether the datasheet names them from the master's or the device's side.
- CAN and RS-485 are both differential with 120 Ω at both ends, but the transceivers differ and cannot be mixed.
In PortDock
- Serial: exchange bytes with UART, RS-232 and RS-485 devices through a USB-serial adapter.
- «CAN Bit Timing Calculator» and «UART Baud Rate Error Calculator» web tools help get the settings right.
Sources
- TI SLLA067C — Comparing Bus Solutions — table 1 electrical interfaces (CAN, RS-232, RS-485 rate and distance), §2.3 CAN
- TI SLLA270 — Controller Area Network Physical Layer Requirements — table 1 length vs rate, 30 nodes, 0.3 m stubs
- NXP UM10204 I2C-bus specification and user manual Rev. 7.0 — rates per mode, §3.1.12 reserved addresses, table 10 input thresholds, table 11 bus capacitance
- Microchip AVR151: Setup and Use of the SPI — 1.4 SPI Timing — table 1-3 SPI modes 0–3
- TI SLLA070D — RS-422 and RS-485 Standards Overview and System Configurations — §2.2 RS-485 — up to 32 unit loads on the bus
Published 2026-11-01