5.5.5 · D1Embedded Systems & Real-Time Software

Foundations — Communication interfaces — UART, SPI, I2C (master - slave), CAN bus

1,971 words9 min readBack to topic

This page builds — from absolute zero — every symbol, term and picture the parent topic leans on. Read top to bottom: each idea is a brick the next one stands on.


0. A wire is a voltage-over-time graph

Before any protocol, understand what a wire is. If you clip an oscilloscope (a "voltage camera") onto a signal wire and its ground, you see a graph: time along the x-axis, voltage up the y-axis.

The picture above is the whole subject in one frame: the wire wiggles between two levels, and each protocol is a different way to read meaning out of those wiggles. Keep this graph in your head — every later symbol lives on it.


1. Bit, byte, and LSB-first


2. Time per bit — where "baud" comes from

Now that a bit occupies a time-slot, we need to know how wide that slot is.

The Greek letter (epsilon) will later mean "a small fractional error" in the clock — just a name for "tiny fraction," nothing scary. See Baud rate & clock generation (timers/PLL) for how a chip actually makes this rate from its crystal.


3. Synchronous vs Asynchronous — the clock question

The single deepest split in this whole chapter is: does a separate wire carry the beat?


4. The edge — rising and falling

Synchronous protocols talk about "which edge." Here is exactly what an edge is.


5. Point-to-point vs Bus — who is on the wire

When many devices share one wire, a new danger appears: two of them driving it at once. That leads straight to the next idea.


6. Push-pull vs Open-drain — the sharing problem


7. Single-ended vs Differential — surviving noise


8. Symbols you'll meet in the formulas


Prerequisite map

Wire = voltage over time

Bit and byte

Baud and bit time

Clock and edges

Sync vs Async

Push-pull vs Open-drain

Wired-AND logic

I2C sharing and CAN arbitration

Single-ended vs Differential

CAN noise immunity

UART SPI I2C CAN

Related building blocks in the vault: Serial vs Parallel communication, Shift registers, Interrupts vs Polling, Bit stuffing & CRC in CAN frames.


Equipment checklist

Cover the right side; can you answer before revealing?

What does a wire physically carry?
A voltage that is HIGH or LOW, changing over time — nothing else.
What is one bit?
One HIGH-or-LOW decision; the smallest unit of information.
Convert 0x41 to decimal and to a letter.
= the letter 'A'.
What does LSB-first mean?
The bit worth (smallest value) is sent first in time.
Give the bit-time formula and at 9600 baud.
.
Difference between synchronous and asynchronous?
Synchronous has a shared clock wire; asynchronous pre-agrees on bit time and self-times.
What is a rising edge vs a falling edge?
Rising = LOW→HIGH (↑); falling = HIGH→LOW (↓).
Why can't two push-pull outputs share one bus wire?
One pushing HIGH while the other pulls LOW is a short circuit.
In open-drain, which level always wins and why?
LOW — a device can only pull low or float, and the pull-up makes float=HIGH, so any pull-low dominates (wired-AND).
Why does a differential pair reject noise?
Noise adds equally to both wires; the receiver reads the difference, so it cancels: .
On CAN, which bit is dominant, 0 or 1?
0 is dominant (wins); 1 is recessive (yields).
Why is the pull-up rise modelled by ?
The wire is an RC circuit charging toward ; it slows as it nears full, the classic exponential approach.