EasyManua.ls Logo

ST ST10F276E - How to Compute the Baud Rate Error

ST ST10F276E
564 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The bootstrap loader UM0404
318/564 DocID13284 Rev 2
To have a better precision, the target is to have the smallest BRP so that the time quantum
is the smallest possible. Thus an error on the calculation of time quanta in a bit time is
minored.
In order to do so, the value of PT0 is divided in ranges of 1450 ticks. In the algorithm, PT0 is
divided by 1451 and the result is BRP.
The calculated BRP value is then used to divide PT0 in order to have the value of (1 +
Tseg1 + Tseg2). A table is made to set the values for Tseg1 and Tseg2 according to the
value of (1 + Tseg1 + Tseg2). These values of Tseg1 and Tseg2 are chosen in order to
reach a sample point between 70% and 80% of the bit time.
During the calculation of (1 + Tseg1 + Tseg2), an error e
2
can be introduced by the division.
This error is of 1 time quantum maximum.
To compensate any possible error on bitrate, the (Re)Synchronization Jump Width is fixed
to 2 time quanta.
15.4.6 How to compute the baud rate error
Considering the following conditions, a computation of the error is reported as example.
CPU frequency: 20 MHz
Target bitrate: 1Mbit/s
In these conditions, the content of PT0 timer for 29 bits should be:
Therefore:
574 < [PT0] < 586
This gives:
BRP = 0
tq = 100 ns
Computation of 1 + Tseg1 + Tseg2: considering the equation:
[PT0] = 58 x (1 + BRP) x (1 + Tseg1 + Tseg2)
Thus:
In the algorithm, a rounding to the superior value is made if the remainder of the division is
greater than half of the divisor. Here it would have been the case if the PT0 content was
574. Thus in this example it results 1+Tseg1+Tseg2 = 10, giving a bit time of exactly 1µs =>
no error in bitrate.
PT0[]
29 Fcpu×
Bitrate
---------------------------
29 20× 6×
110
6
×
----------------------------- 580===
9
574
58
----------
Tseg1 Tseg2
586
58
---------- 10=+=

Table of Contents

Related product manuals