What's changed: Initial version
4.4Serial communication interfaces
Compares the electrical and protocol characteristics of the four major serial communication methods—I2C, which connects multiple devices over two wires; SPI, which is high-speed and full-duplex; UART, which is asynchronous (start-stop synchronization); and CAN, which uses differential signaling for automotive use—building judgment for choosing the optimal interface based on requirements.
In embedded board design, the question "how should the sensor and MCU be connected?" has multiple candidate answers—I2C, SPI, UART, CAN—and which is optimal changes depending on requirements such as wire count, speed, number of connected devices, noise immunity, and cost. This section builds the judgment needed to decide which interface to choose for a given requirement, grounded in the differing electrical and protocol characteristics of the four major serial communication methods.
4.4.1I2C and SPI
- I2C (Inter-Integrated Circuit) is a bus-style serial communication scheme in which a master can talk to multiple slaves using only two wires: SDA (data) and SCL (clock). Each slave has a unique 7-bit (or 10-bit) address, and the master selects which device to talk to by specifying that address, so its chief advantage is being able to connect many devices without adding more wiring. However, its transfer speed—typically around 100 kbps standard-mode, 400 kbps fast-mode—is slower than SPI, and because its outputs are open-drain, a pull-up resistor is mandatory.
- SPI (Serial Peripheral Interface) communicates over four wires—SCLK (clock), MOSI (master to slave), MISO (slave to master), and SS/CS (chip select) (one SS line per slave)—and is full-duplex, sending and receiving at the same time. Because the master continuously supplies the clock and there is no addressing mechanism, it is far faster than I2C (several Mbps to several tens of Mbps), but the more slaves are added, the more SS wiring is needed, making it unsuited to connecting many devices.
Continue reading — free sign-up
You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.

