AnsweredAssumed Answered

Watchdog reset event from NMI ISR on BF518

Question asked by climb2him on Mar 18, 2010
Latest reply on Mar 18, 2010 by pburkert



If I set the watchdog timer to generate a non-maskable interrupt (NMI), then a watchdog event occurs sending the program counter into the NMI interrupt service routine (ISR), then, from within this ISR, change the settings of the watchdog timer such that it has a new count value, the count starts over, and it will generate a reset event (rather than another NMI event) if it expires again?  If the watchdog timer expires in this NMI, again, will it force the reset?


In my application, I use the watchdog timer to generate an NMI if it expires.  Within the NMI ISR, I use the SPI port (using a polling method) to write current context parameters (the values of vital program control variables) to an external EEPROM, then I generate a software reset with the raise(1) function. I am concerned in this scenario that the processor may hang somehow while waiting for a write to complete to the EEPROM.  I would like to re-use the watchdog timer to avoid this possible scenario and force the reset, even if the context parameters weren't saved to EEPROM, correctly. This is preferred to just hanging in an infinite loop.