I'm having trouble getting the reset part of the Watchdog timer to happen.
The Watchdog timer is triggering and going into the ISR(WDT_vect) function where I increment a byte in EEPROM (which happens) but nothing happens after that, it never gets to setup().
The same sketch works on a uno, Mega 2560 and moteino boards but not on Anarduino.
I compile and load the sketch as "Arduino Duemilanove or Diecimila" / "ATmega328" using Arduino version 1.6.5
Watchdog setup:
cli(); // disable all interrupts
wdt_reset(); // reset the WDT timer
/*
WDTCSR configuration:
WDIE = 1: Interrupt Enable
WDE = 1 :Reset Enable
WDP3 = 0 :For 2s Time-out
WDP2 = 1 :For 2s Time-out
WDP1 = 1 :For 2s Time-out
WDP0 = 1 :For 2s Time-out
*/
// Enter Watchdog Configuration mode:
WDTCSR |= (1<<WDCE) | (1<<WDE);
// Set Watchdog settings:
WDTCSR = (1<<WDIE) | (1<<WDE) | (0<<WDP3) | (1<<WDP2) | (1<<WDP1) | (1<<WDP0);
sei();
Is there something different I need to do to get it working on the Anarduino?
Thanks Colin
|