Hi Kerry,
Yes the RTC_EN in ENABLED so yesterday after debugging several times the misc_pmc_states project, I found a partial solution to wake up from deep sleep and deep power down mode using the RTC.
I had to modify the misc_pmc_states project and the solution is to add a delay of more than 1 second after the RTC alarm is configured and the RTC is enabled.
This code to configure the RTC to wake up from deep sleep is not working:
case '2':
DEBUGSTR("Entering 'Deep Sleep' state ...\r\n");
if (Wake_RTC) {
DEBUGOUT("Wait for %d seconds, RTC alarm will wake up from 'Deep Sleep' mode \r\n", RTC_ALARM_TIME);
Chip_RTC_Enable(LPC_RTC, ENABLE);
}
else {
DEBUGSTR("Press WAKEUP0 button/Connect WAKEUP0 pin to 3.3V to exit 'Deep Sleep' mode \r\n");
}
Pwr_state = PMC_DeepSleep;
/* Call Pre SleepPowerDown function */
PMC_Pre_SleepPowerDown();
/* Goto Deep Sleep mode */
Chip_PMC_Set_PwrState(Pwr_state);
/* Call Post Wake up Initialisation function */
PMC_Post_Wakeup(buffer);
DEBUGSTR("\r\nWoken up \r\n");
break;
After the Chip_RTC_Enable(LPC_RTC, ENABLE); there has to be a delay before entering the deep sleep.
Now, I am able to wake up from Deep Sleep and Deep Power Down correctly but from Power Down I am only wake up but using the same PMC_Post_Wakeup(buffer); is not able to reconfigure correctly the system. I have to see why I have this issue only in Power Down!
Regards,
Daniel