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 */
- 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 22.214.171.124, there is a lot more to putting an MCU to deep sleep.
- What I need now is to wake the MCU back up. Can anyone help me with some pointers to sample codes?
- 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.