I'm wondering if someone knows how to change the prescaler on the watchdog timer enabled as an interrupt?
So far I have been successful enabling the WDT as an interrupt but I can't get the Prescaler to work.
I'm trying to make the WDT interrupt every 1 second so I can make a 24 hr clock with it. In the reference manual it says you can prescale it down to 1 second by setting 1<<WDP2 and 1<<WDP1, but it seems as tho it has no prescaler at all.
Here is a portion of my code so far:
void setup()
{
cli(); // stop interrupts
WDTCSR = (1<<WDCE); // watchdog change enable
WDTCSR = (0<<WDP3)|(1<<WDP2) | (1<<WDP1); // set
//prescaler to 1 second
WDTCSR = (1<<WDIE) | (0<<WDE); // enable wdt interrupt
sei(); // start interrupts
}
/WDT interrupt/
ISR(WDT_vect)
{
}
ANY HELP WOULD BE GREATLY APPRECIATED!!