5.5.6 · D2Embedded Systems & Real-Time Software

Visual walkthrough — CAN bus — frame format, arbitration, error handling — critical in aerospace

1,999 words9 min readBack to topic

Everything below rests on one physical fact about the wire. We start there, assuming you know nothing about CAN.


Step 1 — One wire, one rule: the wired-AND

WHAT. Every node on a CAN bus is connected to the same pair of wires. When a node wants to send a bit, it either pulls the wire down (sends a 0) or lets it float up (sends a 1). The wire itself obeys one rule: it is high (1) only if every node lets it float; the instant any node pulls down, the whole wire reads 0.

WHY this rule and not another. This is exactly the behaviour of a logical AND gate: output is 1 only when all inputs are 1. See Open-collector buses and Wired-AND logic — the electronics literally wires the outputs together so that pulling-down wins. We call the 0 the dominant bit (it dominates) and the 1 the recessive bit (it yields).

PICTURE. Below, three nodes feed one wire. In the top row all send 1 → bus floats to 1. In the bottom row one node pulls 0 → the whole bus collapses to 0. That single amber node "wins" the wire without asking anyone.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 2 — Every node listens to itself

WHAT. A CAN node does not just send a bit — in the same bit-time it also reads the bus back and compares. Two outcomes:

  • I sent 0 (dominant). The bus is 0. ✅ Match — nothing surprising.
  • I sent 1 (recessive) but the bus reads 0. ❗ Mismatch — somebody else pulled it down.

WHY this matters. That mismatch is the only signal a node needs. It means: "another node, transmitting at the same time as me, sent a dominant bit here." No message was exchanged to tell it this — it deduced it from physics.

PICTURE. The node's transceiver is drawn as a fork: one prong sends, one prong senses. When "sent" and "sensed" disagree, the amber alarm fires.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 3 — Send the ID first, most-significant bit first

WHAT. Right after the Start-of-Frame bit, every competing node transmits its Identifier (ID), bit by bit, starting from the most significant bit (MSB). The ID is an 11-bit number (standard CAN).

WHY MSB-first. Numbers are compared from the top down: 176 vs 184 differ first in a high digit, not a low one. Sending MSB-first means the first bit where two IDs differ is also the most significant place they differ — so the numerically smaller ID reveals its advantage as early as possible.

PICTURE. Two IDs laid out as bit rows, MSB on the left, an arrow showing transmission time flowing left→right.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 4 — Play it out: two nodes race, bit by bit

WHAT. Let Node A send ID 0b000 1011 0000 (= 176) and Node B send 0b000 1011 1000 (= 184). Both start together. At each bit-time the bus shows the AND, and each node checks its own back-off condition from Step 2.

bit A sends B sends bus who is unhappy?
10…4 identical identical same nobody — perfect tie
3 0 1 0 B sent 1, reads 0 → B backs off
2…0 A alone (silent) A's bits A finishes cleanly

WHY this is the whole game. Up to bit 3 the two IDs agree, so the bus matches what both sent — nobody notices a fight. At bit 3 they first differ: A drives dominant 0, B drives recessive 1. Wired-AND → 0. A sees 0 = what it sent ✅. B sees 0 ≠ its 1 ❗ → B silently withdraws and will retry the whole frame later. Because A never read a mismatch, A's frame was never disturbed — it just keeps going.

PICTURE. The two bit-streams stacked, the bus row beneath, and a big amber marker at bit 3 where B drops out.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 5 — Why "lowest ID = highest priority" falls out for free

WHAT. We never wrote a priority rule. Priority is a consequence of the wired-AND plus MSB-first sending.

WHY. Whenever two IDs first differ, the one with 0 (dominant) there survives and the one with 1 (recessive) backs off. A 0 in a high bit position is exactly what makes a binary number smaller (Step 3). Therefore:

Read each link: a smaller number has dominant 0s in the high positions; dominant bits win the wired-AND; winning the wired-AND means never reading a mismatch; never reading a mismatch means you keep the bus. So assign your engine-fire alarm ID 0x001, never 0x7FF.

PICTURE. A ruler of IDs from 0x000 (top, highest priority) to 0x7FF (bottom, lowest), with the fire alarm near the top and the cabin-light status near the bottom.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 6 — Edge case: identical IDs (the degenerate race)

WHAT. What if two nodes transmit the same ID at the same time? Then no bit ever mismatches during arbitration — both stay in the race all the way through the ID.

WHY it doesn't break. CAN's rule is that an ID should be transmitted by only one node network-wide (each message ID has a single producer). If two nodes genuinely send the identical ID and identical data, the bus AND is identical to both — they coexist harmlessly and both "win," sending the same bits. If they send the same ID but different data, they still tie through arbitration, but at the first differing data bit one node reads a mismatch — and now it is past arbitration, so this counts as a real bit error (Step 7), not a graceful back-off. The lesson: unique IDs per sender are a design requirement (see ARINC 825 for how aerospace allocates them).

PICTURE. Two identical bit-rows producing a bus row identical to both — no amber marker anywhere in the ID region — with a warning tag where data begins.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

Step 7 — Edge case: the loser must not be punished

WHAT. Backing off during arbitration is normal, not an error. So the bit-mismatch check (Step 2) is disabled during the arbitration field and the ACK slot. A recessive-sent / dominant-read there means "I lost / someone ACKed," never "fault."

WHY. If losing arbitration incremented a node's error counter, a low-priority node on a busy bus would rack up "errors" for simply being polite, and eventually silence itself. That would be catastrophic. So the CRC cyclic redundancy check and the fault-confinement counters (TEC/REC) only judge bits outside arbitration and ACK. A node causing genuine bit errors gets +8; a node merely witnessing errors gets +1; success heals −1 — the asymmetry that makes a broken transmitter bench itself long before it can jam a certified system.

PICTURE. A timeline of one frame with two shaded "no-fault zones" (arbitration + ACK) where mismatches are expected, and the CRC-guarded zone where they are punished.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace

The one-picture summary

WHAT. One diagram compresses the whole chain: wired-AND → self-listening → MSB-first ID race → smallest ID survives → non-destructive win.

Figure — CAN bus — frame format, arbitration, error handling — critical in aerospace
Recall Feynman: tell it back in plain words

Picture a wire with a strange rule: if anybody presses their button, the wire says 0; only when nobody presses does it say 1. Every node also watches the wire while it talks. Now everyone shouts their secret number at once, biggest digit first. As long as everyone's digit matches, nobody notices a fight. The first time your digit is a 1 but the wire shows 0, you know someone with a smaller number is here — so you shut up and try again later, your message untouched. Because a 0 up front is exactly what makes a number small, the smallest number always wins and finishes its whole sentence cleanly. During this shouting match we don't count anyone's back-off as a mistake — quitting is polite, not wrong. Only after the numbers are decided do we start checking for real errors. That's CAN arbitration: no boss, no collisions, no lost words — just one wire, one AND gate, and a lot of good manners.


Flashcards

Why is a recessive-vs-dominant mismatch NOT an error during arbitration?
Losing arbitration is normal politeness, not a fault; if it counted as an error, low-priority nodes on busy buses would silence themselves. The bit-check is disabled in the arbitration and ACK fields.
At which bit do IDs 176 and 184 diverge, and who backs off?
At bit 3 (0-indexed from the LSB): A sends dominant 0, B sends recessive 1, bus reads 0, so B (the larger ID) backs off.
Why does smaller ID mean higher priority, mechanically?
A smaller binary number carries dominant 0s in its high bit positions; dominant bits win the wired-AND, so that node never reads a mismatch and keeps the bus.
What happens if two nodes send the same ID but different data?
They tie through the whole ID, then at the first differing data bit — now PAST arbitration — one reads a real bit error; hence IDs must be unique per sender.