LPC4337 wakeup from deep sleep and power down using RTC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4337 wakeup from deep sleep and power down using RTC

1,534 Views
danieltoma
Contributor I

I am trying to use the RTC alarm to wake up my 4337, from the LPCXpresso4337 board, from deep sleep or power down mode mode and I start from the LPCopen's example of pmc_states.c (using 2.20 version from lpcopen for 4337)

To make sure RTC alarm is triggered I am putting ON one LED in the interrupt. The VBAT pin stays at 3.0V all the time and I put debug to check if RTC is enabling or not, everything works fine. If I put my 43537 in deep sleep mode or power down and choose to wake up from RTC alarm event interrupt I never get RTC alarm interrupt.

If I chose the WAKE button as wake up signal it works but not with RTC!

Can anyone tell what I am doing wrong or any help about how to check power of RTC domain once the core is deep power down.

Thanks,

Daniel

Labels (2)
0 Kudos
Reply
3 Replies

1,037 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Daniel Toma,

   LPC4337 support the RTC wake up the deep sleep and power down mode.

Did you enable the RTC_EN in ENABLE register? Please check it!

pastedImage_1.png

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,037 Views
danieltoma
Contributor I

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

0 Kudos
Reply

1,037 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Daniel Toma,

      If I download the misc_pmc_states project directly to my LPCXpress lpc4337 board, and use the RTC to wakeup directly, I also meet your problem, can't wakeup. I will report this lpcopen code problem to our according department.

    But, just as you said, if I add some delay after the :Chip_ATIMER_IntEnable(LPC_ATIMER); like this:

45.jpg

 

After testing, the power down can wake up, this is the test result:

46.jpg

The following printf is OK, it means, the clock configuration still correct.

Now, you said, your Power Down is not able to reconfigure correctly the system, could you give me more details about it?

What is the not correct phenomena?

 

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply