|
发表于 2009-12-3 19:20:29
|
显示全部楼层
另外,AVR的USART接收还配备了一级缓冲器,当硬件收到一个字节后,软件不需要马上读掉,可以等一段时间(但必须小于下一个帧的接收时间的160个采样周期)再读,因此为程序员留出更多的考虑接收来不及处理的空间或时间(数据流控制)。这些优点51是没有的。从整体讲,AVR的USART比51要稳定的多,也更加方便使用。
-------------------------------------------------------------------------------
51也有这个功能。
=============================================================================
The Data OverRun (DOR) Flag indicates data loss due to a receiver buffer full condition. A Data OverRun occurs when the receive buffer is full (two characters), it is a new character waiting in the receive Shift Register, and a new start bit is detected. If the DOR
Flag is set there was one or more serial frame lost between the frame last read from UDR, and the next frame read from UDR. For compatibility with future devices, always write this bit to zero when writing to UCSRA. The DOR Flag is cleared when the frame
received was successfully moved from the Shift Register to the receive buffer.
AVR比51多了一级缓冲,
AVR是收到3个字节(缓冲器中2个, Shift Register中一个),当第4个起始位到时溢出。
51是收到2个字节(缓冲器中1个, Shift Register中一个),当第3个起始位到时溢出。 |
|