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

ATMEGA8A-AUR 参数 Datasheet PDF下载

ATMEGA8A-AUR图片预览
型号: ATMEGA8A-AUR
PDF下载: 下载PDF文件 查看货源
内容描述: [RISC Microcontroller, 8-Bit, FLASH, AVR RISC CPU, 16MHz, CMOS, PQFP32, 7 X 7 MM, 1 MM HEIGHT, 0.80 MM PITCH, GREEN, PLASTIC, MS-026ABA, TQFP-32]
分类和应用: 闪存
文件页数/大小: 308 页 / 4674 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA8A-AUR的Datasheet PDF文件第77页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第78页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第79页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第80页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第82页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第83页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第84页浏览型号ATMEGA8A-AUR的Datasheet PDF文件第85页  
ATmega8(L)  
The following code examples show how to do an atomic write of the TCNT1 Register contents.  
Writing any of the OCR1A/B or ICR1 Registers can be done by using the same principle.  
Assembly Code Example(1)  
TIM16_WriteTCNT1:  
; Save Global Interrupt Flag  
in r18,SREG  
; Disable interrupts  
cli  
; Set TCNT1 to r17:r16  
outTCNT1H,r17  
outTCNT1L,r16  
; Restore Global Interrupt Flag  
outSREG,r18  
ret  
C Code Example(1)  
void TIM16_WriteTCNT1( unsigned int i )  
{
unsigned char sreg;  
unsigned int i;  
/* Save Global Interrupt Flag */  
sreg = SREG;  
/* Disable interrupts */  
_CLI();  
/* Set TCNT1 to i */  
TCNT1 = i;  
/* Restore Global Interrupt Flag */  
SREG = sreg;  
}
Note:  
1. See “About Code Examples” on page 8.  
The assembly code example requires that the r17:r16 Register pair contains the value to be writ-  
ten to TCNT1.  
Reusing the  
Temporary High Byte  
Register  
If writing to more than one 16-bit register where the High byte is the same for all registers writ-  
ten, then the High byte only needs to be written once. However, note that the same rule of  
atomic operation described previously also applies in this case.  
81  
2486T–AVR–05/08  
 复制成功!