Bit Timing Parameters of CAN
Bit Timing Parameters of CAN
Introduction
• A feature of the CAN protocol is that the bit rate, bit sample point and number of samples per bit are
programmable. This gives the system engineer the opportunity to optimise the performance of the
network for a given application.
• This paper examines the relationship and constraints between the bit timing parameters, the
reference oscillator tolerance, and the various signal propagation delays in the system.
CAN Bit Timing Overview
Figure 2 Relationship between CAN System Clock and CAN Bit Period
• The duration of the synchronization segment, SYNC_SEG, is not programmable and is fixed at one
Time Quantum. The duration of the other segments are programmable, either individually or with
two values, tSEG1 and tSEG2 where:
• tSEG1 = tPROP_SEG + tPHASE_SEG1
• tSEG2 = tPHASE_SEG2
Segment Duration
SYNC_SEG (fixed) tSYNC_SEG = 1 tQ
PROP_SEG(Programmable) tPROP_SEG = 1, 2 … 8 tQ
PHASE_SEG1 tPHASE_SEG1 = 1, 2 … 8 tQ (if one sample point)
(Programmable) tPHASE_SEG1 = 2 … 8 tQ (if three sample point)
PHASE_SEG2 tPHASE_SEG2 = MAX(IPT, tPHASE_SEG1)
(Programmable)
• The Information Processing Time is equal to 2 Time Quanta, except for the following circumstances:
• TOUCAN Module: IPT = 3 TQ if the Baud Rate Prescaler = 1 (MCU system clock equals CAN
system clock.)
• MCAN Module: IPT = 3 TQ if 3 samples per bit are selected.
• From Table 1, it would appear that the minimum number of Time Quanta per bit is 5. However, many
CAN controllers require a minimum of 8 Time Quanta per bit, as stipulated in [1]. The maximum
number of Time Quanta per bit is 25.
Synchronization Segment
• For each CAN node, the nominal start of each bit is the beginning of the SYNC_SEG segment.
• For nodes that are transmitting, the new bit value is transmitted from the beginning of the
SYNC_SEG segment.
• For receiving nodes, the start of the received bit is expected to occur during the SYNC_SEG
segment.
• Due to the propagation delay of the transmitted signal through the physical interface to the bus and
along the bus itself, the SYNC_SEG segment of receiving nodes will be delayed with respect to the
SYNC_SEG segment of the transmitting node(s).
• This is illustrated in Figure 3. The actual delay will vary depending on the distance between the
transmitting and receiving nodes being considered.
Propagation Delay
• The existence of the propagation delay segment, PROP_SEG, is due to the fact that the CAN
protocol allows for non-destructive arbitration between nodes contending for access to the bus, and
the requirement for in-frame acknowledgement.
• In the case of non-destructive arbitration, more than one node may be transmitting during the
arbitration field.
• Each transmitting node samples data from the bus in order to determine whether it has won the
arbitration, and also to receive the arbitration field in case it loses arbitration.
• When each node samples each bit, the value sampled must be the logical superposition of the bit
values transmitted by each of the nodes arbitrating for bus access.
• In the case of the acknowledge field, the transmitting node transmits a recessive bit but expects to
receive a dominant bit, i.e. a dominant value must be sampled at the sample point(s).
• The propagation delay segment, PROP_SEG, exists to delay the earliest possible sample of
the bit by a node until the transmitted bit values from all the transmitting nodes have
reached all of the nodes.
• Figure 3 shows the propagation delay between two nodes, and shows that the bit value transmitted
by Node A is received by Node B after a time tProp(A,B), and the bit value transmitted by Node B is
received by Node A after a time tProp(B,A), before the end of Node A’s propagation segment, thus
ensuring that Node A will correctly sample the bit value.
• Node B will also correctly sample the bit value, even although Node B’s sample point lies beyond
the end of Node A’s bit time, because of the propagation delay between Node A and Node B.
• Time tProp(A,B) consists of the sum of the propagation delay through Node A’s bus driver plus the
propagation delay along the bus from Node A to Node B plus the propagation delay through Node
B’s bus receiver:
• tProp(A,B) = tTx(A) + tBus(A,B) + tRx(B)
Synchronization
• All CAN nodes on a network must be synchronized while receiving a transmission, i.e. the beginning of
each received bit must occur during each nodes SYNC_SEG segment. This is achieved by means of
synchronization.
• Synchronization is required due to phase errors between nodes which may arise due to nodes having
slightly different oscillator frequencies, or due to changes in propagation delay when a different node
starts transmitting.
• Two types of synchronization are defined, hard synchronization and re-synchronization.
• Hard synchronization is performed only at the beginning of a message frame, when every CAN node
aligns the SYNC_SEG of its current bit time to the recessive to dominant edge of the transmitted Start-
Of-Frame bit.
• Re-synchronization is subsequently performed during the remainder of the message frame, whenever a
change of bit value from recessive to dominant occurs outside of the expected SYNC_SEG segment.
• For CAN nodes which are transmitting, the value of a bit is transmitted on the CAN bus at the start of the
transmitting nodes SYNC_SEG segment, and the bit value is transmitted until the end of the
PHASE_SEG2 segment.
• All nodes which are active receive the data on the bus (including transmitting nodes) and any changes in
bit value are expected to occur during the SYNC_SEG segment. If a recessive to dominant bit value
transition is detected outside of a receiving nodes SYNC_SEG segment, then that node will re-
synchronize to the edge.
• If a recessive to dominant bit value transition is detected after the SYNC_SEG segment, but before
the sample point, then this is interpreted as a late edge.
• The node will attempt to re-synchronize to the bit stream by increasing the duration of its
PHASE_SEG1 segment of the current bit by the numbers of Time Quanta by which the edge was
late, up to the re-synchronization jump width limit.
• The effect of this is that the next sample point is delayed until it is the programmed numbers of Time
Quanta after the actual edge (if the required delay does not exceed the re-synchronization jump
width limit).
• Conversely, if a recessive to dominant bit value transition is detected after the sample point but
before the SYNC_SEG segment of the next bit, then this is interpreted as an early bit.
• The node will now attempt to re-synchronize to the bit stream by decreasing the duration of its
PHASE_SEG2 segment of the current bit by the numbers of Time Quanta by which the edge was
early, by up to the re-synchronization jump width limit.
• Effectively, the SYNC_SEG segment of the next bit begins immediately (if the edge is early by no
more than the re-synchronization jump width limit).
• The numbers of Time Quanta by which a bit period may be extended or shortened due to re-
synchronization is limited by a programmable value called the re-synchronization jump width (RJW
or SJW). The re-synchronization jump width must be programmed to a valid value.
• The re-synchronization jump width cannot exceed 4 Time Quanta and it also must not
exceed the numbers of Time Quanta in the PHASE_SEG1 segment. The minimum value for
the re-synchronization jump width is 1Time Quantum.
Oscillator Tolerance
• Typically, the CAN system clock for each CAN node will be derived from a different oscillator. The
actual CAN system clock frequency for each node, and hence the actual bit time, will be subject to a
tolerance. Ageing and variations in ambient temperature will also affect the initial tolerance.
• The CAN system clock tolerance is defined as a relative tolerance:
Δf =
where f is the actual frequency and fN is the nominal frequency.
Bit Timing Requirements
• To ensure effective communication, the minimum requirement for a CAN network is that two nodes, each
at opposite ends of the network with the largest propagation delay between them, and each having a
CAN system clock frequency at the opposite limits of the specified frequency tolerance, must be able to
correctly receive and decode every message transmitted on the network. This requires that all nodes
sample the correct value for each bit.
Propagation Delay
• The minimum time for the propagation delay segment to ensure correct sampling of bit values is given
by:
tPROP_SEG = tProp(A,B) + tProp(B,A)
• where nodes A and B are at opposite ends of the network, i.e. the propagation delay is a maximum
between nodes A and B.
tPROP_SEG = 2(tBus + tTx + tRx)
• where tBus is the propagation delay of the signal along the longest length of the bus between two
nodes, tTx is the propagation delay of the transmitter part of the physical interface and tRx is the
propagation delay of the receiver part of the physical interface.
• If the propagation delay of the transmitters and receivers on a network is not uniform, the maximum
delay values should be used in above equation.