Serial Communication

Hardware Serial Protocols
SPI · I2C · UART

The three protocols that connect every sensor, memory, and peripheral to your microcontroller or SoC — complete with wiring, frame formats, and Verilog implementations.

SPI I2C UART Verilog Master FSM Protocol Comparison
SPI 4 wires: SCLK · MOSI · MISO · CS Synchronous · Full-duplex No addressing — 1 CS per slave Speed: up to 100+ MHz Best for: ADC, Flash, Displays I²C 2 wires: SDA · SCL Synchronous · Half-duplex 7-bit addressing (112 devices) Speed: 100 kHz – 3.4 MHz Best for: Sensors, EEPROM, RTC UART 2 wires: TX · RX Asynchronous · Full-duplex No addressing — point-to-point Speed: 110 – 921600 baud Best for: Debug, GPS, Bluetooth
Protocols
Choose Your Protocol

Each guide covers signal wiring, frame format, a Verilog controller implementation, and real-world applications.

Protocol 01
SPI — Serial Peripheral Interface
4-wire full-duplex protocol: SCLK, MOSI, MISO, CS. Learn CPOL/CPHA modes, multi-slave wiring, and build a complete Verilog SPI master with a clock divider and shift register.
CPOL/CPHA Full-Duplex Verilog Master
Read SPI Guide
Protocol 02
I²C — Inter-Integrated Circuit
2-wire open-drain bus: SDA and SCL. Learn 7-bit addressing, START/STOP conditions, ACK/NACK, clock stretching, multi-master arbitration, and a Verilog I2C master FSM.
7-bit Address Open-Drain ACK/NACK
Read I²C Guide
Protocol 03
UART — Universal Async Receiver-Transmitter
Asynchronous 2-wire protocol: TX and RX. Learn baud rate, start/stop bits, parity, RS-232 vs TTL levels, and build a complete Verilog UART TX + RX with center-sampling oversampling.
Async Baud Rate TX + RX Verilog
Read UART Guide
SPI vs I²C vs UART — Head to Head
Feature SPI I²C UART
Wire count4 (+ 1 per extra slave)22
ClockShared (master)Shared (master)None (async)
DuplexFull-duplexHalf-duplexFull-duplex
Topology1 master, N slavesN masters, N slavesPoint-to-point
AddressingNone (CS pin per slave)7-bit or 10-bitNone
Max speed100 MHz+3.4 MHz (HS-mode)~4 Mbaud (practical)
Hardware complexitySimple master, no ACKOpen-drain, arbitrationSimplest — just shift reg
Error detectionNone built-inACK/NACK per byteParity (optional)
Pull-up resistorsNot requiredRequired (SDA + SCL)Not required
Long cablesPoor (high capacitance)Poor above 400 kHzOK up to ~15 m (RS-232)
Typical applicationsFlash, SD, ADC/DAC, LCDSensors, RTC, EEPROMDebug console, GPS, BT
When to Use Which Protocol

Choose SPI when…

  • You need high speed (ADC samples, fast display refresh)
  • Full-duplex is required (simultaneous TX + RX)
  • You have only 1–2 slaves and spare GPIO
  • You're talking to SD cards, NOR Flash, or DACs
  • You can afford 4 signal lines

Choose I²C when…

  • You have many devices (5+ sensors on 2 wires)
  • PCB space is tight — fewer traces
  • Speed is below 400 kHz
  • You need multi-master bus sharing
  • Devices already have I2C interfaces (most sensors do)

Choose UART when…

  • Connecting to a PC, debugger, or terminal
  • Device only has TX/RX pins (GPS, BT modules)
  • You need a simple async link without a clock
  • Longer cable runs (RS-232 to 15 m)
  • You want simplest possible implementation
Recommended learning order
UART → SPI → I2C — simplest to most complex. Each protocol page includes a full Verilog controller implementation.
Start with UART → Then SPI → Then I²C →