AnsweredAssumed Answered

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

Question asked by Archita Dutta on May 10, 2019
Latest reply on May 13, 2019 by jeremyzhou

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

Outcomes