CAN Bit Timing
1532
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
M3 Controller Area Network (CAN)
In this example, both nodes A and B are transmitters performing an arbitration for the CAN bus. The node
A has sent its Start of Frame bit less than one bit time earlier than node B, therefore node B has
synchronized itself to the received edge from recessive to dominant. Since node B has received this edge
delay(A_to_B) after it has been transmitted, node B's bit timing segments are shifted with regard to node
A. Node B sends an identifier with higher priority and so it will win the arbitration at a specific identifier bit
when it transmits a dominant bit while node A transmits a recessive bit. The dominant bit transmitted by
node B will arrive at node A after the delay(B_to_A).
Due to oscillator tolerances, the actual position of node A's Sample Point can be anywhere inside the
nominal range of node A's Phase Buffer Segments, so the bit transmitted by node B must arrive at node A
before the start of Phase_Seg1. This condition defines the length of Prop_Seg.
If the edge from recessive to dominant transmitted by node B would arrive at node A after the start of
Phase_Seg1, it could happen that node A samples a recessive bit instead of a dominant bit, resulting in a
bit error and the destruction of the current frame by an error flag.
This error only occurs when two nodes arbitrate for the CAN bus which have oscillators of opposite ends
of the tolerance range and are separated by a long bus line; this is an example of a minor error in the Bit
timing configuration (Prop_Seg too short) that causes sporadic bus errors.
Some CAN implementations provide an optional 3 Sample Mode. The CAN does not. In this mode, the
CAN bus input signal passes a digital low-pass filter, using three samples and a majority logic to
determine the valid bit value. This results in an additional input delay of 1 t
q
, requiring a longer Prop_Seg.
23.12.1.3 Phase Buffer Segments and Synchronization
The phase buffer segments (Phase_Seg1 and Phase_Seg2) and the synchronization jump width (SJW)
are used to compensate for the oscillator tolerance.
The phase buffer segments surround the sample point. The phase buffer segments may be lengthened or
shortened by synchronization.
The synchronization jump width (SJW) defines how far the resynchronizing mechanism may move the
sample point inside the limits defined by the phase buffer segments to compensate for edge phase errors.
Synchronizations occur on edges from recessive to dominant. Their purpose is to control the distance
between edges and sample points.
Edges are detected by sampling the actual bus level in each time quantum and comparing it with the bus
level at the previous sample point. A synchronization may be done only if a recessive bit was sampled at
the previous sample point and if the actual time quantum's bus level is dominant.
An edge is synchronous if it occurs inside of Sync_Seg, otherwise its distance to the Sync_Seg is the
edge phase error, measured in time quanta. If the edge occurs before Sync_Seg, the phase error is
negative, else it is positive.
Two types of synchronization exist: hard synchronization and resynchronizing. A hard synchronization is
done once at the start of a frame; inside a frame only resynchronization is possible.
•
Hard Synchronization
After a hard synchronization, the bit time is restarted with the end of Sync_Seg, regardless of the edge
phase error. Thus hard synchronization forces the edge which has caused the hard synchronization to
lie within the synchronization segment of the restarted bit time.
•
Bit Resynchronizations
Resynchronization leads to a shortening or lengthening of the bit time such that the position of the
sample point is shifted with regard to the edge.
When the phase error of the edge which causes resynchronization is positive, Phase_Seg1 is
lengthened. If the magnitude of the phase error is less than SJW, Phase_Seg1 is lengthened by the
magnitude of the phase error, else it is lengthened by SJW.
When the phase error of the edge which causes Resynchronization is negative, Phase_Seg2 is
shortened. If the magnitude of the phase error is less than SJW, Phase_Seg2 is shortened by the
magnitude of the phase error, else it is shortened by SJW.