December 5, 2026

I2C vs SPI vs UART: How Three Serial Buses Trade Wires for Speed

A microcontroller board wired to three small modules with two, two and four jumper wires

Nearly every sensor, display and radio module sold for a microcontroller talks over one of three interfaces. UART uses two wires and no clock. I2C uses two wires and puts dozens of chips on them. SPI uses four or more and runs faster than either. The choice comes down to what each design gives up: UART gives up the shared clock, I2C gives up speed, and SPI gives up pins.

Video: Electronoobs on YouTube

UART: two wires and an agreement

No clock line

UART stands for universal asynchronous receiver-transmitter. The key word is asynchronous. Analog Devices’ primer on the protocol describes a link with two signal lines, transmit and receive, crossed over so that each device’s Tx feeds the other’s Rx. Nothing carries a clock.

The two ends stay in step by agreeing on a speed in advance, the baud rate. Common values in the article’s list run from 9,600 to 1,500,000 bits per second, with 115,200 a frequent default. The agreement does not have to be perfect. According to the same source, the allowable difference of baud rate is up to 10% before the timing drifts too far.

The frame

The line idles high. A transmitter starts a byte by pulling the line low for one bit period, the start bit, and the receiver times everything else from that falling edge. Then come the data bits, usually sent least significant bit first, an optional parity bit, and one or two stop bits with the line back high.

Part Bits
Start 1
Data 5 to 8 with parity, up to 9 without
Parity 0 or 1
Stop 1 or 2

The most common setting, eight data bits with no parity and one stop bit, puts 10 bits on the wire for every byte. At 115,200 baud that works out to 11,520 bytes per second.

What it cannot do

A UART link is point to point. The Analog Devices comparison table lists one device at each end, and there is no addressing in the protocol. Three sensors on UART means three serial ports. The other limit is the mismatch itself: set one end to 9,600 and the other to 115,200 and the receiver produces garbage without any error to say so.

Audio mixer with knobs and sliders

I2C: two wires, many chips

A bus with addresses

I2C came out of Philips Semiconductors, now NXP, and the revision history of the official specification dates the original to 1982. It also needs just two lines, but they do different jobs: a serial data line (SDA) and a serial clock line (SCL). Every device on the bus connects to the same pair.

The current specification, revision 7 from October 2021, calls the device that starts a transfer and generates the clock the controller, and the device it talks to the target. Older documents and many datasheets still say master and slave for the same roles.

A controller picks a target by sending its address at the start of each transfer. Seven-bit addressing is mandatory in the specification. Seven bits allow 128 codes, of which two groups of eight are reserved, leaving 112 for ordinary devices. An optional 10-bit scheme can share the same bus.

Open drain and pull-up resistors

The electrical trick that lets many chips share two wires is that no device ever drives a line high. Outputs are open-drain: a device can pull a line low or let go of it. Resistors to the supply pull both lines high when nobody is pulling down, so an idle bus sits with SDA and SCL high.

The specification calls the result a wired-AND, and it has two consequences. Two devices can never fight each other with opposite voltages. And the resistors, not the chips, bring the line back up, which takes time. The specification requires pull-ups to be chosen for a shorter maximum rise time as the speed mode goes up, and that rise is a large part of why I2C is the slow one of the three.

Start, stop, acknowledge

Data on SDA is only allowed to change while SCL is low. Breaking that rule is how the bus marks its boundaries: a high-to-low transition on SDA while SCL is high is a START condition, and low-to-high under the same condition is a STOP.

Every byte is followed by a ninth clock pulse for the receiver’s answer. Pulling SDA low on that pulse is an acknowledge. Leaving it high is a not-acknowledge. This is the feature the other two buses lack: a controller that addresses a chip that is not there finds out immediately, because nobody pulls the line down.

Speed modes

Mode Maximum bit rate
Standard-mode 100 kbit/s
Fast-mode 400 kbit/s
Fast-mode Plus 1 Mbit/s
High-speed mode 3.4 Mbit/s
Ultra Fast-mode 5 Mbit/s, one direction only

With nine clock pulses per byte, Fast-mode tops out near 44,000 bytes per second before the address bytes are counted. How many devices fit on one bus is limited, the specification says, by the maximum bus capacitance, since every chip and every centimeter of trace adds load for the resistors to pull against.

Extras

A target that needs more time can hold SCL low, which the specification calls clock stretching, though it notes the feature is optional and most targets cannot do it. More than one controller can share a bus as well. If two start at once, the wired-AND settles it: a controller that sends a high and reads back a low has lost and stops, and the winner’s transfer is not corrupted.

SPI: more wires, more speed

Four signals

SPI takes the opposite approach to nearly every I2C decision. Analog Devices’ introduction describes it as a synchronous, full-duplex interface in which a main device controls one or more subnodes, and where both main and subnode can transmit data at the same time. The four-wire version has:

  • SCLK, the clock, generated by the main
  • CS, chip select, usually active low
  • MOSI, main out, subnode in
  • MISO, main in, subnode out

Lines are driven in both directions, with no pull-up resistors to wait for, and data flows on two wires at once. The article gives no single maximum clock rate, since that depends on the part, but says SPI supports much higher clock frequencies than I2C.

No addresses, so one pin per device

There is no addressing. A subnode listens when its chip-select line is pulled low and ignores the bus otherwise. In the regular arrangement every subnode gets its own CS line from the main, so three devices cost six pins: three shared signals plus three selects. Asserting two selects at once corrupts the data coming back on MISO.

Some devices can be daisy-chained on a single CS, with data shifted through one into the next. That saves pins and costs time. In the article’s example with 8-bit devices, reaching the third subnode takes 24 clock pulses where the regular arrangement takes 8.

Four modes that must match

The clock can idle low or high (polarity, CPOL), and data can be sampled on the first or second edge (phase, CPHA). That gives four combinations:

Mode CPOL CPHA Clock idles Data sampled on
0 0 0 Low Rising edge
1 0 1 Low Falling edge
2 1 0 High Falling edge
3 1 1 High Rising edge

The main has to be set to whatever mode the subnode’s datasheet specifies. A wrong mode is the SPI equivalent of a wrong baud rate, and it fails the same way: plausible-looking wrong bytes. SPI has no acknowledge bit either, so a missing chip looks like a chip returning zeros or ones.

Circuit board close-up

Side by side

UART I2C SPI
Signal wires 2 (Tx, Rx) 2 (SDA, SCL) 4 (SCLK, CS, MOSI, MISO)
Clock line None Yes Yes
Devices 2, point to point Many, by address Many, one CS each
Pins for 3 peripherals 6 (three ports) 2 6
Duplex Full Half Full
Built-in acknowledge No Yes, every byte No
Must be configured to match Baud rate, frame Speed mode Clock mode
Rated speeds in the sources 9,600 bps to 1.5 Mbps 100 kbit/s to 3.4 Mbit/s “Much higher” than I2C, per datasheet

Choosing one

By what the part needs

In practice the peripheral chooses. A GPS module or a Bluetooth serial adapter speaks UART. A temperature sensor or a real-time clock chip is usually I2C; the NXP specification’s own list of typical I2C parts includes EEPROMs, real-time clocks, LCD drivers and data converters. A display, an SD card or a fast converter is usually SPI. The pattern follows the data rate each part has to move.

By what the board has left

When a part offers a choice, pin count and speed pull in opposite directions. Five slow sensors on I2C take two pins. The same five on SPI take eight. One display refreshing many times a second on I2C will crawl.

By what goes wrong

Each bus has a characteristic first-day failure, and they follow from the designs above. UART: Tx wired to Tx, or mismatched baud rates. I2C: missing pull-up resistors, so the lines never go high, or two parts with the same fixed address. SPI: wrong clock mode, or a chip-select line left floating. An I2C address scan, which tries every address and lists the ones that acknowledge, is the one built-in diagnostic any of the three offers, and it exists only because of that ninth clock pulse.

Blue circuit board

Sources

  • NXP Semiconductors, UM10204, “I2C-bus specification and user manual,” Rev. 7.0, October 1, 2021: https://www.nxp.com/docs/en/user-guide/UM10204.pdf
  • Analog Devices, Analog Dialogue, “Introduction to SPI Interface”: https://www.analog.com/en/resources/analog-dialogue/articles/introduction-to-spi-interface.html
  • Analog Devices, Analog Dialogue, “UART: A Hardware Communication Protocol Understanding Universal Asynchronous Receiver/Transmitter”: https://www.analog.com/en/resources/analog-dialogue/articles/uart-a-hardware-communication-protocol.html

719 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *