DocID13284 Rev 2 317/564
UM0404 The bootstrap loader
Therefore the maximum error at the detection of the communication on CAN pin is:
(1 not taken + 1 taken jumps) + 1 taken jump + 1 bit set: (6) + 6 CPU clock cycles
The error at the detection for the 5th recessive bit is:
(1 taken jump) + 1 not taken jump + 1 compare + 1 bit clear: (4) + 6 CPU cycles
In the worst case the induced error is of six CPU clock cycles. So the polling could induce an
error of six timer ticks.
Error induced by the Baud rate calculation
The content of the timer PT0 counter corresponds to 29 bit times. This gives the following
equation:
PT0 = 58 x (BRP + 1) X (1 + Tseg1 + Tseg2)
where BRP, Tseg1 and Tseg2 are the field of the CAN Bit Timing register.
The CAN protocol specification recommends to implement a bit time composed by at least 8
time quantum (tq). This recommendation have been applied here. Moreover, the maximum
bit time length is 25 tq. In order to have a good precision, the target is to have the smallest
Bitrate Prescaler (BRP) and the maximum number of tq in a bit time.
This gave the following ranges for PT0 according to BRP:
8 ≤ 1 + Tseg1 + Tseg2 ≤ 25
464 x (1 + BRP) ≤ PT0 ≤ 1450 x (1 + BRP)
The error coming from the measurement of the 29 Bit is:
e
1
= 6 / [PT0]
It is maximal for the smallest BRP value and the smallest number of ticks in PT0. Therefore:
e
1 Max
= 1.29%
Table 46. Ranges of timer contents versus BRP value
BRP PT0_min PT0_max Comments
0 464 1450
1 1451 2900
2 2901 4350
3 4351 5800
4 5801 7250
5 7251 8700
.. .. ..
43 20416 63800
44 20880 65250
45 21344 66700 Possible timer overflow
.. .. ..
63 X X