当数据接收区或者FIFO区有数据或者满时,又有新数据进来,会导致发生溢出错误,一旦发生溢出错误,RX 移位寄存区虽然能有新数据不断的覆盖,但是数据不会到达RXR或FIFO(现象是:RXNE在ORE置位时不会被置位),导致程序中不能读到新的数据。只有通过ICR清除ORE才能使得RXNE在接收到新数据时置位。
串口框图
溢出错误属于串口接收
USART receiver
溢出错误发生的原因
- FIFO mode disabled
An overrun error occurs if a character is received and RXNE has not been reset.
Data can not be transferred from the shift register to the RDR register until the RXNE
bit is cleared. The RXNE flag is set after every byte reception.
An overrun error occurs if RXNE flag is set when the next data is received or the previous DMA request has not been serviced. - FIFO mode enabled
An overrun error occurs when the shift register