Setha Pan-Ngum
Setha Pan-Ngum
Setha Pan-Ngum
Sensors Nozzles
ECUs NOZZLE
ECU
Data
Logging GPS
Sensors Nozzles
ECUs NOZZLE
ECU
Data Bus
Data Bus
Data
Logging GPS
Layered Approach in CAN (1 of 3) [1]
Only the logical link and physical layers are described.
Data link layer is divided into two sublayers: logical link control (LLC)
and medium access control (MAC).
Application Layer
Supervisor
CAN LAYERS
Interframe
space or
Interframe overload
space Data Frame frame
The identifier of the standard format corresponds to the base ID in the extended
format.
The RTR bit is the remote transmission request and must be 0 in a data frame.
The SRR bit is the substitute remote request and is recessive.
The IDE field indicates whether the identifier is extended and should be recessive
in the extended format.
The extended format also contains the 18-bit extended identifier.
Control Field [1]
Contents are shown in figure 13.4.
The first bit is IDE bit for the standard format but is
used as reserved bit r1 in extended format.
r0 is reserved bit.
DLC3…DLC0 stands for data length and can be from
0000 (0) to 1000 (8).
Arbitration Control Field Data field
field or CRC field
Data or
Control field CRC field ACK
Interframe space
Data or
frame Error frame Overload frame
Superposition of
error flags
Superposition of
overload flags
Figure 13.9 Overload frame
Interframe Space (1 of 2) [1]
Data frames and remote frames are separated from preceding frames
by the interframe space.
Overload frames and error frames are not preceded by an interframe
space.
The formats for interframe space is shown in Figure 13.10 and 13.11.
Suspend
Intermission Bus Idle
Transmission
Bit error
A node that is sending a bit on the bus also monitors the bus.
When the bit value monitored is different from the bit value being
sent, the node interprets the situation as an error.
There are two exceptions to this rule:
A node that sends a recessive bit during the stuffed bit-stream of the
arbitration field or during the ACK slot detects a dominant bit.
A transmitter that sends a passive-error flag detects a dominant bit.
Errors (2 of 3) [1]
Stuff error
Six consecutive dominant or six consecutive recessive
levels occurs in a message field.
CRC error
CRC sequence in the transmitted message consists of
the result of the CRC calculation by the transmitter.
The receiver recalculates the CRC sequence using the
same method but resulted in a different value. This
is detected as a CRC error.
Errors (3 of 3) [1]
Form error
Detected when a fixed-form bit field contains one or more illegal
bits
Acknowledgement error
Detected whenever the transmitter does not monitor a dominant
bit in the ACK slot
Error Signaling
A node that detects an error condition and signals the error by
transmitting an error flag
An error-active node will transmit an active-error flag.
An error-passive node will transmit a passive-error flag.
Fault Confinement [1]
A node may be in one of the three states: error-active, error-passive, and bus-
off.
A CAN node uses an error counter to control the transition among these three
states.
CAN protocol uses 12 rules to control the increment and decrement of the
error counter.
When the error count is less than 128, a node is in error-active state.
When the error count equals or exceeds 128 but not higher 255, the node is in
error-passive state.
When the error count equals or exceeds 256, the node is in bus off state.
An error-active node will transmit an active-error frame when detecting an
error.
An error-passive node will transmit a passive-error frame when detecting an
error.
A bus-off node is not allowed to take part in bus communication.
From [2]
From [2]
CAN Benefits and Drawbacks [2]
References and slide sources
1. Huang Han-Way, The HCS12/9S12: An introduction
2. Koopman P, Controller Area Network (CAN) slides
3. Stone M, Controller Area Networks lecture slides, Oklahoma State
University
4. Upender B, Koopman P, Communication protocols for embedded
systems, Embedded systems programming, Nov 1994.