CAN Basics
Thomas Staebe
Holger Dahinten
Preview
CAN Basics
▪ What is CAN
▪ Topology
▪ Objects of Communication Matrix
▪ Communication Matrix
▪ Message structure
▪ Identifier
What is CAN?
• CAN means „Controller Area Network“
• Defined in ISO-Standard 11898
• For networking electronic control units
• Often used in automotive environments
• CAN canwork in difficult electrical environments
• Has real-time capabilities
• Asynchronous communication(connected control units work independent
from each other)
Topology
▪
• Linear topology (reduces the number and length of cables in vehicles)
•
Multi-Master communication
•
Carrier Sense Multiple Access/Collision Resolution (CSMA/CR)
•
CAN bus systems are built using two parallel data cables (differential signal)
•
Logical „1“ is recessive and logical „0“ is dominate (Wired-AND)
•
For higher baud rates termination resistors are necessary at the ends (e.g. 120 Ω)to
avoid reflections
Objects of CAN communication
▪ Control units (ECUs, Nodes)
ECUs are Electronic Control Units,
which independently accept, process and forward information.
▪ Message (Telegram, Frame)
A message is a bundle of information units, which is sent from one control
unit on the CAN bus. All messages have a unique identifier.
▪ Multiplex message
A multiplex message contains different signals depending on the mode
signal. The value of the mode signal refers to one or more included
signals. This way, the limited amount of message IDs on the CAN data
line can be used several times.
▪ Signal
A signal is a specific information unit within a message.
▪ Attribute
Attributes define additional information of an object in the communication
matrix, describing it in detail or determining its dimensioning (e.g. cycle
time).
Communication Matrix
The communication matrix (or CAN matrix, K-Matrix)
is a table structure, essentially defining the following:
▪ Which ECU sends which message with which cycle time
▪ Which ECU receives a certain message/signal
▪ Which signals are included in a message as well as their interpretation, i.e. how
hexadecimal values are converted into physical or logical values
▪ Which identifier messages have
Door Module
Length [Bit]
Head Unit
HUD
ABS
Message Data Element Function Type Value Describtion
IC
IC_Base [0x247] Steering wheel switch "-" pressed Boolean 1 R R T
(100 ms) Steering wheel switch "Ok" Boolean 1 R R T
Steering wheel switch "+" pressed Boolean 1 R R T
Pressure unit Enum 2 R T 0 Bar
Pressure unit Enum 2 1 Psi
Pressure unit Enum 2 2 not defined
Temperature unit Enum 2 R T 0 Celsius
Temperature unit Enum 2 1 Fahrenheit
Temperature unit Enum 2 2 not defined
Vehicle speed unit Enum 1 R R R R T 0 Vehicle speed unit "km/h"
Vehicle speed unit Enum 1 1 Vehicle speed unit "mph"
Displayed vehicle speed Scaled 12 R R R R T 0..4094 0.1 km/h
Structure of CAN Messages
▪ SOF (start of frame): Identifies start of frame.
▪ Arbitration field: Contains the identifier and the RTR bit (Remote Transmission Request).
The RTR bit identifies whether the frame is a data frame or a request frame (remote frame).
▪ Control field: To distinguish standard and extended frame formats, the IDE-bit (identifier extension bit)
is used. A reserved bit intended for future extensions follows. The last 4 bits (DLC) identify the number
of bytes included in the data field.
▪ Data field: Contains the actual message data of message. Its length can range from 0 to 8 byte.
▪ CRC field: Contains a check sum that is used to identify bit errors.
▪ ACK field: Contains the ACK slot. This bit indicates that at least one receiver has received the data
correctly.
▪ End of frame: Identifies the end of message.
▪ Intermission: Minimum bit time separating consecutive messages. If no station accesses the bus after
this time, the bus remains idle (bus idle)
Message Identifier
▪ In contrast to most other network systems,
ECUs on a CAN bus do not have unique addresses.
▪ Communication control is therefore regulated via the
message’ unique identification numbers (IDs):
▪ Based on the identifier, a receiver decides
whether a message is relevant or not
▪ The IDs are used to prioritize messages
(Because of, the Wired-AND design,
lower IDs are dominant on the bus)
▪ If an ECU cannot send its ID onto the bus a collision has
been detected and the ECU has to stop sending any data
for this message (Bus Arbitration)
▪ Standard CAN IDs (11 bit), up to 2.048 unique IDs
Extended CAN IDs (29 bit), up to 536.870.912 unique IDs
Pros and Cons
Pros
▪ More reliable, e.g. less connectors
▪ Wiring less complex, more cost-effective
▪ Installation easier, changes easier
▪ Additional elements can be integrated
▪ Location changeable without electrical problems
▪ Communication system becomes diagnosable
Cons
▪ Discussion…
Thank you for your attention!