Series: Introduction to SoC Design | Article 8 of 11
Introduction
A System-on-Chip (SoC) without input/output (I/O) is a black box. No matter how powerful its central processing units (CPUs) or how fast its memory, it has no way to receive information from the world or send results back out. Peripherals are the hardware blocks that bridge the gap between the digital logic inside the chip and the physical world outside it: sensors, displays, storage, networks, and human interfaces.
This article surveys the most common peripheral types found in SoCs, explains the protocols they use, and shows how they connect to the rest of the chip.
The peripheral landscape
Peripherals vary enormously in bandwidth, latency, and complexity:
GPIO
General-purpose input/output (GPIO) is the simplest peripheral: a set of pins that can be individually configured as either digital inputs or digital outputs, under software control.
GPIO pins on modern SoCs are typically multiplexed: the same physical pin can serve as GPIO or as a dedicated function for a peripheral like UART or SPI. The IOMUX (I/O multiplexer) hardware block selects which function a pin serves:
UART
Universal Asynchronous Receiver/Transmitter (UART) is the oldest and simplest serial communication protocol. It is asynchronous (no shared clock between sender and receiver) and full-duplex (simultaneous send and receive on separate wires).
UART frame format
A UART frame consists of: start bit, 7-9 data bits, optional parity bit, and 1-2 stop bits.
The receiver samples the line at 16x the baud rate to detect the start bit edge, then samples each data bit at the midpoint of its period. Both sides must be configured to the same baud rate (for example, 115200 bps).
UARTs serve primarily as debug consoles: they are the primary serial debug output tool in embedded systems. Almost every SoC has at least one UART that provides a serial terminal during boot.
SPI
Serial Peripheral Interface (SPI) is a synchronous serial protocol where the master provides the clock. It is designed for short-distance communication between a SoC and peripheral ICs such as flash memory, sensors, digital-to-analogue converters (DACs), and displays.
SPI signals
SPI timing
SPI supports four modes based on CPOL (clock polarity) and CPHA (clock phase), enabling compatibility with different devices. Most flash memories and sensors use Mode 0 or Mode 3.
SPI has no addressing scheme: the chip select line selects the target device. Multiple slaves require one CS line per slave. Quad-SPI (QSPI) uses four data lines instead of one, quadrupling throughput.
I2C
Inter-Integrated Circuit (I2C) is a two-wire synchronous protocol supporting multiple masters and multiple slaves on the same bus. It uses 7-bit or 10-bit addressing to select which device a transaction targets.
I2C signals
I2C transaction format
The START condition (SDA falls while SCL is high) begins every transaction. The master sends 7 address bits and an R/W bit, then waits for an ACK: the addressed slave pulls SDA low for one clock cycle. Data bytes follow, each acknowledged by the receiver.
I2C standard speeds are 100 kHz (standard), 400 kHz (fast), 1 MHz (fast-plus), and 3.4 MHz (high-speed). Common uses include temperature sensors, inertial measurement units (IMUs), power management ICs (PMICs), cameras, electrically erasable programmable read-only memory (EEPROM), and displays.
USB
Universal Serial Bus (USB) is the dominant PC-to-peripheral protocol, and is increasingly common on embedded SoCs. A complete USB implementation includes:
- USB PHY (Physical Layer): analog front-end handling differential signalling
- USB controller and IP stack: protocol stack implementation (USB 2.0 at 480 Mb/s, USB 3.x up to 20 Gb/s)
- USB hub and root hub logic: in host-mode SoCs
USB 2.0 uses a tiered star topology with a single host, supporting 127 devices. USB communication is always host-initiated: a device can never spontaneously send data. It must wait to be polled or for the host to grant a transfer.
USB transfers are classified into four types:
| Transfer Type | Description | Use Case |
|---|---|---|
| Control | Enumeration, configuration | Device setup |
| Bulk | Large data, guaranteed delivery | Storage (USB flash) |
| Interrupt | Small, time-bounded data | Human Interface Device (HID): mouse, keyboard |
| Isochronous | Time-sensitive, no retry | Audio, video streaming |
USB 3.x adds SuperSpeed lanes with a completely different physical layer, using 128b/132b coding instead of 8b/10b and separate TX and RX differential pairs. It maintains backward compatibility with USB 2.0.
Ethernet MAC
Ethernet connectivity requires two hardware blocks:
MAC (Media Access Control): implements the Ethernet frame format, collision detection (for legacy half-duplex), flow control, and first-in first-out (FIFO) buffer management. The MAC lives on-chip.
PHY (Physical Layer): converts between the digital MAC signals and the analog signals on the twisted-pair cable. The PHY is usually a separate chip, connected to the MAC via the Reduced Gigabit Media Independent Interface (RGMII) or Serial Gigabit Media Independent Interface (SGMII).
The MAC operates as a DMA master: when a packet arrives, the MAC's DMA engine writes it to a pre-allocated buffer in dynamic RAM (DRAM) and signals the CPU via interrupt. Outgoing packets are described by descriptors pointing to DRAM buffers, and the MAC fetches and transmits them independently.
DMA controller
Almost all high-bandwidth peripherals include or connect to a Direct Memory Access (DMA) engine. DMA enables peripherals to transfer large blocks of data to and from memory without the central processing unit (CPU) processing every byte.
DMA is essential for audio streaming, video capture, USB bulk transfers, UART high-speed data, and anything involving moving more than a few bytes at a time.
Interrupt controller
Peripherals signal the CPU when they need attention using interrupts: electrical signals that cause the CPU to pause its current task and run an Interrupt Service Routine (ISR). The CPU saves its state before the ISR runs and restores it afterwards.
A SoC may have dozens of interrupt sources (UART received a byte, SPI transfer complete, GPIO edge, timer expired, DMA done). The interrupt controller collects these signals, prioritises them, and presents the highest-priority pending interrupt to the CPU.
ARM's GIC (Generic Interrupt Controller) is the standard interrupt controller for Cortex-A SoCs. It supports up to 1020 interrupt sources and 8 priority levels. It can also target interrupts to specific CPU cores, which is useful for load balancing in multi-core systems.
Timer and watchdog
Timers are counter circuits that count clock cycles and generate an interrupt when they reach a preset value. They are used for:
- Operating system (OS) tick (for example, 1 ms for task scheduling)
- PWM generation (Pulse Width Modulation for motor control, LEDs)
- Capture (measuring pulse widths on GPIO inputs)
- Timeouts
A watchdog timer is a specific timer that firmware must periodically reset. If the firmware crashes or hangs, the watchdog expires and resets the entire system: essential for reliable embedded operation.
Summary
Peripherals are the interface between a SoC and the physical world. GPIO provides flexible single-bit I/O. Serial protocols like UART, SPI, and I2C provide low-to-medium bandwidth connections to sensors and devices. USB provides standardised high-speed connectivity to external devices. Ethernet connects the SoC to networks. DMA engines free the CPU from data movement tasks. The interrupt controller efficiently manages asynchronous events from all these sources. Together, these blocks are what allow a SoC to run in a real product.
Further reading
- DMA Controller Architecture: Descriptor chains, scatter-gather, channel arbitration
- Interrupt Controllers: Nested vectored interrupts, GIC architecture, priority grouping
- Memory-Mapped I/O and Linux Device Drivers: Writing kernel drivers for these peripherals
Previous: Article 07 -- Clocking, Reset, and Power Domains Next: Article 09 -- Hardware Description Languages and RTL Design