CAN Bus — Controller Area Network
CAN, Controller Area Network, is a robust multi-master bus created for automotive electronics and now used in vehicles, machines, robotics, medical equipment, industrial controllers, and battery systems. It combines differential physical signaling with hardware-level message arbitration and error handling.
Learning Objectives
By the end of this lesson, you should be able to:
- explain CAN as a broadcast message bus, not an address-based device bus;
- describe dominant and recessive states on
CAN-HandCAN-L; - understand non-destructive arbitration using message identifiers;
- identify the major fields in a classic CAN frame;
- debug termination, bit rate, ACK, bus-off, and higher-layer protocol issues.
Message-Based Communication
CAN nodes do not send messages to device addresses. A node broadcasts a frame with an identifier. Every node receives the frame and decides whether that identifier matters.
This publish-subscribe model lets new nodes listen without changing existing wiring.
Dominant and Recessive States
CAN uses a differential pair. In classic high-speed CAN, recessive means both wires sit near the same common-mode voltage. Dominant means the transceiver drives CAN-H higher and CAN-L lower.
| Bus state | Logic | CAN-H typical | CAN-L typical | Differential |
|---|---|---|---|---|
| Recessive | 1 |
about 2.5 V |
about 2.5 V |
about 0 V |
| Dominant | 0 |
about 3.5 V |
about 1.5 V |
about 2 V |
Dominant 0 wins over recessive 1. This is the electrical foundation of CAN arbitration.
Bus Topology and Termination
CAN uses a daisy-chain bus with termination at both physical ends.
With power off, many complete CAN buses measure about 60 ohm between CAN-H and CAN-L because two 120 ohm terminators are in parallel. This is a useful commissioning check, but remove or isolate powered electronics if the equipment manual requires it.
Classic CAN Frame
A standard 11-bit identifier CAN data frame contains:
| Field | Size | Purpose |
|---|---|---|
| SOF | 1 bit | dominant start of frame |
| Identifier | 11 bits | message meaning and priority |
| RTR | 1 bit | data frame or remote request |
| IDE | 1 bit | standard or extended ID format |
| DLC | 4 bits | number of data bytes |
| Data | 0 to 8 bytes | payload in classic CAN |
| CRC | 15 bits plus delimiter | error detection |
| ACK | 2 bits | receivers acknowledge valid frame |
| EOF | 7 bits | end of frame |
Extended CAN uses a 29-bit identifier. CAN FD keeps arbitration compatible but allows a faster data phase and up to 64 data bytes.
Arbitration: Lower ID Wins
If two nodes begin transmitting at the same time, they monitor the bus while sending the identifier. A node that sends recessive 1 but reads dominant 0 loses arbitration and stops transmitting. The winning frame continues without corruption.
Lower numeric identifier means higher priority because the first dominant bit wins.
Error Handling
CAN controllers check frames in hardware:
- CRC detects corrupted bits.
- Bit monitoring detects when transmitted and observed bus levels disagree.
- Bit stuffing rules detect illegal long runs.
- Frame checks validate fixed-format fields.
- ACK checks prove at least one other node received the frame.
Nodes maintain transmit and receive error counters. A badly failing node can enter bus-off state and stop transmitting, preventing it from continuously damaging the network.
Speeds and Cable Length
| Bit rate | Typical use | Distance guidance |
|---|---|---|
| 1 Mbps | automotive, short machines | about 40 m or less |
| 500 kbps | common vehicle networks | about 100 m |
| 250 kbps | heavy vehicles, equipment | about 250 m |
| 125 kbps | building or long machines | about 500 m |
Exact limits depend on cable, topology, transceivers, oscillator tolerance, and bit timing settings. All nodes on one classic CAN segment must use the same nominal bit rate and compatible sample point.
CAN Controller and Transceiver
Many MCUs include a CAN controller, but they still need an external transceiver for the bus.
The controller builds frames, arbitration, CRC, ACK handling, filters, and error counters. The transceiver drives the differential bus and protects the MCU from cable electrical conditions within its rating.
Higher-Layer Protocols
CAN defines transport of frames, not the meaning of payload bytes. Common higher-layer protocols include:
| Protocol | Typical domain |
|---|---|
| OBD-II over ISO 15765 | vehicle diagnostics |
| SAE J1939 | trucks and heavy equipment |
| CANopen | industrial automation |
| DeviceNet | factory automation |
| UAVCAN / Cyphal | robotics and vehicles |
When debugging, separate CAN-layer health from protocol-layer interpretation.
Practical Checks
- Measure about
60 ohmbetweenCAN-HandCAN-Lon an unpowered correctly terminated bus. - Confirm only the two physical ends have
120 ohmtermination. - Keep stubs short, especially at high bit rates.
- Match bit rate and sample point across all nodes.
- Check transceiver supply voltage and standby/silent-mode pins.
- Verify the bus has at least two active nodes; a lone transmitter usually sees ACK errors.
- Read controller error counters before clearing faults.
Common Mistakes
- Treating CAN IDs as destination addresses instead of message labels and priorities.
- Using the same ID for unrelated messages.
- Forgetting that lower numeric ID has higher priority.
- Testing one node alone and misreading ACK errors as wiring failure.
- Installing one or three terminators instead of two.
- Mixing CAN-H and CAN-L.
- Debugging J1939, CANopen, or OBD-II payloads before confirming raw CAN frames are healthy.
Summary
CAN is a differential, multi-master, message-broadcast bus with built-in arbitration and error handling. Its reliability comes from dominant/recessive signaling, priority by identifier, hardware CRC and ACK checks, bus-off behavior, correct termination, and disciplined bit timing. Higher-layer protocols give meaning to the payload bytes.
Further Reading
- Bosch, CAN specification and CAN FD specification.
- ISO 11898 summaries from CAN transceiver vendors.
- Texas Instruments, Introduction to CAN and CAN FD application notes.
- CiA, CANopen and CAN physical layer resources.