欢迎访问ic37.com |
会员登录 免费注册
发布采购

AT90PWM3B-16SU 参数 Datasheet PDF下载

AT90PWM3B-16SU图片预览
型号: AT90PWM3B-16SU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器具有8K字节的系统内可编程闪存 [8-bit Microcontroller with 8K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 361 页 / 6022 K
品牌: ATMEL [ ATMEL ]
 浏览型号AT90PWM3B-16SU的Datasheet PDF文件第191页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第192页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第193页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第194页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第196页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第197页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第198页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第199页  
AT90PWM2/3/2B/3B  
The receive function example reads all the I/O Registers into the Register File before any com-  
putation is done. This gives an optimal receive buffer utilization since the buffer location read will  
be free to accept new data as early as possible.  
18.7.3  
Receive Complete Flag and Interrupt  
The USART Receiver has one flag that indicates the Receiver state.  
The Receive Complete (RXC) flag indicates if there are unread data present in the receive buf-  
fer. This flag is one when unread data exist in the receive buffer, and zero when the receive  
buffer is empty (i.e., does not contain any unread data). If the Receiver is disabled (RXEN = 0),  
the receive buffer will be flushed and consequently the RXC bit will become zero.  
When the Receive Complete Interrupt Enable (RXCIE) in UCSRB is set, the USART Receive  
Complete interrupt will be executed as long as the RXC flag is set (provided that global inter-  
rupts are enabled). When interrupt-driven data reception is used, the receive complete routine  
must read the received data from UDR in order to clear the RXC flag, otherwise a new interrupt  
will occur once the interrupt routine terminates.  
18.7.4  
Receiver Error Flags  
The USART Receiver has three error flags: Frame Error (FE), Data OverRun (DOR) and Parity  
Error (UPE). All can be accessed by reading UCSRA. Common for the error flags is that they are  
located in the receive buffer together with the frame for which they indicate the error status. Due  
to the buffering of the error flags, the UCSRA must be read before the receive buffer (UDR),  
since reading the UDR I/O location changes the buffer read location. Another equality for the  
error flags is that they can not be altered by software doing a write to the flag location. However,  
all flags must be set to zero when the UCSRA is written for upward compatibility of future  
USART implementations. None of the error flags can generate interrupts.  
The Frame Error (FE) flag indicates the state of the first stop bit of the next readable frame  
stored in the receive buffer. The FE flag is zero when the stop bit was correctly read (as one),  
and the FE flag will be one when the stop bit was incorrect (zero). This flag can be used for  
detecting out-of-sync conditions, detecting break conditions and protocol handling. The FE flag  
is not affected by the setting of the USBS bit in UCSRC since the Receiver ignores all, except for  
the first, stop bits. For compatibility with future devices, always set this bit to zero when writing to  
UCSRA.  
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 Regis-  
ter to the receive buffer.  
The following example (See Figure 18-5.) represents a Data OverRun condition. As the receive  
buffer is full with CH1 and CH2, CH3 is lost. When a Data OverRun condition is detected, the  
OverRun error is memorized. When the two characters CH1 and CH2 are read from the receive  
buffer, the DOR bit is set (and not before) and RxC remains set to warn the application about the  
overrun error.  
195  
4317J–AVR–08/10  
 复制成功!