![Geehy SEMICONDUCTOR APM32F405 Series User Manual Download Page 321](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630321.webp)
www.geehy.com Page 320
(5) In single buffer mode, the RXBNEFLG bit can be cleared by reading USART_DATA register
by software or by writing 0.
(6) In multi-buffer mode, after each byte is received, RXBNEFLG bit of USART_STS register will
be set to 1, and DMA will read the data register to clear it.
Break frame
When the receiver receives a break frame, USART will handle it as receiving a
frame error.
Idle frame
When the receiver receives an idle frame, USART will handle it as receiving an
ordinary data frame; if IDLEIEN bit of USART_CTRL1 is set, an interrupt will be
generated.
Oversampling rate
OSMCFG bit of USART_CTRL1 register determines the oversampling rate.
If the oversampling rate is 8 times of the baud rate, the speed is higher, but the
clock tolerance is smaller. If it is 16 times, the speed is lower, but the clock
tolerance is bigger.
Overrun error
When RXBNEFLG bit of USART_STS register is set to 1 and a new character is
received at the same time, an overrun error will be caused. Only after RXEN is
reset, can the data be transferred from the shift register to DATA register.
RXBNEFLG bit will be set to 1 after receiving the byte. This bit needs to be reset
before receiving the next data or serving the previous DMA request; otherwise,
an overrun error will be caused.
When an overrun error occurs
USART_STS OVREFLG bit set to 1.
The data in DATA register will not be lost.
The data in the shift register received before will be overwritten, but
the data received later will not be saved.
If RXBNEIEN bit of USART_CTRL1 is set to 1, an interrupt will be
generated.
When OVREFLG bit is set to 1, it means that the data has been lost.
There are two possibilities:
-
When RXBNEFLG=1, the previous valid data is still on DATA
register, and can be read.
-
When RXBNEFLG=0, there is no valid data in DATA register.
The OVREFLG bit can be reset through read operation for
USART_STS and USART_DATA registers.