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

ATMEGA8-16AI 参数 Datasheet PDF下载

ATMEGA8-16AI图片预览
型号: ATMEGA8-16AI
PDF下载: 下载PDF文件 查看货源
内容描述: 位的AVR微控制器8K字节在 - 系统内可编程Flash [-bit AVR Microcontroller with 8K Bytes In- System Programmable Flash]
分类和应用: 微控制器
文件页数/大小: 303 页 / 5122 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA8-16AI的Datasheet PDF文件第74页浏览型号ATMEGA8-16AI的Datasheet PDF文件第75页浏览型号ATMEGA8-16AI的Datasheet PDF文件第76页浏览型号ATMEGA8-16AI的Datasheet PDF文件第77页浏览型号ATMEGA8-16AI的Datasheet PDF文件第79页浏览型号ATMEGA8-16AI的Datasheet PDF文件第80页浏览型号ATMEGA8-16AI的Datasheet PDF文件第81页浏览型号ATMEGA8-16AI的Datasheet PDF文件第82页  
The following code examples show how to do an atomic read of the TCNT1 Register  
contents. Reading any of the OCR1A/B or ICR1 Registers can be done by using the  
same principle.  
Assembly Code Example(1)  
TIM16_ReadTCNT1:  
; Save Global Interrupt Flag  
in r18,SREG  
; Disable interrupts  
cli  
; Read TCNT1 into r17:r16  
in r16,TCNT1L  
in r17,TCNT1H  
; Restore Global Interrupt Flag  
outSREG,r18  
ret  
C Code Example(1)  
unsigned int TIM16_ReadTCNT1( void )  
{
unsigned char sreg;  
unsigned int i;  
/* Save Global Interrupt Flag */  
sreg = SREG;  
/* Disable interrupts */  
_CLI();  
/* Read TCNT1 into i */  
i = TCNT1;  
/* Restore Global Interrupt Flag */  
SREG = sreg;  
return i;  
}
Note:  
1. The example code assumes that the part specific header file is included.  
The assembly code example returns the TCNT1 value in the r17:r16 Register pair.  
78  
ATmega8(L)  
2486M–AVR–12/03  
 复制成功!