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

ATMEGA2560 参数 Datasheet PDF下载

ATMEGA2560图片预览
型号: ATMEGA2560
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器与256K字节的系统内可编程闪存 [8- BIT Microcontroller with 256K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 407 页 / 2985 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA2560的Datasheet PDF文件第61页浏览型号ATMEGA2560的Datasheet PDF文件第62页浏览型号ATMEGA2560的Datasheet PDF文件第63页浏览型号ATMEGA2560的Datasheet PDF文件第64页浏览型号ATMEGA2560的Datasheet PDF文件第66页浏览型号ATMEGA2560的Datasheet PDF文件第67页浏览型号ATMEGA2560的Datasheet PDF文件第68页浏览型号ATMEGA2560的Datasheet PDF文件第69页  
ATmega640/1280/1281/2560/2561  
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  
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 rou-  
tine, even if the Watchdog is not in use.  
65  
2549A–AVR–03/05  
 复制成功!