AVR UART - FE、DOR、RXB8 位缓冲

AVR UART - FE, DOR, RXB8 bit buffering

我正在阅读 Atmel ATmega16 微控制器的数据表,我在 USART 部分看到了这个短语:

The two Buffer Registers operate as a circular FIFO buffer. Therefore the UDR must only be read once for each incoming data! More important is the fact that the Error Flags (FE and DOR) and the 9th data bit (RXB8) are buffered with the data in the receive buffer. Therefore the status bits must always be read before the UDR Register is read. Otherwise the error status will be lost since the buffer state is lost.

我不知道缓冲错误标志和 RXB8 是什么意思。任何帮助将不胜感激。

这里的主要警告是 UDR 只能为每个传入字节读取一次,并且在读取它时,提到的错误标志会被清除。因此,如果有人对 RXB8 中的错误标志或“第 9 位”感兴趣,则必须在 读取 UDR 之前 读取它们。

然而,在十年的 AVR 和串行通信设计中,我从未不得不求助于使用 RXB8。为什么?只有当您使用 9 数据位 进行通信时才需要它。有关 C 语言和汇编程序的示例,请参见数据表的第 155 页。大多数数据通信使用 7 位或(更常见的)8 位,因此大多数时候不需要这个额外的位。如果您需要它,只需按照 p.1 中的示例进行操作即可。 155.

More important is the fact that the Error Flags (FE and DOR) and the 9th data bit (RXB8) are buffered with the data in the receive buffer. Therefore the status bits must always be read before the UDR Register is read. Otherwise the error status will be lost since the buffer state is lost.

这只是指出,错误标志和第 9 个数据位(显然)耦合到 UDR FIFO 中的数据,并且在您读取 UDR 时立即丢失。

示例:
如果您使用 9 个数据位,则必须在读取 UDR 之前读取第 9 位。否则,FIFO 中的下一个字节(包括其状态位)将覆盖属于前一个字节的第 9 位的信息。这同样适用于错误位。