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

ATMEGA64A-AU 参数 Datasheet PDF下载

ATMEGA64A-AU图片预览
型号: ATMEGA64A-AU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器,带有64K字节的系统内可编程闪存 [8-bit Microcontroller with 64K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 392 页 / 7964 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA64A-AU的Datasheet PDF文件第110页浏览型号ATMEGA64A-AU的Datasheet PDF文件第111页浏览型号ATMEGA64A-AU的Datasheet PDF文件第112页浏览型号ATMEGA64A-AU的Datasheet PDF文件第113页浏览型号ATMEGA64A-AU的Datasheet PDF文件第115页浏览型号ATMEGA64A-AU的Datasheet PDF文件第116页浏览型号ATMEGA64A-AU的Datasheet PDF文件第117页浏览型号ATMEGA64A-AU的Datasheet PDF文件第118页  
ATmega64A  
• FOCnA, FOCnB, and FOCnC are added in the new TCCRnC Register.  
• WGMn3 is added to TCCRnB.  
Interrupt flag and mask bits for Output Compare unit C are added.  
The 16-bit Timer/Counter has improvements that will affect the compatibility in some special  
cases.  
15.3 Accessing 16-bit Registers  
The TCNTn, OCRnA/B/C, and ICRn are 16-bit registers that can be accessed by the AVR CPU  
via the 8-bit data bus. The 16-bit register must be byte accessed using two read or write opera-  
tions. Each 16-bit timer has a single 8-bit register for temporary storing of the high byte of the 16-  
bit access. The same temporary register is shared between all 16-bit registers within each 16-bit  
timer. Accessing the low byte triggers the 16-bit read or write operation. When the low byte of a  
16-bit register is written by the CPU, the high byte stored in the temporary register, and the low  
byte written are both copied into the 16-bit register in the same clock cycle. When the low byte of  
a 16-bit register is read by the CPU, the high byte of the 16-bit register is copied into the tempo-  
rary register in the same clock cycle as the low byte is read.  
Not all 16-bit accesses uses the temporary register for the high byte. Reading the OCRnA/B/C  
16-bit registers does not involve using the temporary register.  
To do a 16-bit write, the high byte must be written before the low byte. For a 16-bit read, the low  
byte must be read before the high byte.  
The following code examples show how to access the 16-bit timer registers assuming that no  
interrupts updates the temporary register. The same principle can be used directly for accessing  
the OCRnA/B/C and ICRn Registers. Note that when using “C”, the compiler handles the 16-bit  
access.  
Assembly Code Examples(1)  
:.  
; Set TCNTn to 0x01FF  
ldi r17,0x01  
ldi r16,0xFF  
out TCNTnH,r17  
out TCNTnL,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 “About Code Examples” on page 8.  
The assembly code example returns the TCNTn value in the r17:r16 register pair.  
114  
8160C–AVR–07/09  
 复制成功!