Boot Assist Module (BAM) RM0046
828/936 Doc ID 16912 Rev 5
Choosing the host baud rate
The calculation of the FlexCAN baud rate allows the operation of the boot loader with a wide
range of baud rates. However, to ensure proper data transfer, the upper and lower limits
have to be kept.
Pins are measured until reception of the 5th recessive bit. Thus a total of 29 bit-times are
measured (see Figure 491).
When calculating bit times and prescalers, to minimize any errors, ideally operate with the
minimum system clock prescaler divider (CAN_CR[PRESDIV]) and maximum number of
time quanta possible.
After measuring the 29 bit times, the results stored in the STM time base are used to select
PRESDIV. The number of time quanta in a FlexCAN bit time is given by:
Bit_time = SYNCSEG + TSEG1 + TESG2
SYNCSEG = Exactly one time quantum.
TSEG1 = PROGPSEG + PSEG1 + 2
TSEG2 = PSEG2 + 1
Time base result = 29 × (Presdiv+1) × (SYNCSEG + TSEG1 + TSEG2)
FlexCAN protocol specifies that the FlexCAN bit timing should comprise a minimum of 8
time quanta and a maximum of 25 time quanta. Therefore, the available range is:
8
1 + TSEG1 + TESG2
25
For 29 bit times, the possible range in which the result in the time base may lie, accounting
for PRESDIV, is:
(232 × (1 + PRESDIV))
time base
(725 × (1 + PRESDIV))
Therefore, the available values of the time base can be divided into windows of 725 counts.
In the BAM, the time base is divided by 726, the remainder is discarded. The result provides
the CAN_CR[PRESDIV] to be selected.
To help compensate for any error in the calculated baud rate, the resynchronization jump
width will be increased from its default value of 1 to a fixed value of 2 time quanta.This is the
maximum value allowed that can accommodate all permissible can baud rates. See
Table 446.
Table 445. Prescaler/divider and time base values
PRESDIV Time base Minimum Time base Maximum
0 232 725
1 726 1450
2 1451 2175
3 2176 2900