CAN (Controller Area Network)
CAN is a robust serial communication bus developed by Robert Bosch GmbH, designed for reliable data exchange in electrically noisy environments. It uses differential signaling (CAN_H / CAN_L) and a message-based protocol with non-destructive bitwise arbitration, making it ideal for real-time distributed systems in automotive, industrial, and embedded applications.
📌 CAN Key Features
- Differential Bus: CAN_H and CAN_L provide excellent noise immunity
- Multi-master: Any node can initiate transmission when the bus is idle
- Non-destructive Arbitration: Priority resolved by identifier — lower ID wins
- Speed: Up to 1 Mbps (CAN 2.0), up to 5 Mbps data phase (CAN FD)
- Frame Types: Standard (11-bit ID, CAN 2.0A) and Extended (29-bit ID, CAN 2.0B)
- Error Detection: CRC, bit stuffing, ACK check, form check, error counters
- Data Length: 0–8 bytes per frame (up to 64 bytes in CAN FD)
🔄 CAN Timing Waveform
🔧 JSON Editor
📖 CAN Frame Transmission Sequence
1
SOF (Start of Frame): A single dominant bit (logic 0) signals the start of
a frame and synchronises all bus nodes
2
Arbitration Field: Contains the message identifier (11-bit standard /
29-bit extended) plus RTR bit; bitwise arbitration resolves collisions non-destructively
3
Control Field: IDE bit (standard vs extended), reserved bits, and DLC (Data
Length Code, 0–8)
4
Data Field: 0 to 8 bytes of payload, transmitted MSB first
5
CRC Field: 15-bit CRC sequence followed by a recessive delimiter bit for
error detection
6
ACK Field: Transmitter sends recessive; receivers that decoded the frame
correctly drive dominant to acknowledge
7
EOF (End of Frame): Seven consecutive recessive bits mark the end of the
frame
⚙️ CAN Bus Logic Levels
| State | CAN_H | CAN_L | Differential (CAN_H − CAN_L) | Logic | Description |
|---|---|---|---|---|---|
| Dominant | 3.5 V | 1.5 V | ~2.0 V | 0 | Actively driven; wins arbitration |
| Recessive | 2.5 V | 2.5 V | ~0 V | 1 | Bus floats to idle level |
Note:
- Dominant overrides Recessive — if any node drives dominant, the bus is dominant (wired-AND behavior)
- The bus must be terminated with 120 Ω resistors at each end to minimise reflections
- Bit stuffing: after 5 consecutive bits of the same polarity, a stuff bit of opposite polarity is inserted
📦 CAN Frame Types
| Frame | Purpose | Key Detail |
|---|---|---|
| Data Frame | Carry application data | 0–8 bytes payload, standard or extended ID |
| Remote Frame | Request data from another node | RTR = 1, no data field |
| Error Frame | Signal a detected error | 6 dominant + 8 recessive bits destroy the frame |
| Overload Frame | Request extra delay between frames | Similar to error frame, inserted in inter-frame space |
⚡ CAN vs Other Serial Buses
Speed
CAN 2.0: 1 Mbps
CAN FD: 5 Mbps
I2C: 3.4 MHz
Wires
CAN: 2-wire differential
SPI: 4+ wires
I2C: 2 wires
Topology
CAN: Multi-drop bus
SPI: Point-to-point
I2C: Multi-drop
Distance
CAN: Up to 1 km
SPI: < 1 m
I2C: < 1 m