INTRODUCTION TO CAN CONTROLLERS AT ST
CAN PROTOCOL OVERVIEW
CAN: WHY ? WHERE ?
Existing protocols (I2C, D2B) didnt support multi-masters communication Low baud-rates Poor error detection & management CAN is used in several domains:
Automotive Industrial Home automation Medical etc
Power Train Safety
Car Body
CAN PROTOCOL OVERVIEW
CAN SPECIFICATION
Specified by BOSCH GmbH and normalized by ISO 11898
Specified by users
7. Application layer 6. (empty) 3. 2. Data link layer
(OSEK/VDX, J1939, CANOpen, DeviceNet, etc.)
LLC (Logic Link Control) Accept. filtering, Overload notif., etc. MAC (Medium Access Control) Data encap/decap, Frames, Access, etc. PLS (Physical Signalling) Bit encod/decod, Bit timing, Sync. Bosch specification ISO 11898 standard
OSI model
1. Physical layer
PMA (Physical Medium Attachment) Driver/ receiver characteristics MDI (Medium Dependent Interface) Connectors
CAN PROTOCOL OVERVIEW
KEY CHARACTERISTICS
CAN means Controller Area Network CAN is an asynchronous serial communication protocol Multi-master concept
CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) Message priority
Object-oriented communication
No node addressing, but content identification
Real-time capability
Low message transfer latency
System wide message consistency
Error detection & management mechanism
CAN PROTOCOL OVERVIEW
PRINCIPLE OF DATA EXCHANGES
Based on Object-oriented transmission protocol ( broadcast communication mechanism) BUS topology
Node 1 Node 2 Node 3 Node 4
CAN core
CAN core
CAN core
CAN core
Frame
Filter
Frame
Filter
Frame
Filter
Frame
Filter
Transceiver CAN H CAN L
Transceiver
Transceiver
Transceiver
CAN PROTOCOL OVERVIEW
PHYSICAL LAYERS
High speed CAN physical layer (ISO 11898-2 standard)
Speed up to 1Mbit/s Max. bus length 40m at 1Mbit/s Two wire differential bus Characteristic line impedance 120 Ohm (120-Ohm resistor at both ends)
Low speed CAN physical layer (ISO 11898-3 standard)
Speed up to 125 Kbit/s Up to 32 nodes per network Two transmission lines (terminated on each node so that total termination = 100 Ohm) Short circuit proof (fault-tolerant specifications)
CAN PROTOCOL OVERVIEW
CAN FRAMES
Data frame: 2 standards
Standard format Extended format 11-bit identifier 29-bit identifier
Remote frame
Data frame structure without Data field
(Active/Passive) Error Frame
Break stuff bit rule or fixed-form bit fields (delimiter bits)
Overload frame
Still supported for compatibility
CAN PROTOCOL OVERVIEW
CAN FRAME STRUCTURE
Recessive S O F 11-bit Identifier R I r T D 0 R E DLC 0..8 Data bytes CRC ACK EOF
Sent by the Transmitter
Dominant
DEL
ACK slot
D E L ACK inserted by all Receivers
Listen
ACK
Listen
DEL = Delimiter
DEL
ACK slot
D E L
CAN bus
CAN PROTOCOL OVERVIEW
STANDARD Vs EXTENDED IMPLEMENTATIONS
Standards
Standard format send / receive Extended format check / acknowledge Extended send / receive 2.0A 2.0B Passive 2.0B Active
Yes
Yes
Yes
no (destructive !)
Yes
Yes
no (destructive !)
no (destructive !)
Yes
2.0A and 2.0B active nodes cannot cohabit on the same network 2.0B passive and active nodes can cohabit on the same network
CAN PROTOCOL OVERVIEW
ERROR DETECTION
Bit Error (value of TX and RX signals differs) Acknowledge Error (when transmitter monitors ACK slot recessive) Stuff Bit Error (when stuff bit rule is broken) CRC Error (when CRC value is wrong) Form Error (wrong delimiters/EOF)
10
CAN PROTOCOL OVERVIEW
FAULT CONFINEMENT
Two counters
Transmit Error Counter (TEC) Receiver Error Counter (REC)
Reset and Configuration
Error Active
TEC > 127 or REC > 127 TEC < 128 or REC < 128 128 sequences of 11 consecutive recessive bit
Error Passive
Bus Off
TEC > 255
11