Anarduino and HopeRF Community Forum
Back to home page
Joined: 03/06/2016 18:31:22
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
cli(); // disable all interrupts
wdt_reset(); // reset the WDT timer
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);
Is there something different I need to do to get it working on the Anarduino?
Joined: 30/05/2014 22:08:56
Actually, it's just a typical Arduino compatible, so it should behave the same in this regard as other ATmega328-based units.
Were you able to find resolution? If so, please post a response so others may benefit.
Select a forum