Hello,
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,
Iñaki
解決済! 解決策の投稿を見る。
Hi,
most probably you do not allow interrupt nesting, in such case interrrupts are disabled during ISR execution and ISR cannot be affected by interrupt with higher priority. With interrupt nesting allowed the interrupt handler contains necessary prolog and epilog and interrupts are enabled during prolog allowing interrupt with higher priority to be called immediately.
So check your IVOR4 handler.
BR, Petr
Hi,
most probably you do not allow interrupt nesting, in such case interrrupts are disabled during ISR execution and ISR cannot be affected by interrupt with higher priority. With interrupt nesting allowed the interrupt handler contains necessary prolog and epilog and interrupts are enabled during prolog allowing interrupt with higher priority to be called immediately.
So check your IVOR4 handler.
BR, Petr
Thank you so much Petr.
I supposed that the problem was related with the disabling of ISR, but I didn't know how to enable them. Thanks to your help I was be able to solve my problem and now everything works properly.
Regards,
Iñaki