LPC1549: DEEP_SLEEP and Wake-up on triggers received in UART

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

LPC1549: DEEP_SLEEP and Wake-up on triggers received in UART

805 Views
adutta
Contributor I

Hello,

I am working on LPC1549 and want to put the controller into DEEP_SLEEP mode when desired based on few conditions and monitor the UART for wake-up trigger. It should also be simultaneously monitoring an ADC channel for voltage samples and wake up if the voltage for a few consecutive samples is beyond a certain set threshold value.

I have found LPCOpen example that should be putting MCU to deep sleep mode. Below I am copying the sample code,

/* Enter MCU Deep Sleep mode */
void Chip_PMU_DeepSleepState(LPC_PMU_T *pPMU)
{
Chip_PMU_ClearSleepFlags(LPC_PMU, PMU_PCON_SLEEPFLAG | PMU_PCON_DPDFLAG);
SCB->SCR |= (1UL << SCB_SCR_SLEEPDEEP_Pos);
/* Enter deep sleep mode */
__WFI();
}

  1. Is the above piece of code sufficient to put the MCU to deep sleep?
    As mentioned in the UM10736 - LPC15xx User manual(https://www.nxp.com/docs/en/user-guide/UM10736.pdf) section 4.7.4.2, there is a lot more to putting an MCU to deep sleep.
  2. What I need now is to wake the MCU back up. Can anyone help me with some pointers to sample codes?
  3. Through the cycle of wake-up and sleep, UART and ADC should remain active.

Any directions will be highly appreciated.  I've been fighting this for quite some time now. Am trying my hands on LPC controllers for the first time. Hope to receive quick and helpful response from NXP community.

Thanks,

Archita

Labels (2)
0 Kudos
3 Replies

636 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Archita Dutta,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Q1) Is the above piece of code sufficient to put the MCU to deep sleep?
-- Yes, however, the MCU won't be wake-up if just using the function.
Q2) What I need now is to wake the MCU back up. Can anyone help me with some pointers to sample codes?
-- To provide the fastest possible support, I'd highly recommend you to refer to the PMU demo in the LPCOpen library, it demonstrates power state change using the RTC timer to wake-up the MCU from the following low power states, SLEEP, DEEP SLEEP, POWER DOWN,
and DEEP POWER DOWN.
Have a great day,
TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

636 Views
adutta
Contributor I

Hi jeremyzhou ,

Thank you for your response. I appreciate your help but I am looking for wake-up from deep sleep mode on reception of signals from the UART. I understand the timer based wake-up from sleep but, I need examples for UART trigger activity. Reading the user manual gives me a sense that we need to keep the wake-up sources enabled (that in my case should be UART peripheral) when programming it to deep sleep mode.

Can you kindly help me with your further guidance.

Thanks,

Archita

0 Kudos

636 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Archita Dutta,

Thanks for your reply.
There's no similar demo as you want in the LPCOpen library, it needs the developers to create it by himself, however, in the RM, 24.3.2 Configure the USART for wake-up illustrates how to implement it, so please give a try and If you encounter any troubles, just feel free to contact me.
Have a great day,
TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos