Author Topic: WDT Interrupt  (Read 4045 times)

natan

  • Newbie
  • *
  • Posts: 3
WDT Interrupt
« on: April 09, 2014, 12:52:20 pm »
any one managed to use WDT ISR instead of WDT reset?

dfarrell

  • Newbie
  • *
  • Posts: 30
Re: WDT Interrupt
« Reply #1 on: April 10, 2014, 04:44:06 pm »
I'm not sure why you would want to do this.  I think it would be pretty complicated to discover what hung some code that triggered the watchdog and especially complicated to recover.  A hard reset is not complicated at all.  Any other use I would think you could use a standard timer for.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: WDT Interrupt
« Reply #2 on: April 14, 2014, 06:03:29 am »
I'm not sure why you would want to do this.
I see several use cases for this idea:  You can store some status information into the eeprom before finally resetting the board.  That way, you have later a chance, figuring out, where your application hangs.
Right now, I have not yet figured out, if the watchdog is reentrant. In that case, the first steps in the ISR could be, resetting the counter (WDRSTT to 1) and set a flag,  indicating that the watchdog has already triggered once.
If that flag is already set (and the ISR is reentrant) you should immediately reset the board, if the flags was unset, you can do, what the ISR should do.

I will hopefully come back with a ISR solution soon.  See for WDT-Handling my other thread in the Arduino-Forum: http://forum.arduino.cc/index.php?topic=233175.0

tastewar

  • Jr. Member
  • **
  • Posts: 50
Re: WDT Interrupt
« Reply #3 on: April 16, 2014, 07:13:59 am »
...you should immediately reset the board...

How does one accomplish resetting the board?

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: WDT Interrupt
« Reply #4 on: April 16, 2014, 07:21:21 am »

tastewar

  • Jr. Member
  • **
  • Posts: 50
Re: WDT Interrupt
« Reply #5 on: April 16, 2014, 09:22:47 am »
Thanks for the reminder.