SPI, I2C, and UART are three commonly used serial communication protocols in embedded systems, which have both differences and connections in communication methods, application scenarios, and other aspects. The following is a specific analysis:
Table of Contents
1、 Basic concepts
1. SPI (Serial Peripheral Interface)
-Features: Full duplex, synchronous communication, requiring clock signal (SCK) for synchronous data transmission.
-Pin: usually consists of 4 wires:
-SCK (Clock Line): Generated by the main device, it controls the rhythm of data transmission.
-MOSI (master output slave input): The master device sends data to the slave device.
-MISO (primary input/output): Return data from the device to the primary device.
-SS/CS (Chip Selection Line): The master device selects the slave device through a level signal (low level is valid).
-Communication method: The master device drives the clock, and each transmission is in bytes. It supports multiple slave devices, but requires independent chip selection.
2. I2C (Inter Integrated Circuit)
-Features: Half duplex, synchronous communication, supports multiple masters and slaves, and the bus maintains a high level through pull-up resistors.
-Pin: 2 wires:
-SCL (Clock Line): The main device or the arbitrated main device generates a clock.
-SDA (Data Line): Bidirectional transmission of data, with each device identified by a unique address.

-Communication method: The master device initiates communication and addresses the slave device through a 7-bit or 10 bit address. Data is transmitted in bytes and requires an acknowledgement signal (ACK).
3. UART (Universal Asynchronous Receiver/Transmitter)
-Features: Asynchronous communication, no clock line required, data transmission rate agreed upon through baud rate.
-Pin: At least 2 wires (simplex or half duplex):
-TXD (transmission line): The main device sends data.
-RXD (receive line): Receive data from the device.
-Communication method: Transmit in frames, each frame containing a start bit, data bit, parity bit, and stop bit, supporting full duplex (independent TXD/RXD).
2、 Core difference
| Dimension | SPI | I2C | UART |
| Synchronous/Asynchronous | Synchronous (requires SCK clock) | Synchronous (requires SCL clock) | Asynchronous (does not require clock, depends on baud rate) |
| Number of pins | 3-4 (SCK, MOSI, MISO, SS) | 2 (SCL, SDA) | 2 (TXD, RXD, optional RTS/CTS) |
| Communication direction | Full duplex (MOSI/MISO independent) | Half duplex (SDA bidirectional, but unidirectional at the same time) | Full duplex (TXD/RXD independent) |
| Addressing method | Device selection via SS pin hardware | Software addressing via 7/10 bit address | No addressing (point-to-point direct connection) |
| Bus arbitration | Not supported (fixed master device) | Supported (contention arbitration when multiple master devices are involved) | Not supported (point-to-point, no arbitration required) |
| Data transmission unit | Byte (8 bits), no response mechanism | Byte (8 bits), requires ACK response | Frame (variable data bits, including start/stop bits) |
| Transmission speed | High (up to tens of Mbps) | Standard mode 100kbps, Fast mode 400kbps, High speed mode 3.4Mbps | Low (usually tens of kbps to Mbps level) |
| Typical applications | High speed peripherals (such as Flash, ADC, LCD) | Low speed peripherals (such as EEPROM, sensors) | Serial communication (such as Bluetooth, USB to serial) |
3、 Connection and commonalities
1. The essence of serial communication
All data is transmitted bit by bit through serial communication, which saves pin resources compared to parallel communication and is suitable for short-range communication.
2. Master slave architecture
-SPI and I2C clearly distinguish between master and slave devices, with the master device controlling the communication rhythm.
-UART is usually used for point-to-point communication, but can also be considered as a “master-slave” mode (such as a microcontroller as the master and peripherals as slaves).
3. Widely used in embedded scenarios
It is used for communication between microcontrollers, peripherals, and chips, and is the basic communication protocol for embedded systems.
4. Scalability
-SPI supports multiple slave devices through multi chip selection, but the bus load capacity is limited.
-I2C supports multiple masters and slaves through bus sharing, making it suitable for scenarios with a large number of devices and low speed requirements.
-UART can extend communication distance through a modem (such as RS-232/RS-485) and support multi device networking (additional protocol required).
4、 How to choose?
-High speed and simple networking: Choose SPI (if full duplex is required and pin count is not considered).
-Multi device, low pin cost: Choose I2C (low-speed peripherals such as sensors, EEPROM, etc.).
-Asynchronous communication, long-distance or cross device: Select UART (such as communication with PC, industrial serial devices).
In practical applications, comprehensive judgment can be made based on pin resources, communication speed, number of devices, and whether addressing/arbitration is required.
Get your exclusive quote immediately: fill out the form or send an email directly, and we will provide you with a quote service within 24 hours. Enjoy free DFM optimization and a 10% discount on SMT patches for your first order!
