This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28M36P63C2: TRM implies when all flags are cleared the NMI Wacthdog Timer will stop counting and not reset the system but this doesn't happen unless you exit the NMI ISR

Part Number: F28M36P63C2

As part of our system safety I wanted to enter a "protected mode" on critical issues. For this I wanted to provide an infinite while loop (which blinks a Led within the NMI handler) for some NMI entry conditions. But even if all flags are initially reset within the NMI ISR, the NMI Watchdog always resets the system. I haven't found a way to prevent reset before existing the NMI ISR. The TRM indicates that clearing the flags is the only condition, but the condition appears to be clearing the flags and exiting the ISR. Is there a way to achieve what I want (stopping the NMI Watchdog Timer) from within the NMI ISR?

  • Bradford,

    Clearing all latched NMI error flag conditions in your NMI ISR will stop the NMI watchdog counter and reset it.  But, it any new error condition are latched then it will restart the counter.  Check to see if a new error condition is occurring while in your ISR.  You should clear the NMI interrupt flag and clear all flags together.  Be sure to clear the pending FAIL flag first and then clear the NMIINT flag.  Also, note that hardware has priority.  That is, if the hardware is trying to set a bit at the same time you are trying to clear the bit, the hardware action will take effect.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken

  • The TRM is correct clearing all the flags will stop the NMI Watchdog Timer. My problem was that the M3 standard Watchdog Timer0 was also set reset the system. This was the origin of my reset. So for those debugging the NMI be sure the standard watchdog is disabled to avoid being confused like me. ;) Thank you Ken.