
CAN modules
UM0404
DocID13284 Rev 2
Considering the effect of the system clock discrepancy between two CAN nodes, and
supposing no bus errors is detected (due to, for instance, electrical disturbances), bit
stuffing guarantees that, also in the worst case condition for the accumulation of phase error
(during a normal communication), the maximum time between two re-synchronization edges
is 10 bit periods (5 dominant bits followed by 5 recessive bits are always followed by a
dominant bit).
Calling t
BT
the CAN Bit Time, this maximum time t
J
between two re-synchronization edges
can be simply expressed as:
Then assuming the two CAN nodes with opposite system clock generator tolerance
(considering the specified tolerance "df" valid for both the nodes in the network) for their
respective system clocks, the accumulated phase error at the re-synchronization instant
becomes:
where df represents the system clock relative tolerance (f actual frequency, f
N
nominal
frequency):
This error must be compensated, therefore it must be less than the programmed (Re-
)Synchronization Jump Width (SJW). Calling t
SJW
the duration of the re-synchronization
segment (programmable from 1 to 4 time quanta), the following condition can be written:
This expression can be seen as a condition for the CAN system clock tolerance df:
Considering now that real systems typically operate in the presence of electrical
disturbances, errors on the CAN bus may occurs. When an error is detected, an Error Flag
is transmitted on the bus: if the error is just local, only the node which detected it transmits
the Error Flag on the bus, while the other nodes simply receive the Error Flag and then
transmit their own Error Flags as an echo. On the contrary, if the error is global, all nodes
detect it within the same bit time, so they transmit their own Error Flags simultaneously. In
this way, each node can recognize if the error is local or global simply by detecting whether
there is an echo after its Error Flag. This is possible only if the node can properly sample the
first bit after transmitting the Error Flag.
The Error Flag from an Error Active node is composed by 6 dominant bits; in the worst case
condition of a bit stuffing error, up to other 6 dominant bits could be received before the Error
Flag. It means that the first bit after the Error Flag is the 13
th
bit after the last
synchronization: this bit, as already said, must be correctly sampled.
t
J
10
t
BT
⋅
=
Δ
t
J
2
df
⋅
(
)
10
t
BT
⋅
⋅
=
df
f
f
N
–
f
N
---------------
=
2
df
⋅
(
)
10
t
BT
⋅
⋅
t
SJW
<
df
t
SJW
2
10
t
BT
⋅
⋅
------------------------
<