Fiveable

💾Embedded Systems Design Unit 8 Review

QR code for Embedded Systems Design practice questions

8.3 CAN bus communication

8.3 CAN bus communication

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
💾Embedded Systems Design
Unit & Topic Study Guides

CAN bus communication is a robust protocol for connecting electronic control units in vehicles and industrial systems. It uses a multi-master architecture, allowing any node to initiate communication when the bus is free, and supports data rates up to 1 Mbps for real-time applications.

CAN employs differential signaling for reliable data transmission in noisy environments. It defines four frame types for data transmission and network management, and uses a non-destructive bitwise arbitration mechanism to determine bus access priority among multiple nodes.

CAN Fundamentals

Overview of CAN

  • CAN (Controller Area Network) is a robust, message-based protocol for communication between electronic control units (ECUs) in vehicles and industrial automation systems
  • Utilizes a multi-master bus architecture, allowing any node to initiate communication when the bus is free
  • Supports data rates up to 1 Mbps, making it suitable for real-time applications (automotive systems, industrial control)

Physical Layer Characteristics

  • CAN uses differential signaling to ensure reliable data transmission in noisy environments
  • The physical layer consists of two wires: CAN High and CAN Low
    • CAN High carries the dominant (logical 0) and recessive (logical 1) states
    • CAN Low carries the inverted signal of CAN High
  • The differential voltage between CAN High and CAN Low determines the logical state of the bus (dominant: CAN High > CAN Low, recessive: CAN High ≈ CAN Low)

CAN Nodes

  • A node in a CAN network is any device connected to the bus, such as an ECU or sensor
  • Each node has a unique identifier (ID) that determines its priority during arbitration
  • Nodes can transmit and receive messages on the CAN bus, allowing for distributed control and monitoring (engine control module, airbag control unit)
Overview of CAN, CAN bus - Wikipedia

Data Transmission

CAN Frame Types

  • CAN defines four frame types for data transmission and network management:
    1. Data Frame: Carries data from a transmitting node to one or more receiving nodes
    2. Remote Frame: Used to request data from another node
    3. Error Frame: Transmitted by any node that detects an error on the bus
    4. Overload Frame: Used to introduce a delay between data or remote frames
  • The structure of a CAN frame includes fields for arbitration (ID), data length, data, CRC, and acknowledgment

Arbitration and Priority

  • Arbitration is the process of determining which node gains access to the bus when multiple nodes attempt to transmit simultaneously
  • CAN uses a non-destructive bitwise arbitration mechanism based on the message ID
    • The lower the ID value, the higher the priority of the message
    • During arbitration, each node compares the ID it is transmitting with the state of the bus
    • If a node transmits a recessive bit while the bus is in a dominant state, it loses arbitration and backs off
  • This arbitration mechanism ensures that the highest priority message is always transmitted first without corruption
Overview of CAN, CAN bus - Wikipedia

Bit Stuffing and Timing

  • CAN employs bit stuffing to maintain synchronization between nodes and to detect errors
  • After five consecutive bits of the same polarity (five dominant or five recessive), a bit of the opposite polarity is inserted (stuffed) into the bit stream
  • The receiving nodes remove the stuffed bits to restore the original data
  • Bit stuffing helps maintain clock synchronization and provides a means for error detection (stuff error)
  • CAN also defines time segments for synchronization, propagation delay compensation, and sample point configuration (Sync_Seg, Prop_Seg, Phase_Seg1, Phase_Seg2)

Error Handling

Error Detection Mechanisms

  • CAN implements several error detection mechanisms to ensure data integrity:
    1. Bit Monitoring: Each transmitting node monitors the bus state and compares it with the transmitted bit
    2. Bit Stuffing: Violations of the bit stuffing rule indicate an error
    3. Frame Check: Errors in the fixed-form fields of a frame (CRC delimiter, ACK delimiter, End of Frame)
    4. Cyclic Redundancy Check (CRC): A 15-bit CRC is calculated and transmitted with each frame for error detection
    5. Acknowledgment (ACK): Receiving nodes acknowledge the correct reception of a frame
  • If any of these error detection mechanisms fail, the node detecting the error transmits an Error Frame

Error Confinement and Recovery

  • CAN uses an error confinement mechanism to prevent faulty nodes from disturbing the network
  • Each node maintains two error counters: Transmit Error Counter (TEC) and Receive Error Counter (REC)
    • The counters are incremented and decremented based on the detected errors and successful transmissions/receptions
    • Nodes can be in three states depending on the counter values: Error Active, Error Passive, and Bus Off
  • Error Active nodes can actively participate in error signaling and have a TEC and REC below 128
  • Error Passive nodes have a TEC or REC between 128 and 255 and can still transmit messages but do not actively signal errors
  • Bus Off nodes have a TEC greater than 255 and are disconnected from the bus until a reset occurs
  • The error confinement mechanism ensures that a faulty node does not continuously disrupt the network and allows for automatic recovery when the fault condition is resolved
Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly → and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot

2,589 studying →