AP29000
Connecting C166 and C500 Microcontroller to CAN
The Controller Area Network (CAN)
Application Note
19
V 1.0, 2004-02
The PROP_SEG (Propagation Segment) is used to compensate for signal delays
across the network. These delays are caused by signal propagation delay on the bus
line and through the electronic interface circuits of the bus nodes. PROP_SEG may be
1, 2, 3, ..., 8 or more Time Quanta long. For many CAN module implementations the
PROP_SEG and PHASE_SEG1 segments are combined for ease of programming.
The PHASE_SEG1 and PHASE_SEG2 segments are used to compensate for edge
phase errors. These segments may be lengthened or shortened by resynchronization.
PHASE_SEG1 may be 1, 2, 3, ..., 8 or more Time Quanta long. PHASE_SEG2 is the
maximum of PHASE_SEG1 and the information processing time, which is the time
segment starting with the sample point reserved for calculation of the subsequent bit
level and is less than or equal to two Time Quanta long. The sample point is the point
of time at which the bus level is read and interpreted as the value of that respective bit.
Its location is at the end of PHASE_SEG1.
The total number of Time Quanta in a bit time must be between 8 and 25.
As a result of resynchronization, PHASE_SEG1 may be lengthened or PHASE_SEG2
may be shortened. The amount of lengthening or shortening the phase buffer
segments has an upper limit given by the resynchronization jump width. The
resynchronization jump width may be between 1 and 4 Time Quanta, but it may not be
longer than PHASE_SEG1.
3.5
Error Detection and Error Handling
The CAN protocol provides sophisticated error detection mechanisms. The following
errors can be detected:
Cyclic Redundancy Check (CRC) Error
With the Cyclic Redundancy Check the transmitter calculates special check bits for the
bit sequence from the start of a frame until the end of the Data Field. This CRC
sequence is transmitted in the CRC Field. The receiving node also calculates the CRC
sequence using the same formula and performs a comparison to the received
sequence. If a mismatch is detected, a CRC error has occured and an Error Frame is
generated. The message is repeated.
Acknowledge Error
In the Acknowledge Field of a message the transmitter checks if the Acknowledge Slot
(which it has sent out as a recessive bit) contains a dominant bit. If not, no other node
has received the frame correctly, an Acknowledge Error has occured and the message
has to be repeated. No Error Frame is generated, though.