Professional Documents
Culture Documents
Controller Area Network (CAN) : Ecb - T1
Controller Area Network (CAN) : Ecb - T1
Controller Area Network (CAN) : Ecb - T1
ECB - T1
2
1) Basic Concept
2) Properties of CAN protocol
3) Frame Formats
4) Error Detection
5) Error Confinement Mechanisms
6) CAN Protocol Versions
ECB - T1
3
Basic Concept
• It was developed by Robert Bosch GmbH, Germany, in the late
1980s.
• CAN is a multi-master bus with an open, linear structure with
one logic bus line and equal nodes. The number of nodes is
not limited by the protocol (Theoretically).
• Nodes do not have a specific address. Instead, the address
and priority information is contained in the identifiers of the
transmitted messages.
• The number of nodes may be changed dynamically without
disturbing the communication of the other nodes.
• CAN provides sophisticated error-detection and error handling
mechanisms.
• There is a high data transfer rate of 1000 kilobits per second at
a maximum bus length of 40 meters or 130 feet when using a
twisted wire pair which is the most common bus medium used
for CAN.
ECB - T1
4
ECB - T1
5
CAN Frame
7
Frame Formats
• Data Frame
• Remote Frame
• Error Frame
• Overload Frame
• Interframe Space
ECB - T1
8
Data Frame
ECB - T1
9
Data Frame
1bit Dominant The frame begins with a dominant Start Of Frame bit
Start Bit Start
11bit The 11-bit Identifier, which reflects the contents and priority of the
Identifier
message
Arbitration Field
1bit Dominant The RTR bit is used to distinguish a Data Frame and Remote
RTR
frame.
IDE(Identifier 1bit Dominant Its dominant state specify that the frame is a Standard Frame.
Extension)
4bit Data Length Code (DLC) and specify the number of bytes of data
Data length Bit contained in the message (0 - 8 bytes).
0 to 8 The data being sent follows in the Data Field which is of the length
Data Field 0 to 64 bit
byte defined by the DLC above (0, 8, 16, ...., 56 or 64 bits).
15bit Cyclic Redundancy Field (CRC field) follows and is used to detect
CRC sequence
CRC field possible transmission errors.
End of Frame End 7bit Recessive Seven recessive bits (End of Frame) end the Data Frame
10
Arbitration
11
Remote Frame
ECB - T1
12
Remote Frame
Start Bit Start 1 Dominant The frame begins with a dominant Start Of Frame bit
11 The 11-bit Identifier, which reflects the contents and priority of the
Identifier
message
Arbitration Field
1 Recessive The RTR bit is used to distinguish a Data Frame and Remote
RTR
frame.
IDE(Identif 1 Dominant Its dominant state specify that the frame is a Standard Frame.
ier
Extension)
Control Field
Reserved 1 Dominant
Data 4 Data Length Code (DLC) and specify the number of bytes of data
length Bit contained in the message (0 - 8 bytes).
Data Field No Data field
CRC 15 Cyclic Redundancy Field (CRC field) follows and is used to detect
sequence possible transmission errors.
CRC field
CRC 1 Recessive
delimiter
1 Recessive Transmitting node sends out a recessive bit. Any node that has
ACK slot received an error free frame acknowledges by sending back a
Acknowledge dominant bit.
field
ACK 1 Dominant
delimiter
End of Frame End 7 Recessive Seven recessive bits (End of Frame) end the Data Frame
13
14
Error Frame
ECB - T1
15
ACTIVE ERRORS
If an error-active node detects a bus error, the node interrupts
transmission of the current message by generating an active error flag.
The active error flag is composed of six consecutive dominant bits. This
bit sequence actively violates the bit-stuffing rule. All other stations
recognize the resulting bit-stuffing error and, in turn, generate error
frames themselves, called error echo flags.
The error flag field, therefore, consists of between six and twelve
consecutive dominant bits (generated by one or more nodes). The error
delimiter field (eight recessive bits) completes the error frame. Upon
completion of the error frame, bus activity returns to normal and the
interrupted node attempts to resend the aborted message.
16
PASSIVE ERRORS
If an error-passive node detects a bus error, the node transmits an error-
passive flag followed by the error delimiter field. The error-passive flag
consists of six consecutive recessive bits. The error frame for an
errorpassive node consists of 14 recessive bits. From this it
follows that, unless the bus error is detected by an erroractive node or
the transmitting node, the message will continue transmission because
the error-passive flag does not interfere with the bus.
If the transmitting node generates an error-passive flag, it will cause
other nodes to generate error frames due to the resulting bit-stuffing
violation. After transmission of an error frame, an error-passive node
must wait for six consecutive recessive bits on the bus before
attempting to rejoin bus communications. The error delimiter consists of
eight recessive bits and allows the bus nodes to restart bus
communications cleanly after an error has occurred.
17
Transmitting Receiving
Error Error
Receiving
Error
Active Error (Transmitting or Receive Error Counter less then 127 count)
15/11/2004
© Robert Bosch GmbH reserves all rights even in the event of industrial property rights. We reserve all rights of disposal such as
copying and passing on to third parties. ECB - T1
18
Transmitting
Error
Error Frame
6 to 12 dominant If an “error-active” node detects a bus error then the node
Active bit(for interrupts transmission of the current message by generating an
Error Flag more then “active error flag”. The “active error flag” is composed of six
one node) consecutive dominant bits.
Error Flag
6 to 12 Recessive When any one of the two Error Counters raises above 127. when
Passive bit(for the Transmit Error Counter raises above 255 . A node which is Bus
Error Flag more then Off will not transmit anything on the bus at all.
one node
Error 8 Recessive
Delimiter Recessiv
Field e bit
21
ECB - T1
22
Overload Frame
6 to 12 dominant The Overload Flag consists of six dominant bits followed by
Overload bit(for Overload Flags generated by other nodes (as for “active error
Flag more then flag”, again giving a maximum of twelve dominant bits).
one node
Overload 8 Recessive
Delimiter Recessiv
Field e bit
Interframe
space for
Active error
node.
Interframe
space for
Passive
error node.
ECB - T1
24
Passive Error 3 + 8 Suspend Recessive In this case, these nodes have to wait another
node Transmission eight recessive bits called Suspend
Transmission before the bus turns into bus idle.
Bus Idol Due to this mechanism error active nodes have
the chance to transmit their messages before
the error passive nodes are allowed to start a
transmission.
25
Error Detection
ECB - T1
26
ECB - T1
27
Acknowledge
ECB - T1
28
Frame Check
Some parts of the CAN message have a fixed format, i.e. the
standard defines exactly what levels must occur and when,
If a CAN controller detects an invalid value in one of these
fixed fields, a Form Error is signaled.
•CRC Delimiter,
•Acknowledge Delimiter,
•End of Frame
•Interframe Space
ECB - T1
29
Bit Monitoring
1.All nodes perform Bit Monitoring: A Bit Error occurs if a transmitter
sends a dominant bit but detects a recessive bit on the bus line or, sends a
recessive bit but detects a dominant bit on the bus line.
ECB - T1
30
Bit stuffing
The coding of the individual bits is tested at bit level. The bit
representation used by CAN is NRZ (non-return-to-zero) coding, which
guarantees maximum efficiency in bit coding. The synchronization edges
are generated by means of bit stuffing, i.e. after five consecutive equal
bits the sender inserts into the bit stream a stuff bit with the
complementary value, which is removed by the receivers. The code check
is limited to checking adherence to the stuffing rule.
31
Bit stuffing
32
Set by
Synchronizati
on jump
width ( TSJW
)
35