
The bootstrap loader
UM0404
DocID13284 Rev 2
15.3.5
Choosing the baud rate for the BSL via UART
The calculation of the serial baudrate for ASC0 from the length of the first zero byte that is
received, allows the operation of the bootstrap loader of the ST10F276 with a wide range of
baudrates. However, the upper and lower limits have to be kept, in order to insure proper
data transfer.
The ST10F276 uses timer T6 to measure the length of the initial zero byte. The quantization
uncertainty of this measurement implies the first deviation from the real baudrate, the next
deviation is implied by the computation of the S0BRL reload value from the timer contents.
The formula below shows the association:
For a correct data transfer from the host to the ST10F276 the maximum deviation between
the internal initialized baudrate for ASC0 and the real baudrate of the host should be below
2.5%. The deviation (F
B
, in percent) between host baudrate and ST10F276 baudrate can be
calculated via the formula below:
Note:
Function (F
B
) does not consider the tolerances of oscillators and other devices supporting
the serial communication.
This baudrate deviation is a nonlinear function depending on the CPU clock and the
baudrate of the host. The maxima of the function (F
B
) increases with the host baudrate due
to the smaller baudrate pre-scaler factors and the implied higher quantization error (see
).
Figure 129. Baudrate deviation between host and ST10F276
The minimum baudrate
(B
Low
) is determined by the maximum count capacity
of timer T6, when measuring the zero byte, that is, it depends on the CPU clock. Using the
maximum T6 count 2
16
in the formula the minimum baudrate can be calculated. The lowest
standard baudrate in this case would be 1200 Baud. Baudrates below B
Low
would cause T6
to overflow. In this case ASC0 cannot be initialized properly.
The maximum baudrate
(B
High
in
) is the highest baudrate where the deviation
still does not exceed the limit, that is, all baudrates between B
Low
and B
High
are below the
deviation limit. The maximum standard baudrate that fulfills this requirement is 19200 Baud.
f
CPU
32
S0BRL
1
+
(
)
⋅
-------------------------------------------
BST10F276
=
S0BRL
T6
36
–
72
--------------------
=
T6
9
4
--
f
CPU
B
Host
---------------
⋅
=
,
F
B
B
Contr
B
Host
–
B
Contr
----------------------------------------
100
⋅
=
%
F
B
2.5
≤
%
,
B
Low
2.5%
F
B
B
High
I
II
B
HOST