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

MEGA128CAN 参数 Datasheet PDF下载

MEGA128CAN图片预览
型号: MEGA128CAN
PDF下载: 下载PDF文件 查看货源
内容描述: 微控制器,带有ISP功能的Flash和CAN控制器128K字节 [Microcontroller WITH 128K BYTES OF ISP FLASH AND CAN CONTROLLER]
分类和应用: 微控制器
文件页数/大小: 413 页 / 5507 K
品牌: ATMEL [ ATMEL ]
 浏览型号MEGA128CAN的Datasheet PDF文件第177页浏览型号MEGA128CAN的Datasheet PDF文件第178页浏览型号MEGA128CAN的Datasheet PDF文件第179页浏览型号MEGA128CAN的Datasheet PDF文件第180页浏览型号MEGA128CAN的Datasheet PDF文件第182页浏览型号MEGA128CAN的Datasheet PDF文件第183页浏览型号MEGA128CAN的Datasheet PDF文件第184页浏览型号MEGA128CAN的Datasheet PDF文件第185页  
AT90CAN128  
The following code example shows a simple USART0 receive function based on polling  
of the Receive Complete (RXC0) flag. When using frames with less than eight bits the  
most significant bits of the data read from the UDR0 will be masked to zero. The  
USART0 has to be initialized before the function can be used.  
Assembly Code Example(1)  
USART0_Receive:  
; Wait for data to be received  
lds  
r18, UCSR0A  
sbrs r18, RXC0  
rjmp USART0_Receive  
; Get and return received data from buffer  
lds  
ret  
r16, UDR0  
C Code Example(1)  
unsigned char USART0_Receive (void )  
{
/* Wait for data to be received */  
while ( ! (UCSR0A & (1<<RXC0)))  
;
/* Get and return received data from buffer */  
return UDR0;  
}
Note:  
1. The example code assumes that the part specific header file is included.  
The function simply waits for data to be present in the receive buffer by checking the  
RXC0 flag, before reading the buffer and returning the value.  
Receiving Frames with 9 Data If 9-bit characters are used (UCSZn=7) the ninth bit must be read from the RXB8n bit in  
Bits  
UCSRnB before reading the low bits from the UDRn. This rule applies to the FEn,  
DORn and UPEn Status Flags as well. Read status from UCSRnA, then data from  
UDRn. Reading the UDRn I/O location will change the state of the receive buffer FIFO  
and consequently the TXB8n, FEn, DORn and UPEn bits, which all are stored in the  
FIFO, will change.  
181  
4250E–CAN–12/04  
 复制成功!