I am going through datasheet of AVR2560V. In page 65 , table 12-1, it says that AVR2560 has 3 mode for watchdog
Interrupt mode - WDE = 0, WDIE = 1
Reset Mode - WDE = 1, WDIE = 0
Both - WDE = 1, WDIE = 1
This means if we want to use watchdog timer as source of Interrupt, then i should disable WDE. Am i right? Because when i disabling WDE in code, Watchdog timer is getting disabled.I had look at this link also and even he is doing the same. WDE
make sense that it need to be enabled, just that table in the datasheet is confusing me. Can anyone please help me in clearing out this doubt.
Below is the Watchdog_init function which i am using.
Watchdog_init(){
MCUSR &= ~(1<<WDRF);
WDTCSR |= (1<<WDCE) | (1<<WDE); // as per datasheet WDE should be 0?
// timeout in 8 second
WDTCSR = 1<<WDP0 | 1<<WDP3;
// watchdog interrupt enabler
WDTCSR |= _BV(WDIE);
}