Qdatasheet_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

ATMEGA32 View Datasheet(PDF) - Atmel Corporation

Part Name
Description
MFG CO.
'ATMEGA32' PDF : 346 Pages View PDF
ATmega32(L)
The following code example shows one assembly and one C function for turning off the
WDT. The example assumes that interrupts are controlled (for example by disabling
interrupts globally) so that no interrupts will occur during execution of these functions.
Assembly Code Example
WDT_off:
; reset WDT
wdr
; Write logical one to WDTOE and WDE
in r16, WDTCR
ori r16, (1<<WDTOE)|(1<<WDE)
out WDTCR, r16
; Turn off WDT
ldi r16, (0<<WDE)
out WDTCR, r16
ret
C Code Example
void WDT_off(void)
{
/* reset WDT */
_WDR();
/* Write logical one to WDTOE and WDE */
WDTCR |= (1<<WDTOE) | (1<<WDE);
/* Turn off WDT */
WDTCR = 0x00;
}
43
2503J–AVR–10/06
Share Link: GO URL

All Rights Reserved © qdatasheet.com  [ Privacy Policy ] [ Contact Us ]