CAN Bus
Controller Area Network (CAN) is a multi-master serial bus developed by Bosch in the 1980s for automotive applications and now used across machinery, medical, marine, and aerospace.
Overview
- Differential, two-wire (CAN_H, CAN_L); robust against EMI.
- Non-destructive arbitration by message ID (lower ID = higher priority).
- CRC + ACK + automatic retransmission built into the protocol.
- Standardized in ISO 11898.
Frame Formats
- CAN 2.0A — 11-bit ID, up to 8 data bytes.
- CAN 2.0B — 29-bit extended ID.
- CAN FD — up to 64 data bytes, faster data phase (up to 8 Mbit/s).
- CAN XL — newest; up to 2048 bytes, 10+ Mbit/s.
- Frame types: Data, Remote, Error, Overload.
Bit Timing
- Each bit time split into Sync_Seg, Prop_Seg, Phase_Seg1, Phase_Seg2.
- Sample point typically 75–87.5% of bit time.
- SJW (Synchronization Jump Width) handles clock drift.
- Common bit rates: 125, 250, 500 kbit/s, 1 Mbit/s (classical CAN); higher with FD.
Higher-Layer Protocols
- J1939 — heavy-duty vehicles (trucks, agriculture, marine).
- CANopen — industrial, medical, motion.
- DeviceNet — Rockwell industrial.
- NMEA 2000 — marine.
- ISO-TP / UDS — automotive diagnostics.
- OBD-II — automotive emissions.
Wiring
- Twisted pair; 120 Ω termination at each end (one resistor at each physical end).
- Differential ~2 V dominant, ~0 V recessive (between CAN_H & CAN_L).
- Bus length depends on bit rate: 40 m @ 1 Mbit/s, 500 m @ 125 kbit/s.
- Stub length should be < 0.3 m at 1 Mbit/s.
Troubleshooting
- Measure ~60 Ω across CAN_H / CAN_L on a powered-off bus.
- Check for one or both terminators missing (120 Ω or open).
- Watch for bus-off state — a node with too many errors silently drops off.
- Tools: Vector CANalyzer / CANoe, Peak PCAN, Kvaser, BusMaster (open source).
- Check baud rate; common issue is a baud mismatch on one node.