Professional Documents
Culture Documents
Rzvan-Alin CIOBOTARIU
IIC Iai - HW Developer
6/20/16
BASIC CONCEPTS
Differential serial bus standard
The messages it sends are small (8 data bytes max)
Bit rates up to 1 Mbit/s are possible at network lengths below 40 m
Decreasing the bit rate allows longer network distances (e.g. 125 kbit/s at 500 m)
Prioritization of messages
Configuration flexibility
Multimaster
High immunity against electromagnetic interference
Error detection and error signalling
Automatic retransmission of corrupted messages as soon as the bus is idle again
Distinction between temporary errors and permanent failures of nodes
Switching off of defect nodes
Bus nodes using the CAN protocol dont have a specific address
The address data is located in the identifier of each message
This identifier also specifies the content and the priority of the message
New nodes can be attached to the bus dynamically, without disturbing the communication
Space for Sender Information
Confidential
Network
6/20/16
Cristian Paveliuc Continental AG
The nominal voltage in the dominant state is 3.5 V for the CAN_H line and 1.5 V for the
CAN_L line
Application Layer
66
Presentation Layer
55
Session Layer
44
Transport Layer
33
Network Layer
22
11
Physical Layer
not specified by
the CAN Specification
Implemented in Hardware
Acceptance filtering, error management,
de-/encryption, (de-)stuffing, arbitration,
frame setup, acknowledgement
Encoding / decoding, bit timing,
synchronization, wiring, connectors,
bus, transceiver characteristics
Frames: Overview
Frame: Envelope for transmission data
recessive
dominant
Bus Idle
Arbitration Field
S
O
F
Control
Field
RI r
Data Field
CRC Field
15-bit CRC
DA D
ECE
LKL
recessive
dominant
Bus Idle
Arbitration field
S
O
F
11-bit Base Id
S I
R D18-bit
RE
Control
Field
Rr r
Data Field
CRC Field
DA D
Ext. Id RT 1 0 DLC 0..64 Bit Data15-bit CRC EL CK EL 7-bit EOFIFS Bus Idle
SOF
Arbitration Field
recessive
dominant
Arbitration Field
Bus Idle
SOF
Arbitration Field
MSB
recessive
11-bit Identifier
Control Field
LSB RTR
dominant
contains the Identifier (11 bit for CAN 2.0A) which is used for arbitration
Identifier determines frame priority: low identifier = high priority
the highest seven bits of the identifier must not be all recessive
Remote Transmission Request (RTR) bit is always dominant in a Data Frame
Space for Sender Information
Confidential
Arbitration: Example
withdraws
Start
Unit 1
ID:
13Dh
recessiv
e
dominant
Bu
s
Idle
SO
F
loses arbitration
wins arbitration
loses arbitration
Start
Unit 2
ID: 069h
recessiv
e
dominant
Bu
s
Idle
SO
F
withdraws
Start
Unit 3
ID: 079h
Bus
level
recessiv
e
dominant
recessiv
e
dominant
Bu
s
Idle
SO
F
Consequence:
Frames
carrying information
of high priority
should have
a low identifier
Control Field
Arbitration Field
recessive
Control Field
RTR
IDE
r0
Data Field
dominant
Data Field
Control Field
recessive
Data Field
CRC Field
DLC
0 .. 64 bits ( 0 .. 8 bytes )
dominant
CRC Field
Data Field
CRC Field
ACK Field
DEL
recessive
dominant
ACK Field
DEL
ACK
DEL
EOF Field
dominant
1. means that at least one node received the frame without an error, but
2. does not necessarily mean that the frame was error-free
EOF Field
IFS
DEL
dominant
Interframe Space
Bus Idle
recessive
dominant
Example 2
original
sequence
stuffed
sequence
Example 3
original
sequence
stuffed
sequence
recessive
dominant
recessive
dominant
recessive
dominant
recessive
dominant
recessive
dominant
recessive
dominant
stuff bit
stuff bit
stuff bit
stuff bit
Standard Frame
CAN 2.0A
(11-bit identifier)
Extended Frame
CAN 2.0B
(29-bit identifier)
111 bits
131 bits
130 bits
154 bits
Error types
Bit errors
Bit stuffing errors
CRC errors
Message format errors
Acknowledgment errors
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
Space for Sender Information
Confidential
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
Space for Sender Information
Confidential
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
Method of detection
Receiver checks received frames for bits or bit fields having a fixed value
(e.g. SOF bit, CRC delimiter, ACK delimiter, EOF field, Interframe Space)
Violation of frame integrity when wrong value in one of these fields
Possible cause
Transmission error, error in sender and/or receiver
Transmission of an Active Error Frame during EOF field
Transmission of an Overload Frame during Interframe Space (IFS)
Method of detection
Sender monitors the bus while transmitting recessive ACK bit
Sender expects to observe dominant ACK bit on bus
Acknowledgement error when ACK bit on bus remains recessive
Possible cause
No other nodes are connected to the bus
Not one single receiver acknowledges that the received frame was error-free
Cause of error is very likely to be found in sender
recessiv
e
dominant
Error Delimiter
8 recessive bits
Interfram
e Space
Bus Idle
3 bits
Bus Idle
Secondary
Error
Frames
Data Frame
Secondary
Error Flags
recessiv
e Data Frame 6 dominant bits 0-6 dom. bits
dominant
Error Delimiter
8 recessive bits
Interfram
e Space
Bus Idle
3 bits
Bus Idle
+8
TEC
TEC
-1
+8
REC
REC
-1
recessiv
e
dominant
Error Delimiter
Passive Error
Flag
8 recessive bits
Interfram
e Space
Bus Idle
3 bits
Bus Idle
Bus off
Error passive
127
Warning Level
96
Error Active
t
Space for Sender Information
Confidential
Bus off
Error passive
135
127
Warning Level
96
Error Active
t
Space for Sender Information
Confidential
4.7 10-11
Example 1
A CAN bus is used
Example 2
A CAN bus in a car is run at
500 kBit / sec
with an average bus load of
15 %
an average data frame size of
110 bits
for an average operating time of
4000 hours
only one error in 100.000 automobiles remains
undetected
Space for Sender Information
Confidential
Remote Frame
Bus Idle
recessive
dominant
Bus Idle
Arbitration Field
S
O
F
Control
Field
RI r
CRC Field
15-bit CRC
DA D
ECE
L KL
Overload Frame
Bus Idle
Overload Delimiter
Overload Flag
Interfram
e Space
Bus Idle
3 bits
Bus Idle
recessive
dominant
8 recessive bits
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop
Poze osciloscop