Hi,
I got a problem when I was using watchdog interrupt to periodically wake up (every 1 second) from Standby mode. After 6 cycles of wake-up and sleep, it won't go back to sleep for another 6 cycles and then get into the right wake-up and sleep cycle again, this phenomenon continues.
I tried to track the watchdog SCSR and WDCR registers inside the Wakeup_ISR right after wake-up. It seems that after 6 cycles, the SCSR is 7 instead of 3, which indicates than the WDINTS bit is 1.
I already tried to reset the watchdog counter as more as possible and wait for the WDINTS = 1 before getting into sleep again.
Part of the code:
while(sleep_ind)
{
KickDog();
gotoSleep();
wakeUp();
delayTime(1); // delay for 1 seconds kickdog inside
}
interrupt void WAKE_ISR(void)
{
KickDog();
WakeCount++;
PieCtrlRegs.PIEACK.bit.ACK1 = 1;
}
void wakeUp(void)
{
// Wait for SCSR.WDINTS = 1
while(!(SysCtrlRegs.SCSR & BIT(2))){
KickDog();
}
powerFlash();
KickDog();
}
Thank you very much!