Chapter 33 Boot Assist Module (BAM)
MPC5602P Microcontroller Reference Manual, Rev. 4
Freescale Semiconductor
835
33.6.1.2.1
Choosing the host baud rate
The calculation of the UART baud rate from the length of the first 0 byte that is received, 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.
SCI autobaud rate feature operates by polling the LINFlex_RX pin for a low signal. The length of time
until the next low to high transition is measured using the System Timer Module (STM) time base. This
high-low-high transition is expected to be a zero byte: a start bit (low) followed by eight data bits (low)
followed by a stop bit (high).
Upon reception of a zero byte and configuration of the baud rate, an acknowledge byte is returned to the
host using the selected baud rate.
Time base is enabled at reception of first low bit, disabled and read at reception of next high bit. Error
introduced due to polling will be small (typically < 6 cycles).
The following equation gives the relation between baud rate and LINFlex register configuration:
Eqn. 33-1
LDIV is an unsigned fixed point number and its mantissa is coded into 13 bits of the LINFlex’s register
LINIBRR.
From this equation and considering that a single UART transmission contains 9 bits, it is possible to obtain
the connection between time base measured by STM and LINIBB register:
Eqn. 33-2
To minimize errors in baud rate, a large external oscillator frequency value and low baud rate signal are
preferred.
Example 33-3. Baud rate calculation for 24 kBaud signal
Considering a 24 kbaud signal and the device operating with 20 MHz external frequency.
Over 9 bits the STM will measure: (9 × 20 MHz)/24 kbaud = 7497 cycles.
Error expected to be approximately ± 6 cycles due to polling.
Thus, LINIBB will be set to 52 (rounding required). This results in a baud rate of 24.038 kbaud. Error of
< 0.2%.
To maintain the maximum deviation between host and calculated baud rate, recommendations for the user
are listed
.
LDIV
F
cpu
16 baudrate
---------------------------------
=
LINIBRR
timebase
144
-----------------------
=