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

AT90PWM3B-16SU 参数 Datasheet PDF下载

AT90PWM3B-16SU图片预览
型号: AT90PWM3B-16SU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器具有8K字节的系统内可编程闪存 [8-bit Microcontroller with 8K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 361 页 / 6022 K
品牌: ATMEL [ ATMEL ]
 浏览型号AT90PWM3B-16SU的Datasheet PDF文件第102页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第103页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第104页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第105页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第107页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第108页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第109页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第110页  
The following code examples show how to do an atomic read of the TCNTn Register contents.  
Reading any of the OCRnx or ICRn Registers can be done by using the same principle.  
TABLE 4.  
Assembly Code Example(1)  
TIM16_ReadTCNTn:  
; Save global interrupt flag  
in r18,SREG  
; Disable interrupts  
cli  
; Read TCNTn into r17:r16  
in r16,TCNTnL  
in r17,TCNTnH  
; Restore global interrupt flag  
outSREG,r18  
ret  
C Code Example(1)  
unsigned int TIM16_ReadTCNTn( void )  
{
unsigned char sreg;  
unsigned int i;  
/* Save global interrupt flag */  
sreg = SREG;  
/* Disable interrupts */  
_CLI();  
/* Read TCNTn into i */  
i = TCNTn;  
/* Restore global interrupt flag */  
SREG = sreg;  
return i;  
}
Note:  
1. The example code assumes that the part specific header file is included.  
For I/O Registers located in extended I/O map, “IN”, “OUT”, “SBIS”, “SBIC”, “CBI”, and “SBI”  
instructions must be replaced with instructions that allow access to extended I/O. Typically  
“LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and “CBR”.  
The assembly code example returns the TCNTn value in the r17:r16 register pair.  
106  
AT90PWM2/3/2B/3B  
4317J–AVR–08/10  
 复制成功!