AnsweredAssumed Answered

Watchdog interrupt to prevent blocks in PITimer interruption

Question asked by Inaki Alonso on Mar 5, 2019
Latest reply on Mar 6, 2019 by Inaki Alonso



I am trying to configure the watchdog of MPC5643L in order to prevent any block in my application, but I want to execute a part of code before doing a reset of the microcontroller.


For that, I enable the interruption of the watchdog:

      SWT.CR.R = 0x80000149;
         /* Master Access Control for Master 0: Enabled */
         /* Service Sequence : Fixed Service Sequence */
         /* SWT Reset on Invalid Access: Enabled */
         /* SWT Window Mode: Disabled */
         /* SWT Interrupt then Reset: Enabled */
         /* SWT Hard Lock: Disabled */
         /* SWT Soft Lock: Disabled */
         /* SWT Clock Source Selected: 16MHz IRC */
         /* SWT Stop Mode Control: Disabled */
         /* SWT Debug Mode Control: Disabled */
         /* Software Watchdog Timer: Enabled */


and I install the interruption of watchdog:
   INTC_InstallINTCInterruptHandler(&Watchdog_reset, 28, 15);

I have also installed the interruption of the PITimer:
   INTC_InstallINTCInterruptHandler(&PITimer_tick, 59, 5);


Watchdog's interruption has a higher priority than PITimer's priority.


To check this solution I write intentionally a "while(1);" in different parts of my code. It works properly in all of them, but no in the PITimer_tick function (the PITimer's interruption).


How can I assure that Watchdog interruption will be executed in case of any lock?

Thanks in advance,