EasyManua.ls Logo

Bouffalo Lab BL702 - UART Fixed Character Mode Waveform

Default Icon
375 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...
BL702/704/706 Reference Manual
10.3.6 Automatic baud rate detection
The UART module supports automatic baud rate detection. The detection is divided into two types, one is general
mode and the other is fixed character mode. The two detection modes will be enabled every time the bit <ABREN>
of the register URX_CONFIG is turned on.
General mode
For any character data received, the UART module will count the number of clocks in the bit width. This number
will then be written into the lower 16 bits of the register STS_URX_ABR_PRD and used to calculate the baud rate.
Therefore, when the first received data bit is 1, the correct baud rate can be obtained. Such as ’0x01’ under LSB-
FIRST.
Fixed character mode
In this mode, after counting the number of clocks in the starting bit width, the UART module will continue to count
the number of clocks of subsequent data bits and compare with the start bit. If it fluctuates within the allowable error
range, it will pass the test, otherwise the count value will be discarded. Therefore, only when the fixed characters
’0x55’/’0xD5’ under LSB-FIRST or ’0xAA’/’0xAB’ under MSB-FIRST are received. The UART module will write the
count value of the number of clocks in the starting bit width into the upper 16 bits of the register STS_URX_ABR_PRD.
As shown below:
UART_CLK
Start Bit
Stop Bit
1002
1001
1003
1002
1005
1001
1000
0x55
Fig. 10.4: UART fixed character mode waveform
For an unknown baud rate, the UART uses UART_CLK to count the start bit width of 1000, and the second bit width of
1001. If there is no more than 4 UART_CLK floating up and down from the previous bit width, the UART will continue
to count the third bit, which is 1005. If the difference with the start bit exceeds 4, the detection fails and the data is
discarded. The UART will sequentially compare the first 6 bits of the data bit with the start bit.
The formula for calculating the detected baud rate is as follows: Baud rate=source clock/(16-bit detection value+1)
BL702/704/706 Reference Manual 193/ 375
@2021 Bouffalo Lab
guest@bouffalolab

Table of Contents