Hi,
I'm adding a watchdog to an old program.
Attached are my watchdog program and delay program (sleep will enter power dwon mode).
When I use the following equation, the watchdog reset can be triggered normally and booted successfully.
WatchDog_Init();
Delay_Delay1ms(6000);
But when I use the following equation, the reboot procedure cannot be completed.
WatchDog_Init();
Delay_Sleep1ms(6000);
Hi,
Do you say that the LPC802 hangs when it enters power-down mode even if the watchdog reset event happens?
Anyway, pls configure to use the FRO as the main clock before you enter power-down mode.
If you still have issue, pls post your project and describes your issue clearly so that we can duplicate your issue.
Hope it can help you
BR
XiangJun Rong
I have simplified the program as shown in the attachment. MAINCLKSEL has been set at the beginning of the program (and will not be changed).
When booting, pwm will be output on gpio 9.
When I use Delay_Delay1ms(6000); in Source/source/Main.c; watchdog can operate normally and boot normally.
When I use Delay_Sleep1ms(6000) in Source/source/Main.c; the watchdog should be triggered, but it cannot boot normally (no PWM output).
Hi,
Regarding your question, we have the power_mode_switch example in SDK, pls download SDK package from the link:
For your issue, it appears that you use WKT to wake-up LPC802 from power-down mode, so pls check the WKT counter in debugger and check if the counter changes with time.
void Delay_Sleep1ms(int _1ms) {
#ifdef _DEBUG
Delay_Delay1ms(_1ms);
#else
LPC_WKT->CTRL &= ~(0x08 | 0x01);
LPC_WKT->CTRL |= (((uint32_t)(((uint32_t)(LOW_POWER_OSC)) << WKT_CLKSEL)) & 0x01);
LPC_WKT->COUNT = _1ms * 1000;
Delay_PowerDown(true);
WKT_INT = false;
#endif
}
It appears that you do not set SYSCON->SYSAHBCLKCTRL0|=1<<9;
Hope it can help you
BR
XiangJun Rong
Hi @xiangjun_rong ,
Did you misunderstand my question?
My question is that in power down mode, watchdog reset cannot perform reset correctly.
"SYSCON->SYSAHBCLKCTRL0|=1<<9;" has been used in Delay_Init. I also confirmed that Delay_Sleep1ms can enter power down mode and exit at the time I specify.
Delay_Sleep1ms(6000); in the program is intended to test the watchdog reset under power down (watchdog reset is set to 2s).