![ARTERY AT32F435 Series Скачать руководство пользователя страница 212](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592212.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 212
Rev 2.03
The error flag is set when a framing error, noise error or overrun error is detected during
reception.
In DMA mode, the RDNE bit is set after every byte is received, and it is cleared when the data
register is read by DMA.
In non-DMA mode, the RDBF bit is cleared when read access to the USART_DT register by
software. The RDBF flag can also be cleared by writing 0 to it. The RDBF bit must be cleared
before the end of next frame reception to avoid overrun error.
Brake frame reception:
Non-LIN mode: It is handled as a framing error, and the FERR is set. An interrupt is generated if
the corresponding interrupt bit is enabled. Refer to framing error described below for details.
LIN mode: It is handled as a brake frame, and the BFF bit is set. An interrupt is generated if the
BFIEN is set.
Idle frame reception:
It is handled as a data frame, and the IDLEF bit is set. An interrupt is generated if the IDLEIEN is
set.
When a framing error occurs:
The FERR bit is set.
The USART receiver moves the invalid data from the receive shift register to the receive data
buffer.
In non-DMA mode, both FERR and RDBF are set at the same time. The latter will generate an
interrupt. In DMA mode, an interrupt is generated if the ERRIEN.
When an overrun error occurs:
The ROERR bit is set.
The data in the receive data buffer is not lost. The previous data is still available when the
USART_DT register is read.
The content in the receive shift register is overwritten. Afterwards, any data received will be lost.
An interrupt is generated if the RDBFIEN is set or both ERRIEN and DMAREN are set.
The ROERR bit is cleared by reading the USART_STS register and then USART_DT register in
order.
Note: If ROERR is set, it indicates that at least one piece of data is lost, with two possibilities:
If RDBF=1, it indicates that the last valid data is still stored in the receive data buffer, and
can be read.
If RDBF=0, it indicates that the last valid data in the receive data buffer has already been
read.
Note: The REN bit cannot be reset during data reception, or the byte that is currently being received will
be lost.
12.8.3 Start bit and noise detection
A start bit detection occurs when the REN bit is set. With the oversampling techniques, the USART
receiver samples data on the 3rd, 5th, 7th, 8th, 9th and 10th bits to detect the valid start bit and noise.
Table 12-2 shows the data sampling over start bit and noise detection.
Table 12-2 Data sam pling over start bit and noise detection
Sampled value (3·5·7)
Sampled value (8·9·10)
NERR bit
Start bit validity
000
000
0
Valid
001/010/100
001/010/100
1
Valid
001/010/100
000
1
Valid
000
001/010/100
1
Valid
111/110/101/011
Any value
1
Invalid
Any value
111/110/101/011
1
Invalid
Note: If the sampling values on the 3rd, 5th, 7th, 8th, 9th, and 10th bits do not match the above