Chapter 33 Boot Assist Module (BAM)
MPC5602P Microcontroller Reference Manual, Rev. 4
Freescale Semiconductor
839
33.6.1.3.1
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
).
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 = S TSEG1 + TESG2
SYNCSEG = Exactly one time quantum.
TSEG1 = PR PSEG1 + 2
TSEG2 = PSEG2 + 1
Time base result = 29 × (1) × (S 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 33-12. 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