The document discusses the CAN bus protocol. It provides an introduction that describes CAN as a multi-master, broadcasting, serial communication protocol for reliable data exchange between electronic control units. It then discusses CAN applications in automotive, industrial, medical and other fields. The document outlines CAN characteristics such as message prioritization, arbitration, data protection methods, and advantages like reliability and robustness in noisy environments. It concludes that CAN is well-suited for applications requiring many short messages with high reliability.
2. Contents
Introduction
CAN Applications
CAN Characteristics
Message Types
Arbitration
CAN Data Protection
Advantages
Disadvantages
Conclusion
- 2 -
3. - 3 -
Introduction
• Multi-master protocol
• Broadcasting
• Serial communication technology
• Priority-based bit-wise arbitration
4. - 4 -
Introduction
• Originally developed by Robert Bosch for
automobile in-vehicle network in the 1980s
• For reliable data exchange between ECUs
• Robust in noisy environments
• Cost effective
5. - 5 -
Introduction
• Compact and fast
• It is a message-based protocol.
• There are no defined addresses, just defined
messages.
9. - 9 -
Real-world applications
• Automotive
• Military vehicles
• Industrial machinery
• Medical systems
• Agricultural machinery
• Marine control and navigation
• Elevator control systems
10. - 10 -
CAN Characteristics
• All messages are broadcast
• Any node is allowed to broadcast a
message
• Each message contains an ID that
identifies the source or content of a
message
• Each receiver decides to process or
ignore each message
12. - 12 -
CAN Characteristics
Physical Medium
Single twisted pair wire terminated on each end
Node
A
Node
B
120 Ω 120 Ω
13. - 13 -
CAN Characteristics
Network Size
• The maximum number of nodes is not
specified.
• Networks are limited by electrical loading,
up to 64 nodes is normal
14. - 14 -
CAN Message Types
Four Message Types
• Data Frame
– Used to transmit data
• Remote Frame
– Used to request data transmission
• Error Frame
– Sent by a node that detects an error
• Overload Frame
– Sent by a node to request a delay in
transmission
15. • Standard Data Frame
• Extended Data Frame
CAN Message Format
16. - 16 -
CAN Arbitration
• CSMA/CA
• All nodes must wait for an idle bus condition.
• If two nodes begin transmitting simultaneously,
they then participate in an arbitration process.
17. - 17 -
CAN Arbitration
• Wired-AND mechanism
• The node with the lower ID number wins the
arbitration and continues transmitting its
message.
• The loser of the arbitration backs off and re-tries.
18. - 18 -
CAN Arbitration
CSMA/CA & Wired-AND Logic
19. - 19 -
CAN Data Protection
CAN Data Protection-
Error Detection
• Bit Monitoring
Sender Task
Compares every bit placed on the CAN bus with the
actual bus level
Discrepancy indicates a bit monitoring error and
results in error handling
20. CAN Data Protection
CAN Data Protection-
Error Detection
• Stuff Check
Receiver Task
Compares arriving bit stream for a sequence of six
homogeneous bits.
Detection of a sixth homogeneous bit indicates bit
stuffing error and results in error handling
- 20 -
21. CAN Data Protection
CAN Data Protection-
Error Detection
• Form Check
Receiver Task
Comparison of the arriving bit stream with the
message format
Detection of a dominant delimiter bit (CRC delimiter,
ACK delimiter) or a dominant bit within EOF
indicates a format error and results in error handling
- 21 -
22. CAN Data Protection
CAN Data Protection-
Error Detection
• Cyclic Redundancy Check
Receiver Task
Utilizes the arriving bit stream and generator
polynomial for the Cyclic Redundancy Check
defined in ISO 11898-1
Detection of a CRC error results in error handling
- 22 -
23. CAN Data Protection
CAN Data Protection-
Error Detection
• ACK Check
Sender Task
Acknowledge error (ACK error) is detected if the
recessive level placed by the sender is not
overwritten
Detection of an ACK error results in error handling
- 23 -
25. - 25 -
CAN Advantages
• High performance under light loads
• Low cost
• Reliable
• Robust
26. - 26 -
CAN Disadvantages
• Unfair access: Node with high priority can hog
the network
• Starvation for some particular nodes
27. - 27 -
Conclusion
• CAN is ideally suited in applications requiring a large
number of short messages with high reliability in
rugged operating environments.
• Because CAN is message-based and not address-
based, it is especially well-suited when data is
needed by more than one location and system-wide
data consistency is mandatory.
There are no bus masters or slave devices in CAN. Devices do not have addresses either. Any node on the bus is allowed to broadcast a message at any time. Each message has an identifier that indentifies the message content. All receivers receive all of the messages and selectively process the messages with content that applies to that receiver. If two devices attempt to transmit simultaneously they automatically participate in an arbitration sequence. The message with the lower numbered identifier wins the arbitration and is allowed to continue transmitting. The node transmitting the message that lost arbitration must stop transmitting and retry at the next bus idle time.
A CAN network consists of a number of CAN nodes which are linked via the physical transmission medium, twisted pair wire.
At the ends of the CAN network are bus termination resistors. These resistors prevent signal reflections that would harm the signal integrity.
The CAN specification does not state a maximum number of nodes. The maximum number of nodes is dependant on the drive strength of the weakest transceiver and the electrical loads of each of the nodes on the network. Networks containing up to 64 nodes are common.
CAN has several error detection mechanisms that contribute to the robustness of CAN. The sender and all receivers of the message participate in error detection.
The sender monitors each bit it transmits to ensure that the correct level appears on the bus.
The sender checks that ACK bit to make sure that at least one receiver has correctly received the message
Each CAN message is checked for validity by all CAN receivers.
The receivers check for delimiters appearing at the correct times
The receivers calculate the CRC value and compare their calculated value to the transmitted value.
The receivers check that no more than 5 successive bits of the same level are sent