UNIT 10 · MOVING AND PROCESSING DATA

Serial Communication

Move bytes between chips, one bit at a time.

6 lessons24 guided experiments43 min full read

Almost every sensor, memory chip, radio and debug console talks to the microcontroller over a serial link: a UART, SPI or I²C on the board, RS-485 or CAN across a machine. Each one answers the same questions differently: how the receiver finds the bits, who drives which wire, how devices are addressed, and what happens when noise corrupts a byte.

Start with lesson 1 →

The unit in six ideas

  1. 1Serial links need few wires; the receiver must recover bit timing and framing from the stream.
  2. 2Cross TX and RX, share ground, and match logic levels; RS-232 needs a transceiver.
  3. 3SPI has a controller-driven clock, two data lines and one chip select per device; every clock moves a bit each way.
  4. 4I²C has two open-drain lines with pull-ups; any device can pull low to acknowledge or stretch the clock.
  5. 5Single-ended receivers see noise and ground differences directly; differential receivers see only the difference between two wires.
  6. 6Mark packet boundaries with a length field, a delimiter with escaping (SLIP: C0, DB DC, DB DD) or an idle gap (Modbus t3.5).

Lessons

  1. LESSON 01 · 4 EXPERIMENTS · 7 MIN

    Serial Data, Framing, and Synchronization

    How does the receiver know?

  2. LESSON 02 · 4 EXPERIMENTS · 8 MIN

    UART and Asynchronous Serial Communication

    With no clock wire, how close do two UARTs have to be, and what else can lose a byte?

  3. LESSON 03 · 4 EXPERIMENTS · 7 MIN

    SPI and Synchronous Serial Communication

    What does it take to get it right?

  4. LESSON 04 · 4 EXPERIMENTS · 7 MIN

    I²C and Two-Wire Addressed Communication

    Two wires, dozens of devices, no chip selects: how does I²C work, and how does it fail?

  5. LESSON 05 · 4 EXPERIMENTS · 7 MIN

    Differential and Multinode Networks

    How do industrial and automotive systems run many devices over long, noisy cables?

  6. LESSON 06 · 4 EXPERIMENTS · 7 MIN

    Packet Design, Checksums, and Timeouts

    What turns it into a protocol you can trust?