![GigaDevice Semiconductor GD32F20 Series Скачать руководство пользователя страница 493](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801493.webp)
GD32F20x User Manual
493
6.
Set the REN bit in USART_CTL0.
After being enabled, the receiver receives a bit stream after a valid start pulse has been
detected. Detection on noisy error, parity error, frame error and overrun error is performed
during the reception of a frame.
When a frame is received, the RBNE bit in USART_STAT0 is asserted, an interrupt is
generated if the corresponding interrupt enable bit (RBNEIE) is set in the USART_CTL0
register. The status bits of the received are stored in the USART_STAT0 register.
The software can get the received data by reading the USART_DATA register directly, or
through DMA. The RBNE status is cleared by a read operation on the USART_DATA register,
whatever it is performed by software directly, or through DMA.
The REN bit should not be disabled when reception is ongoing, or the current frame will be
lost.
By default, the receiver gets three samples to evaluate the value of a frame bit. While in the
oversampling 16 mode, the 7th, 8th, and 9th samples are used. If two or more samples of a
frame bit is 0, the frame bit is confirmed as a 0, else 1. If the three samples of any bit in a
frame are not the same, whatever it is a start bit, data bit, parity bit or stop bit, a noisy error
(NERR) status will be generated for the frame. An interrupt is generated, if the receive DMA
is enabled and the ERRIE bit in USART_CTL2 register is set.
Figure 19-4. Oversampling method of a receive frame bit
0
2
4
6
8
10
12
14
1
3
5
7
9
11
13
15
one frame bit
sample bits
oversampling
16 mode
RX pin
If the parity check function is enabled by setting the PCEN bit in the USART_CTL0 register,
the receiver calculates the expected parity value while receiving a frame. The received
parity bit will be compared with this expected value. If they are not the same, the parity error
(PERR) bit in USART_STAT0 register will be set. An interrupt is generated, if the PERRIE
bit in USART_CTL0 register is set.
If the RX pin is evaluated as 0 during a stop bit, the frame error (FERR) bit in USART_STAT0
register will be set. An interrupt is generated, if the receive DMA is enabled and the ERRIE
bit in USART_CTL2 register is set.
When a frame is received, if the RBNE bit is not cleared yet, the last frame will not be stored
in the receive data buffer. The overrun error (ORERR) bit in USART_STAT0 register will be
set. An interrupt is generated, if the receive DMA is enabled and the ERRIE bit in
USART_CTL2 register is set, or if the RBNEIE is set.
The RBNE, NERR, PERR, FERR and ORERR flags of a reception are always set at the same
time. If the receive DMA is not enabled, software can check NERR, PERR, FERR and ORERR
flags when serving the RBNE interrupt.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...