欢迎访问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文件第50页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第51页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第52页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第53页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第55页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第56页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第57页浏览型号ATMEGA16U2-MUR的Datasheet PDF文件第58页  
ATmega8U2/16U2/32U2  
Assembly Code Example(1)  
WDT_off:  
; Turn off global interrupt  
cli  
; Reset Watchdog Timer  
wdr  
; Clear WDRF in MCUSR  
in  
andi r16, (0xff & (0<<WDRF))  
out MCUSR, r16  
; Write logical one to WDCE and WDE  
; Keep old prescaler setting to prevent unintentional time-out  
r16, MCUSR  
in  
r16, WDTCSR  
ori  
out  
r16, (1<<WDCE) | (1<<WDE)  
WDTCSR, r16  
; Turn off WDT  
ldi  
out  
r16, (0<<WDE)  
WDTCSR, r16  
; Turn on global interrupt  
sei  
ret  
C Code Example(1)  
void WDT_off(void)  
{
__disable_interrupt();  
__watchdog_reset();  
/* Clear WDRF in MCUSR */  
MCUSR &= ~(1<<WDRF);  
/* Write logical one to WDCE and WDE */  
/* Keep old prescaler setting to prevent unintentional time-out */  
WDTCSR |= (1<<WDCE) | (1<<WDE);  
/* Turn off WDT */  
WDTCSR = 0x00;  
__enable_interrupt();  
}
Note:  
1. The example code assumes that the part specific header file is included.  
Note: If the Watchdog is accidentally enabled, for example by a runaway pointer or brown-out  
condition, the device will be reset and the Watchdog Timer will stay enabled. If the code is not  
set up to handle the Watchdog, this might lead to an eternal loop of time-out resets. To avoid this  
situation, the application software should always clear the Watchdog System Reset Flag  
(WDRF) and the WDE control bit in the initialisation routine, even if the Watchdog is not in use.  
The following code example shows one assembly and one C function for changing the time-out  
value of the Watchdog Timer.  
54  
7799D–AVR–11/10  
 复制成功!