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

ATMEGA16M1-15MZ 参数 Datasheet PDF下载

ATMEGA16M1-15MZ图片预览
型号: ATMEGA16M1-15MZ
PDF下载: 下载PDF文件 查看货源
内容描述: [IC MCU 8BIT 16KB FLASH 32QFN]
分类和应用: 微控制器
文件页数/大小: 318 页 / 7595 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第40页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第41页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第42页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第43页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第45页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第46页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第47页浏览型号ATMEGA16M1-15MZ的Datasheet PDF文件第48页  
The following code example shows one assembly and one C function for turning off the Watchdog Timer. The example  
assumes that interrupts are controlled (e.g. by disabling interrupts globally) so that no interrupts will occur during the  
execution of these functions.  
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  
r16, MCUSR  
; Write logical one to WDCE and WDE  
; Keep old prescaler setting to prevent unintentional time-out  
lds r16, WDTCSR  
ori  
r16, (1<<WDCE) | (1<<WDE)  
sts WDTCSR, r16  
; Turn off WDT  
ldi  
r16, (0<<WDE)  
sts 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();  
}
Notes: 1. The example code assumes that the part specific header file is included.  
2. 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 initialization routine, even if the  
watchdog is not in use.  
44  
ATmega16/32/64/M1/C1 [DATASHEET]  
7647O–AVR–01/15  
 复制成功!