Hello, this might belong here.
I'd like to use watchdog timer interrupt for 8sec/1sec timebase. The problem is when I config the watchdog for 1sec timer (after it was running for some time on 8sec without any issue) it goes crazy. Here is my watchdog setting.
//watchdog setting
MCUSR = 0; // clear various "reset" flags
if ( warningActive == false )
{
WDTCSR = bit (WDCE) | bit (WDE); // allow changes, disable reset
// set interrupt mode and an interval
WDTCSR = bit (WDIE) | bit (WDP3) | bit (WDP0); // set WDIE, and 8 seconds delay
}
else
{
WDTCSR = bit (WDCE) | bit (WDE); // allow changes, disable reset
// set interrupt mode and an interval
WDTCSR = bit (WDIE) | bit (WDP2) | bit (WDP1); // set WDIE, and 1024 ms delay
}
wdt_reset(); // pat the dog
So when warningActive = true, I'd like to use 1024 ms delay, but instead of that, I get far more often watchdog interrupts. Should I configure it differently under "else" branch?
Thanks in advance.