CAN communication Overview

1. What is CAN?

2. Key Features of CAN

  • Multi-master protocol: Any node can transmit data if the bus is free.
  • Message-based communication: No node addresses; instead, messages are identified by an ID.
  • Priority-based arbitration: Lower ID has higher priority.
  • Error detection and fault confinement: Built-in mechanisms for robustness.
  • Speeds up to 1 Mbps (Classical CAN); up to 5 Mbps (CAN FD).

3. CAN Network Architecture

  • CAN Controller: Integrated in MCU or as an external IC, handles protocol logic.
  • CAN Transceiver: Converts digital signals to differential voltage signals and vice versa.
  • CAN Bus (Twisted Pair): Two wires – CAN_H (High) and CAN_L (Low), used to transmit differential signals.
  • CAN bus must be terminated with two 120Ω resistors at both ends

4. CAN Message Frame Structure

FieldBitsDescription
Start of Frame1Indicates start of message
Identifier11/29Message ID (standard or extended)
RTR Bit1Remote Transmission Request
IDE Bit1Identifier Extension (0 = 11-bit, 1 = 29-bit)
DLC (Data Length)4Number of data bytes (0–8 for classical CAN)
Data Field0–64Actual data bytes
CRC Field15+1Error checking
ACK Slot2Acknowledgment from receiver
End of Frame7End marker

5. Arbitration and Priority

  • Dominant Bit (0) overrides Recessive Bit (1) on the bus.
  • Priority is determined by the identifier; lower IDs have higher priority.

6. Error Detection Mechanisms

  1. Bit Error – Bit differs from what was sent.
  2. Stuff Error – More than five consecutive bits of the same polarity.
  3. CRC Error – Mismatch in CRC value.
  4. Form Error – Fixed-format fields are violated.
  5. ACK Error – No acknowledgment received.

7. Types of CAN Frames

  • Data Frame – Carries data from sender to receiver.
  • Remote Frame – Requests data from another node.
  • Error Frame – Indicates an error has occurred.
  • Overload Frame – Introduces delay between data frames.

8. Practical Use in Automotive

  • Powertrain CAN – Engine, transmission, etc.
  • Body CAN – Doors, lighting, HVAC, etc.
  • Infotainment CAN – Audio, navigation systems.
  • Diagnostics CAN (OBD-II) – Standardized diagnostic interface.

9. CAN in AUTOSAR

  1. CAN Driver – Interface to the hardware.
  2. CAN Interface (CanIf) – Hardware abstraction.
  3. PDU Router (PduR) – Routes Protocol Data Units.
  4. Communication Stack (COM) – Handles signal-level processing.
  5. Application Layer / Software Component – Uses RTE to send/receive data.

Leave a Reply

Your email address will not be published. Required fields are marked *