English
Language : 

PXS20RM Datasheet, PDF (156/1368 Pages) Freescale Semiconductor, Inc – PXS20 Microcontroller
Boot Assist Module (BAM)
Upon reception of this zero byte and the configuration of the corresponding baud rate, an acknowledge
byte is returned by the BAM code to the host using the selected baud rate. This acknowledge byte is the
ASCII char “Y” (0x59). From this point BAM follows the normal UART mode boot protocol.
8.4.5.3 Autobaud measurement for FlexCAN / CAN protocol
Enabling the autobaud feature when using the CAN protocol assumes that the following additional CAN
frame is sent initially from the host to the MCU for baud measurement purposes:
• Standard identifier = 0x0,
• Data Length Code (DLC) = 0x0.
As all the bits to be transmitted are dominant bits, there is a succession of 5 dominant bits and 1 stuff bit
on the FlexCAN network (see Figure 8-9).
Start
Stuff bit Stuff bit
Stuff bit
Stuff bit
Measured Time
Figure 8-9. Autobaud measurement / CAN protocol
Initially the CAN RX pin is configured as GPIO input and the BAM code waits polling for the first falling
edge. Upon detection of this edge, the STM starts. Subsequently, the CAN RX pin is again polled, waiting
for a series of low-high transitions. Upon detection of this sequence, the STM is stopped and from the
measured time, the used baud rate is computed. The error introduced due to this polling will be small, but
might be visible.
The calculation of the FlexCAN baud rate allows the operation of the boot loader with a wide range of
baudrates. However, the upper and lower limits of related parameters have to be kept in mind, in order to
ensure proper data transfer. The maximum permissible baud rate that can be supported is 1Mbit/s.
From this additional frame being transmitted initially, the MCU calculates the corresponding baud rate
factor with respect to the current CPU clock and initializes the FlexCAN control register (especially the
fields PRESDIV, RJW, PSEG1, PSEG2, and PROPSEG) accordingly.
After measuring a predefined number of bit times, the resulting transmission time can be determined from
the STM time base; this value is then used to select PRESDIV and the desired number of time quanta. The
number of time quanta in a FlexCAN bit time is given by:
BitTime = SYNCSEG + TSEG1 + TSEG2
where
• SYNCSEG = Exactly one time quantum.
• TSEG1 = PROGPSEG + PSEG1 +2
• TSEG2 = PSEG2 + 1
8-14
PXS20 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor