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

ATMEGA16U2-MUR 参数 Datasheet PDF下载

ATMEGA16U2-MUR图片预览
型号: ATMEGA16U2-MUR
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器具有ISP功能的Flash 8/16 / 32K Butes [8-bit Microcontroller with 8/16/32K Butes of ISP Flash]
分类和应用: 微控制器异步传输模式PCATM
文件页数/大小: 310 页 / 4432 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第107页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第108页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第109页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第110页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第112页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第113页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第114页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第115页  
ATmega8U2/16U2/32U2  
Assembly Code Examples(1)  
...  
; Set TCNTn to 0x01FF  
ldir17,0x01  
ldir16,0xFF  
outTCNTnH,r17  
outTCNTnL,r16  
; Read TCNTn into r17:r16  
in r16,TCNTnL  
in r17,TCNTnH  
...  
C Code Examples(1)  
unsigned int i;  
...  
/* Set TCNTn to 0x01FF */  
TCNTn = 0x1FF;  
/* Read TCNTn into i */  
i = TCNTn;  
...  
Note:  
1. See “Code Examples” on page 6.  
The assembly code example returns the TCNTn value in the r17:r16 register pair.  
It is important to notice that accessing 16-bit registers are atomic operations. If an interrupt  
occurs between the two instructions accessing the 16-bit register, and the interrupt code  
updates the temporary register by accessing the same or any other of the 16-bit Timer Regis-  
ters, then the result of the access outside the interrupt will be corrupted. Therefore, when both  
the main code and the interrupt code update the temporary register, the main code must disable  
the interrupts during the 16-bit access.  
The following code examples show how to do an atomic read of the TCNTn Register contents.  
Reading any of the OCRnA/B/C or ICRn Registers can be done by using the same principle.  
111  
7799D–AVR–11/10  
 复制成功!