Quick easy question: I want to enable the watchdog timer on an Atmega64 in System Reset Mode, with a timeout period of 4 seconds. Can someone confirm that all I need to do for that to work is to set the WDTON fuse and define the timout period using the code below?:
// Watchdog Timer initialization // Watchdog Timer Prescaler: OSC/512k (4s timeout = longer than program execution time) #pragma optsize- WDTCR=(1<<WDCE) | (1<<WDE) | (1<<WDP2) | (0<<WDP1) | (1<<WDP0); WDTCR=(0<<WDCE) | (1<<WDE) | (1<<WDP2) | (0<<WDP1) | (1<<WDP0); #ifdef _OPTIMIZE_SIZE_ #pragma optsize+ #endif
I've read the datasheet as well as this Atmel app note:
But I still don't feel entirely clear on it, and would like to get further confirmation.