[Logo] Anarduino and HopeRF Community Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics     [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Watchdog timer  XML
Forum Index » Anarduino
Author Message
colmac



Joined: 03/06/2016 18:31:22
Messages: 1
Offline

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
Rick



Joined: 30/05/2014 22:08:56
Messages: 93
Offline

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.
 
Forum Index » Anarduino
Go to:   
Powered by JForum 2.1.9 © JForum Team