Microcontrollers need to talk to sensors, displays, and other microcontrollers. Standard communication protocols make this possible.
Simple, point-to-point communication. Uses two wires: TX (Transmit) and RX (Receive). No clock line is used (asynchronous), so both sides must agree on a baud rate.
Synchronous, full-duplex communication. Uses 4 wires: SCK (Clock), MOSI (Master Out Slave In), MISO (Master In Slave Out), and SS (Slave Select). Very fast.
Synchronous, half-duplex, multi-master bus. Uses 2 wires: SDA (Data) and SCL (Clock). Devices have unique addresses. Slower than SPI but requires fewer pins.
| Protocol | Wires | Speed | Type |
|---|---|---|---|
| UART | 2 (TX, RX) | Slow | Asynchronous |
| SPI | 4 (SCK, MOSI, MISO, SS) | Fast | Synchronous |
| I2C | 2 (SDA, SCL) | Medium | Synchronous |