0% found this document useful (0 votes)
67 views53 pages

Can 1

The document provides an overview of the Controller Area Network (CAN) protocol, detailing its history, architecture, and key features such as multi-master communication and real-time capabilities. It covers the structure of CAN frames, including types, identifiers, and error detection mechanisms, as well as its applications in various fields like automotive, industrial, and medical systems. Additionally, it outlines international standards and advantages of using CAN Bus over conventional cabling.

Uploaded by

najjaymourad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views53 pages

Can 1

The document provides an overview of the Controller Area Network (CAN) protocol, detailing its history, architecture, and key features such as multi-master communication and real-time capabilities. It covers the structure of CAN frames, including types, identifiers, and error detection mechanisms, as well as its applications in various fields like automotive, industrial, and medical systems. Additionally, it outlines international standards and advantages of using CAN Bus over conventional cabling.

Uploaded by

najjaymourad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Phase 1: Fundamentals of CAN (Basic Level)

Goals:
•Understand what CAN is and why it's used
•Learn basic terminology and how CAN works

Topics: 3.CAN Protocol Basics


1.Introduction to CAN 1. Frame structure (std & extd frames) & Overview
1. What is CAN? 2. Bit stuffing
2. History and evolution 3. Arbitration process
3. Use cases (automotive, industrial, medical, etc.) 4. Message priority & CAN hardware overviews
4. Advantage of CAN Bus
5. International CAN Standards 4.CAN Frame Types
1. Data frame
2.CAN Bus Architecture 2. Remote frame
1. Bus topology 3. Error frame
2. Nodes: ECU, sensors, actuators 4. Overload frame
3. Multi-master & message broadcasting
4. Data Rates in Automotive Communication
5. Transmission Principles in CAN Communication
6. Hardware Characteristics of CAN Systems Recommended Resources:
7. Signal coding •Microchip’s CAN Basics App Note
8. CAN OSI Model •The "CAN Protocol Tutorial" on NI.com
1.What is CAN?
Definition: Controller Area Network (CAN) is a robust communication protocol developed by Bosch in the 1980s, designed
to allow microcontrollers and devices to communicate with each other without a host computer.

Key Features:
•Multi-master (any node can initiate communication)
•Message-based (not device-addressed)
•Real-time capabilities
•High reliability and error detection
•Widely used in automotive, industrial, aerospace, and medical systems

Real-World Analogy:
Imagine CAN as a group chat in WhatsApp. Anyone can send a message, and all others receive it, but only those interested
in a specific topic (message ID) act on it.
Timeline of CAN Bus :

1987 - CAN controller


1983 - Development of 1986 - Protocol was
chip made by Philips &
CAN Bus Released by SAE
Intel

1988 – BMW 8 Series is


first production vehicle
to feature CAN Bus

1991 – CAN 2.0


Specification Published 1996 – OBD –II
Standard Incorporated
with CAN
1993 – CAN 2012 – BOSCH Released
Specification ISO 11898 CAN with Flexible Data
Released Rate
Standards:
•CAN 2.0A – Standard 11-bit identifiers
•CAN 2.0B – Extended 29-bit identifiers
•CAN FD – Increases data rate and payload (up to 64 bytes)
Examples of CAN in Automotive Applications
High-Speed CAN (500–1000 Kbit/s)
•Engine Control
•Braking System
•Transmission (Gearbox)

Low-Speed CAN (25–125 Kbit/s)


•Airbag System
•Central Locking
•Climate Control (Air Conditioning)
•Lighting System
Automotive Applications
•Engine control
•Transmission
•Airbags
•ABS (Anti-lock Braking System)
•Power windows, mirrors, and locks
•Infotainment systems

Industrial Automation
•PLC (Programmable Logic Controller) communication
•Factory sensors and actuators
•Robotic arms coordination

Medical Equipment
•MRI and CT scan machines
•Patient monitoring systems
•Surgical robotics

Other Fields
•Aerospace: Avionics, flight control systems
•Agriculture: Smart tractors and harvesters
•Marine: Navigation and engine systems
Advantage of CAN Bus

Conventional Cabling

CAN Bus

Over

▪ Less Wire ▪ Less Space Requirements


▪ Less Connections ▪ Easy to add New Nodes
▪ Less Weight ▪ Lower Assembly Cost
▪ Less EMI Problems ▪ Increase Transmission Reliability
International CAN standards

•ISO 11898
Road vehicles: CAN for high-speed communication
•ISO 11519
Road vehicles: Low-speed serial data communication - Low-Speed CAN / VAN
•ISO 11992
Road vehicles: Electrical connections between towing and towed vehicles
•EIA RS-485
Electrical Characteristics of Generators and Receivers for Use in Balanced Digital Multipoint Systems
(formerly used for CAN Physical Layer)
2. CAN BUS ARCHITECTURE
Bus Topology

What is a "bus topology"?


In networking, bus topology means all devices (called nodes) are connected to a single communication line – the CAN bus.

•CAN Bus = A pair of twisted wires (CAN_H and CAN_L) used to transmit signals
•All nodes share the same bus, making communication simpler and wiring lighter

Feature Description
Shared medium All nodes connect to the same two-wire bus
Full-duplex? No – CAN is half-duplex (data travels in one direction at a time)
Cost-effective Reduces the need for complex wiring
Fault-tolerant CAN has built-in error handling and message validation
What is a Node?
A node is any device connected to the CAN bus. It can send, receive, or just monitor data.

Type Role Example


ECU (Electronic Control Unit) Controls a system or subsystem Engine Control Module
Measures and reports physical Speed sensor, temperature
Sensor
conditions sensor
Performs actions based on
Actuator Fuel injector, motor, valve
control signals
Each node includes:
•A CAN controller (logic for sending/receiving)
•A CAN transceiver (converts logic levels to voltages)
•A microcontroller (makes decisions)
Multi-Master & Message Broadcasting
Multi-Master System
Unlike traditional networks where only one device is the "master", in CAN every node is equal and can try to send
messages at any time.
•This is called a multi-master architecture
•There’s no central controller
Message Broadcasting
In CAN, messages are broadcast, not sent directly
to a specific node.
•All nodes see every message
•Each node decides independently whether to
accept or ignore a message
•This model is called "publisher-subscriber" or
"listener-speaker"

How does it work?


•Each message has an identifier (ID) indicating its type or source.
•Nodes are pre-programmed to respond to specific message IDs.
•For example: ID 0x101 might represent "Engine Temperature" — only
the engine cooling ECU will act on it, others will ignore it.
Data Rates in Automotive Communication
Real-Time Capabilities
❑ Good real-time performance
small latency ("fast enough") Essential for automotive applications

Data Rate vs. Bus Length


•Class C: •Class A:
• Data Rate: 1 Mbit/sec • Data Rate: 50 kBit/sec
• Bus Length: 40 meters • Bus Length: 1000 meters
•Class B:
• Data Rate: 125 kBit/sec Typical Definitions
• Bus Length: 500 meters •Low-Speed: 25 kBit/sec → up to 125 kBit/sec
•High-Speed: 500 kBit/sec → up to 1 Mbit/sec
Transmission Principles in CAN Communication
❑ Multicast / Broadcast Philosophy
•CAN messages do not contain sender or receiver addresses
•Messages are directed based on information content, not device identity

❑ Bus Access Principle: CSMA/CA


Carrier Sense Multiple Access with Collision Avoidance

•Carrier Sense:
Every node continuously monitors the bus level
→ Enables detection of both foreign and own CAN frames

•Multiple Access:
Any node can initiate transmission when the bus is free

•Collision Avoidance:
If multiple nodes begin transmission simultaneously,
→ All but one withdraw, ensuring only one message is sent
Hardware Characteristics of CAN Systems

1. Hardware Message Acceptance Filtering


•Only messages containing relevant information are processed
➔ Reduces CPU load

2. Sophisticated Hardware Error Management


•Includes error prevention and detection mechanisms
•Automatic re-transmission of erroneous messages
➔ Ensures very high transmission security

3. Standardized Connector
•Recommended: 9-pin D-sub connectors (DIN 41652)
Signal Coding
❑ NRZ (Non Return to Zero)coding is a method of mapping binary data to voltage levels where:
•Bit '1' = Recessive (5V)
•Bit '0' = Dominant (0V)

Key Characteristics
•Voltage remains constant for consecutive bits of the same value.
•No return to zero between bits
•Different Voltage Levels Defined for Different Purpose

•Recessive (5V)
1 0 1 0 0 0 1 1 0 1 0 0 1
•Dominant (0V)
OSI 7 Layer Model -

7 Application Layer1 Applications, operating system

6 Presentation Layer
Conversion of data formats
5 Session Layer Task Synchronization, buffers, connection setup and monitoring, access right control
4 Transport Layer Address conversion, routing, segmentation
3 Network Layer Setup of logical connection, transport protocol
2 Data Link Layer Transmission security, frame setup, error management

1 Physical Layer Electrical / Mechanical characteristics: Transmission medium, wiring, connectors,


encoding, signals
Electronics Control Unit
CAN in OSI Model -

7 Application Layer1

6 Presentation Layer

5 Session Layer Not Specified in CAN Specification


High Layer Protocols
4 Transport Layer

3 Network Layer
Implemented in Hardware, Low Layer CAN Protocol
2 Data Link Layer Acceptance Filtering, Error Management, de Stuffing,
Arbitration , Frame Setup, Acknowledgement
1 Physical Layer Encoding/Decoding, bit timing, Synchronization,
Wiring, connector , Bus , Transceiver characteristics
Electronics Control Unit
CAN ISO Coverage on OSI Layer 1 & 2

LLC: Bus Off Recovery


CAN Driver Software

DATA Link Layer


LLC (Logical link Control) Acceptance filtering
MAC (Medium Access Control) Overload Notification
2
MAC : Data De-Encryption, Frame Setup, De-
CAN Controller Stuffing, Collision Detection, Arbitration, Error
Management, Acknowledgement

PLS: Bit Encoding / Decoding, Bit Timing ,


Synchronization
Physical Layer
PLS (Physical Signaling)
PMA(Physical Medium Attachment)
MDT(Medium Dependent CAN Transceiver
1 Hardware) PMA: Transceiver Characteristics
MDT: Wiring, Connector, Bus
CAN Bus
3.CAN Protocol Basic & Frame Structure:
A CAN frame (or message) is the fundamental unit of communication on the CAN bus.
It consists of several fields, each with a specific role.
Frames: Overview

Frame: "Envelope" for transmission data


Exact frame format is defined in CAN specification

Note: CAN Frame ≠ CAN Message !!!


A CAN message can be spread out over several CAN frames

Four different frame types: Frames


•Data Frame: Transmission of regular data
•Remote Frame: Remote request for data transmission
•Overload Frame: Indication of bus overload situations DATA Frame Remote Frame
•Error Frame: Indication of transmission errors

Overload Frame Error Frame


Standard Format 11 bit identifier :

If 11 bit identifier:
2˄11 = 2048 Identifier Possible
If 29 bit identifier:
2˄29 = 53,68,70,912 Identifier Possible
CAN Data Frame (11-bit ID)

Field Bits Purpose


Start of Frame (SOF) 1 Marks the beginning of a frame
Identifier 11 Message ID (used for priority)
RTR (Remote Transmission
1 0 = Data frame, 1 = Remote frame
Request)

IDE (Identifier Extension) 1 0 = Standard frame, 1 = Extended frame

Reserved 1 Reserved for future use


Number of bytes in Data Field (0–8 for
DLC (Data Length Code) 4
CAN 2.0, up to 64 for CAN FD)
Data Field 0–64 bytes Actual data (payload)
CRC 15 + 1 Error detection
ACK 2 Acknowledgment by receivers
IDLE State:
End of Frame (EOF) 7 Marks the end of the frame •When there is no frame on the bus, the bus is in an IDLE state.
IFS (Inter-Frame Space) 3 Time gap before next frame •In the IDLE state, the bus has a recessive bit (logic 1).
•Dominant Bit (Logical 0):
• Represents a LOW voltage differential between CAN_H and CAN_L.
• CAN_H is higher than CAN_L.
• This state overrides the recessive state if both are transmitted simultaneously.
• Used to start communication or indicate a message is being sent.
•Recessive Bit (Logical 1):
• Represents a HIGH voltage differential that is close to zero (CAN_H ≈ CAN_L).
• This state is weaker and can be overridden by a dominant bit.
• Used when the bus is idle or no node is actively transmitting.
Start of Frame (SOF):
•Every data frame starts with a dominant bit called the Start of Frame (SOF).
•SOF is 1 bit long and is always dominant (logic 0).
•This bit informs all nodes about the start of a new frame on the bus, signaling that the bus is
no longer idle and synchronizing all receiving (Rx) nodes with the transmitting (Tx) node.

Bus Idle SOF Arbitration Field


•Recessive
1 0
•Dominant
Message ID:
•CAN is a message-based protocol where each frame is identified by a Message ID.
•In a standard frame, the Message ID is 11 bits long.
•Typically, the 11th and 4th bits are masked for complex reasons, resulting in 9 unique bits in the Message ID.
•This allows for 2⁹ = 512 different CAN frames in a single CAN network, with the Message ID ranging from hexadecimal 000 to 7FF.
•Mentioned as Identifier in the above figure.

Remote Transmission Request (RTR):


•After the Message ID, there is a single bit called the Remote Transmission Request (RTR).
•RTR differentiates between a data frame and a remote frame:
•RTR = 0: Data Frame
•RTR = 1: Remote Frame

Reserved Bits:
•Following the RTR bit are two reserved bits, R1 and R0.
•These bits are always recessive and were originally intended for future enhancements of the CAN protocol.
•Nowadays, R1 is used as the IDE bit to differentiate between Standard and Extended frames, while R0 is used
as the FDF bit to differentiate between CAN and CAN-FD frames.
Data Length Code (DLC):
•The next field is the Data Length Code (DLC), which indicates the number of bytes of data in the frame.
•DLC is 4 bits long and can range from 0 to 8, allowing for up to 8 bytes of data.
Data Field:
•Following the DLC is the actual data field, which contains the data bytes
specified by the DLC.
•The data field can contain a maximum of 8 bytes and a minimum of 0 bytes.

Checksum (CRC):
•After the data field, there is a 15-bit CRC (Cyclic Redundancy Check) field used for error detection.
•The transmitting node computes the CRC checksum and includes it in the frame.
•The receiving node also computes its own checksum for the received data and compares it with the
CRC field. If they match, the frame is considered valid; otherwise, it is invalid.

CRC Delimiter (CD):


•Following the CRC field is the CRC Delimiter, a single bit used to provide time for the receiver to validate the frame.
•The CRC Delimiter is always recessive.

Acknowledgement (ACK):
•The next field is the Acknowledgement (ACK) slot.
•The transmitting node puts a recessive bit in the ACK slot.
•All receiving nodes that successfully received and validated the frame will overwrite this bit with a dominant bit to acknowledge receipt.
•If the transmitting node does not see a dominant bit in the ACK slot, it signals an acknowledgement error.
Acknowledgement Delimiter (AD):
•Following the ACK slot is the Acknowledgement Delimiter, a single recessive bit.

End of Frame (EOF):


•The EOF field consists of 7 consecutive recessive bits, marking the end
of the frame.

Intermission (IFS):
•The EOF field is followed by 3 bits of Intermission (IFS) or Interframe Space.
•These 3 bits signify the end of the frame and the bus returning to the IDLE state.

Frame Composition:
•Arbitration Field: Message ID, RTR
•Control Field: Reserved bits (R1, R0), DLC
•Data Field: Actual data bytes
•CRC Field: CRC checksum and CRC Delimiter
CAN Data Frame (11-bit ID)
•Acknowledgement Field: ACK slot and Acknowledgement Delimiter
•EOF Field: EOF and IFS bits

Conclusion:
•Every data frame ends with 11 consecutive recessive bits: 1 bit of Acknowledgement Delimiter, 7 bits of EOF, and 3 bits of IFS.
•Once the frame ends, the bus is idle again, and any node can start transmitting its own frame.
Bit Stuffing As per CAN standard, more than 5 consecutive bits of the same polarity in CAN frame between the
Diagram: Bit Stuffing start of Frame(SOF) to CRC field is considered as a faulty frame on CAN Bus and it signalled as stuff
error on CAN line.

•CRC code is calculated before bit stuffing is done

•Bit stuffing is done by the sender directly before transmission

•De-stuffing is done by the receiver directly after reception

•CRC code check is done after de-stuffing the frame

•Bit stuffing is applied to part of the frame from SOF to CRC field
What is CAN Arbitration?

CAN uses a priority-based arbitration mechanism to decide which node gets to transmit when multiple nodes attempt to send
messages simultaneously. Each message has an identifier, and the lower the binary value of the identifier, the higher its priority.

The Arbitration Field is part of the CAN frame and includes:


1. Identifier
Standard CAN (11-bit ID): Uses 11 bits for the identifier.
Extended CAN (29-bit ID): Uses 29 bits for the identifier.
The identifier determines the priority of the message — lower binary value = higher priority.
2. RTR (Remote Transmission Request) Bit
Indicates whether the frame is a data frame or a remote frame.
• 0 = Data Frame
• 1 = Remote Frame

Arbitration Field Control Field


Bus Idle SOF
MSB LSB RTR
•Recessive
1 0 11 – Bit Identifier 0 0
•Dominant
Arbitration Process (Bitwise Priority Resolution)

How it works:
1.All nodes monitor the bus while transmitting.
2.Bits are sent using:
1. Dominant (0): Overrides recessive.
2. Recessive (1): Can be overridden by dominant.
3.Arbitration is based on the identifier field, bit by bit.

Key Rule:
•Lower ID = Higher Priority
•If a node sends a recessive bit but sees a dominant bit, it loses arbitration and stops transmitting.

Example: Arbitration in Action

Let’s say three nodes try to send messages at the same time: Step-by-step Arbitration:

•All nodes send the first bit:


Node Identifier (Binary)
•A sends 1 (recessive)
A 10000000000 •B sends 0 (dominant)
B 01000000000 •C sends 0 (dominant)
C 00100000000
•A sees a dominant bit on the bus → A loses arbitration.
Next bit:
• B sends 1 (recessive) Arbitration Field Control Field
Bus Idle SOF
• C sends 0 (dominant) LSB RTR
MSB
•Recessive
• B sees a dominant bit → B loses arbitration. 1 0 11 – Bit Identifier 0 0
•Dominant
• C continues transmitting → C wins arbitration.
Why This is Efficient
•Non-destructive: Losing nodes don’t corrupt the message.
•Automatic retry: Losing nodes retry after the bus is free.
•Real-time capable: Critical messages (lower ID) always get through first.

Summary

Feature Description
Arbitration Field Identifier + RTR
Priority Mechanism Lower ID = Higher Priority
Bit Transmission Dominant (0) > Recessive (1)
Collision Handling Non-destructive, automatic retry
Result Only one node transmits, others wait
Ex:2 Summary Logic
• Node A: 10010011011
Node A Node B Node C Bus Result Bus Result = Dominant (0) if any node sends 0
• Node B: 10010001011 Bus Result = Recessive (1) only if all nodes send 1
• Node C: 10010001001 1 0 1 0

Bit Node A Node B Node C Bus Result Winner So Far


1 1 (R) 1 (R) 1 (R) 1 (R) All still in
2 0 (G) 0 (G) 0 (G) 0 (G) All still in
3 0 (G) 0 (G) 0 (G) 0 (G) All still in
4 1 (R) 1 (R) 1 (R) 1 (R) All still in
5 0 (G) 0 (G) 0 (G) 0 (G) All still in
6 0 (G) 0 (G) 0 (G) 0 (G) All still in
7 1 (R) 0 (G) 0 (G) 0 (G) Node A loses
8 1 (R) 1 (R) 1 (R) 1 (R) B & C still in
9 0 (G) 0 (G) 0 (G) 0 (G) B & C still in
10 1 (R) 1 (R) 0 (G) 0 (G) Node B loses
11 1 (R) 1 (R) 1 (R) 1 (R) Node C wins
Message Priority CAN_H and CAN_L:
How is priority handled? The Two Wires
•The identifier field (11 or 29 bits) defines the priority. CAN uses a twisted pair of wires:
•Lower IDs are more important and win arbitration. •CAN_H: Carries the high side of the differential signal
•CAN_L: Carries the low side
Message ID (Hex) Priority
These wires carry differential voltage signals — more immune
Engine speed 0x100 High
to noise than single-ended signals.
Door lock status 0x600 Lower •CAN uses differential voltage for noise immunity
Infotainment 0x700 Even lower •Only dominant bits win on the bus

Real-time safety
•Critical functions (e.g., airbags, engine control) are
guaranteed faster bus access
Why Terminate the Bus?
To prevent signal reflections, which can distort data on the
bus, termination resistors are used.
Configuration:
•Two 120Ω resistors, one at each end of the bus
•Match the impedance of the cable (~120Ω)

Parallel Resistance Example:


If measured from one end to the other with power off, the total bus resistance should be:
1 / (1/120 + 1/120) = 60Ω
Bit Rate Max Length
Cable Requirements 1 Mbps 40 meters
•Shielded or unshielded twisted pair
500 kbps 100 meters
•Wire gauge: 22 to 24 AWG
•Impedance: 120Ω ±10% 250 kbps 250 meters
•Capacitance: as low as possible 125 kbps 500 meters
50 kbps 1,000 meters
Data Frame (Control Field):
•IDE (Identifier Extension) Bit:
• Dominant for Standard Frames
• Recessive for Extended Frames
•r0 Bit:
• Not used; it's reserved for future extensions
•DLC (Data Length Code):
• A 4-bit field indicating the number of data bytes in the Data Field
• Valid values range from 0 to 8
• Values beyond 8 are not allowed

Arbitration Field Control Field Data Field


RTR IDE r0 DLC3 DLC2 DLC1 DLC0
•Recessive
0 0
•Dominant
Data Frame (Data Field):

•The Data Field contains the actual information being transmitted.


•The number of data bytes can range from 0 to 8 bytes.
•This number is specified by the Data Length Code (DLC).
•Transmission begins with byte 0, and each byte is sent MSB (Most Significant Bit) first.

Control Field Data Field CRC Field


DLC
•Recessive
0..64 Bits ( 0..8 Bytes )
•Dominant
Data Frame (CRC Field):

•It contains a 15-bit Cyclic Redundancy Check (CRC) code.


•CRC is a fast and effective method for error detection.
•The CRC Field Delimiter (DEL) marks the end of the CRC field.
•The DEL bit is always recessive.

Data Field CRC Field ACK Field


DEL
•Recessive
15 Bit ( CRC Code ) 1 0
•Dominant
Data Frame (ACK Field):
•The field contains the ACK bit, which can be either dominant or recessive.
•The ACK Field Delimiter (DEL) marks the end of the ACK field.
•The DEL bit is always recessive.

CRC Field ACK Field EOF Field


DEL ACK DEL
•Recessive (5V)
1 0 1 1
•Dominant (0V)
ACK Bit values and their interpretation

Acknowledgement Procedure
1.The sender transmits a recessive bit in the ACK bit slot.
2.Receivers that received the frame without error respond by transmitting a dominant bit in the ACK bit slot.
Interpretation of ACK Bit Values

•Dominant ACK Bit:


• Indicates that at least one node received the frame without error.
• Does not guarantee that the frame was completely error-free.

•Recessive ACK Bit:


• May indicate that no node received the frame without error.
• Or that no other node is connected to the bus.

CRC Field ACK Field EOF Field


DEL ACK DEL
•Recessive (5V)
1 0 1 1
•Dominant (0V)
Data Frame (EOF Field):

1.Consist of 7 consecutive recessive bits


2.Marks the end of data frame

ACK Field EOF Field IFS


DEL
•Recessive (5V)
1 1 1 1 1 1 1 1 1
•Dominant (0V)
Data Frame: Interframe Space

•The IFS consists of at least three consecutive recessive bits.


•No transmission is allowed during the IFS.
•It is required by controllers to copy received frames from their Rx buffers.
•The combination of ACK Field Delimiter + End of Frame (EOF) + IFS results in 11 consecutive recessive bits.

EOF Field Interframe Space Bus Idle

•Recessive (5V)
1 1 1 1 1
•Dominant (0V)
Data Frame: Maximum Size
Maximum frame size (for 8 Data Bytes)

Standard Frame CAN 2.0A Extended Frame CAN


(11-bit identifier) 2.0B (29-bit identifier)
Without stuff bits 111 bits 131 bits
With stuff bits 130 bits 154 bits

Remote Frame:
•Used to request transmission of a specific Data Frame
•Similar to a Data Frame, but without Data Field
•Remote Transmission Request (RTR) bit is recessive
•Same identifier as the Data Frame which is requested
•Note: When Remote Frame is transmitted at the same
time as corresponding Data Frame, Data Frame wins
arbitration because of dominant RTR bit
Example Scenario: Vehicle Diagnostics
A vehicle’s Electronic Control Unit (ECU) responsible for diagnostics wants to read the engine
temperature from another ECU (say, the Engine Control Module).
How Remote Frame Works Here
1.Requesting ECU (Diagnostics ECU) sends a Remote Frame with:
•Identifier: Same as the Data Frame that would carry engine temperature (e.g., 0x100)
•RTR bit: Set to recessive (indicating a Remote Frame)
•No Data Field: Because it's a request, not actual data
2.Responding ECU (Engine ECU) receives this Remote Frame and replies with a Data Frame:
•Identifier: 0x100 (same as the request)
•RTR bit: Set to dominant
•Data Field: Contains actual engine temperature (e.g., 85°C encoded in bytes)

Why Use Remote Frame?


•Efficient polling: ECUs can request data without sending full
messages.
•Standardized communication: Ensures all nodes understand the
request format.
•Arbitration logic: If both Remote and Data Frames are sent
simultaneously, the Data Frame wins due to its dominant RTR bit.
Error Frame:
Error types: Bit errors
The status of the transmitted bit is observed on the bus, and other cases occur,
except in the case of ACK Field and Arbitration Field.

Error description
•The bit actually appearing on the bus is different from the one transmitted
Method of detection
•Sending unit constantly monitors the bus while transmitting
Possible cause
•Sending unit hardware is defective
Exceptions
•Arbitration phase (unit loses arbitration)
•Acknowledgement bit (unit gets positive ACK from at least one receiver)
•Sending of a Passive Error Frame

Example: Electrical Noise Interference

•Scenario: A CAN node transmits a dominant bit (0), but due to electrical noise on the bus, the bit is read
as recessive (1) by other nodes.

•Result: Bit error is detected because the transmitted bit does not match the monitored bit.

•Detection: The transmitting node notices the mismatch and flags a bit error.
Error types: Bit stuffing errors
Error description
•Data Frame contains six or more consecutive bits of the same polarity.
Method of detection
•Receiver detects error when de-stuffing a received frame.
Possible causes
•Error of sending unit during bit stuffing and/or transmission.
•Bit changed value during transmission, possibly due to EMI/RFI.
•An Active Error Frame was sent.
Exceptions
•Transmission of ACK delimiter, EOF field, and Interframe Space (IFS):
11 consecutive recessive bits — bit stuffing does not apply to this section.
Error types: CRC errors

Error description
•CRC code calculated by receiver does not match received CRC code

Method of detection
•Receiver calculates CRC code immediately after reception of the Data Field
•Receiver compares calculated CRC code with the one contained in frame

Efficiency
•Recognizes up to 5 single bit errors per frame → Hamming distance: 6
•Recognizes burst errors with lengths of up to 14 bits
•Recognizes all odd numbers of bit errors
•The more bits the CRC code has, the more efficient it is

Every CAN message contains a Cyclic Redundancy Checksum field of 15 bits. Here, the
transmitter has calculated the CRC value and added it to the message. Every receiving
node will also calculate the CRC on their own. If the receiver's CRC calculation does
not match the transmitter's CRC, the receiver detects this as a CRC Error.
Form Error
This message-level check utilizes the fact that certain fields/bits in the CAN message must
always be of a certain logical level.

Specifically the 1-bit SOF must be dominant, while the entire 8-bit EOF field must be
recessive. Further, the ACK and CRC delimiters must be recessive. If a receiver finds that
any of these are bits are of an invalid logical level, the receiver detects this as a Form Error.
ACK Error (Acknowledgement)
When a transmitter sends a CAN message, it will contain the ACK field (Acknowledgement), in which the
transmitter will transmit a recessive bit. All listening CAN nodes are expected to send a dominant bit in this field
to verify the reception of the message (regardless of whether the nodes are interested in the message or not). If
the transmitter does not read a dominant bit in the ACK slot, the transmitter detects this as an ACK Error.
CAN node states & error counters
What normally happens in CAN error handling:
•If a message gets corrupted (due to noise or a temporary issue), the CAN
system detects the error, destroys the message, and tries to resend it.
•This is good because it ensures reliable communication even in noisy environments.
But what if the problem is not temporary?
Imagine one node (a device on the CAN network) is malfunctioning and
keeps sending a message with errors. Here's what happens:
1.The node sends a message.
2.Other nodes detect an error and destroy the message.
3.The faulty node tries again... and again... and again...
4.This creates a loop of sending and destroying the same bad message.
5.As a result, no other messages can get through — the CAN bus
gets jammed.
How CAN protects against this:
CAN has a self-protection mechanism called "Error Counters":
•Each node keeps track of how many errors it causes.
•If a node causes too many errors, it automatically shuts itself
off from the network (called "bus-off state").
•This prevents the faulty node from jamming the bus.
Goal of CAN Error Tracking
To limit the impact of faulty nodes by gradually reducing their ability to
communicate — so they don’t jam the network.

1. Error Active (Normal State)


•The node works normally.
•It can send and receive messages.
•If it detects an error, it sends a strong error signal (Active Error Flag).
2. Error Passive (Warning State)
•The node still works, but with limited privileges.
•It sends a weaker error signal (Passive Error Flag).
•It must wait longer before trying to send messages — giving other
nodes a chance to use the bus.
3. Bus Off (Disconnected State)
•The node is completely shut off from the CAN bus.
•It cannot send or receive messages anymore.
•This protects the network from being jammed by a faulty node.
How Nodes Change State
Each node keeps two counters:
•Transmit Error Counter (TEC)
•Receive Error Counter (REC)
State changes happen like this:
•If TEC or REC > 127 → Node becomes Error Passive
•If TEC > 255 → Node goes Bus Off
What is a CAN Error Frame?
When a CAN node detects a problem in a message, it sends out
an error frame to alert other nodes and cancel the message.
Primary vs. Secondary Error Flags:
•The first node to detect error sends Primary Error Flag (strong signal).
•Other nodes that detect the error after that send Secondary Error
Flags (weaker signal).
Who is the "Discoverer"?
•The node that sends the Primary Error Flag is called the discoverer.
•It noticed the error first, which sounds good What Happens Then?
Why the Discoverer Might Be the Problem: •The discoverer’s error counters increase faster.
•Often, the discoverer is actually the one causing the error (e.g., •This leads to stricter penalties — like
sending bad data). entering Error Passive or Bus Off state sooner.
•So, CAN assumes: if you keep discovering errors first, you might be •This helps protect the network from a node that
the faulty one. keeps causing trouble.
What is an Overload Frame in CAN?
An Overload Frame is a special signal sent by a CAN node when it’s too busy to handle more messages at the moment.
Why is it used?
•If a node is overloaded (e.g., its processor is busy), it sends an
Overload Frame to delay the next message.
•This gives the node extra time to catch up.
Structure of an Overload Frame:
1.Bus Idle – No activity on the bus.
2.Overload Flag – 6 dominant bits (strong signal).
3.Overload Delimiter – 8 recessive bits (weak signal).
4.Interframe Space – 3 bits between frames.
5.Bus Idle – Back to idle state.
How it works:
•Sent during the first 2 bits of the Interframe Space after a message.
•Other nodes immediately respond by also sending Overload Frames.
•This causes up to 12 dominant bits to appear on the bus.
Overload Occurs when a Dominant Bit is detected in the Intermission Field.
•Overload Flag: 6 consecutive Dominant Bits Note:
•Superposition: The dominant bit of the overload frame is detected in the •Mostly used in older controllers.
intermission field and the overload frame is transmitted from another node. •Modern controllers rarely send Overload Frames
•Overload Delimiter: 6 consecutive Recessive Bits but must still understand them.

You might also like