GD32F403xx User Manual
403
3.
Set the STB[1:0] bits in USART_CTL1.
4.
Enable DMA (DENR bit) in USART_CTL2 if multibuffer communication is selected.
5.
Set the baud rate in USART_BAUD.
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 reception are stored in the USART_STAT0 register.
The software can get the received data by reading the USART_DATA register direct ly, or
through DMA. The RBNE bit 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 value of the three samples of
any bit are not the same, whatever it is a start bit, data bit, parity bit or stop bit, a noisy error
(NERR) 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 17-4. Receiving a frame bit by oversampling method
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 will be 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
Содержание GD32F403 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F403xx Arm Cortex M4 32 bit MCU User Manual Revision 2 6 Jul 2022 ...
Страница 177: ...GD32F403xx UserManual 177 Peripheral Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 SDIO SDIO ...
Страница 217: ...GD32F403xx UserManual 217 ensures that no conversion is in progress ...