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

ATMEGA32L-8AUR 参数 Datasheet PDF下载

ATMEGA32L-8AUR图片预览
型号: ATMEGA32L-8AUR
PDF下载: 下载PDF文件 查看货源
内容描述: [RISC Microcontroller, 8-Bit, FLASH, AVR RISC CPU, 8MHz, CMOS, PQFP44, 10 X 10 MM, 1 MM HEIGHT, 0.80 MM PITCH, GREEN, PLASTIC, MS-026ACB, TQFP-44]
分类和应用: 闪存微控制器
文件页数/大小: 347 页 / 3171 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第147页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第148页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第149页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第150页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第152页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第153页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第154页浏览型号ATMEGA32L-8AUR的Datasheet PDF文件第155页  
ATmega32(L)  
Receiving Frames with 9  
Databits  
If 9 bit characters are used (UCSZ=7) the ninth bit must be read from the RXB8 bit in  
UCSRB before reading the low bits from the UDR. This rule applies to the FE, DOR and  
PE Status Flags as well. Read status from UCSRA, then data from UDR. Reading the  
UDR I/O location will change the state of the receive buffer FIFO and consequently the  
TXB8, FE, DOR and PE bits, which all are stored in the FIFO, will change.  
The following code example shows a simple USART receive function that handles both  
9-bit characters and the status bits.  
Assembly Code Example(1)  
USART_Receive:  
; Wait for data to be received  
sbis UCSRA, RXC  
rjmp USART_Receive  
; Get status and 9th bit, then data from buffer  
in  
in  
in  
r18, UCSRA  
r17, UCSRB  
r16, UDR  
; If error, return -1  
andi r18,(1<<FE)|(1<<DOR)|(1<<PE)  
breq USART_ReceiveNoError  
ldi  
ldi  
r17, HIGH(-1)  
r16, LOW(-1)  
USART_ReceiveNoError:  
; Filter the 9th bit, then return  
lsr  
r17  
andi r17, 0x01  
ret  
C Code Example(1)  
unsigned int USART_Receive( void )  
{
unsigned char status, resh, resl;  
/* Wait for data to be received */  
while ( !(UCSRA & (1<<RXC)) )  
;
/* Get status and 9th bit, then data */  
/* from buffer */  
status = UCSRA;  
resh = UCSRB;  
resl = UDR;  
/* If error, return -1 */  
if ( status & (1<<FE)|(1<<DOR)|(1<<PE) )  
return -1;  
/* Filter the 9th bit, then return */  
resh = (resh >> 1) & 0x01;  
return ((resh << 8) | resl);  
}
Note:  
1. See “About Code Examples” on page 7.  
151  
2503J–AVR–10/06  
 复制成功!