lpcware

LCP4337 WAKEUP0 doesn't work

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by IanMellor on Wed Apr 01 02:26:07 MST 2015
Hi,

I'm trying to put my LPC4337 into deep sleep but it won't wake up when I bring the WAKEUP0 line
low. Here is my code:

        sleep = os_suspend();                                                       // Suspend
RTX thread scheduler

        //TODO: Try to get lower power mode (see below)

        LPC_PMC->PD0_SLEEP0_HW_ENA = 0x01;                                          //
Select M4 core
        LPC_PMC->PD0_SLEEP0_MODE = 0x003000AA;                                     
        SCB->SCR = 0x04;                                                            // Set
SLEEPDEEP
        LPC_EVENTROUTER->CLR_STAT = EVENTROUTER_CLR_STAT_WAKEUP0_CLRST_Msk;
        LPC_EVENTROUTER->SET_EN = EVENTROUTER_SET_EN_WAKEUP0_SETEN_Msk;

        __WFI();                                                                    // Enter
Power-down mode

        io_control(LED303, OFF);       
        os_resume(sleep);                                                           // Resume
RTX thread scheduler       

The documentation states:

Remark: Before entering Deep-sleep mode, program the CGU as follows:
• Switch the clock source of all base clocks to the IRC.
• Put the PLLs in power-down mode.

How do I go about doing this?
Is there any example code?

Thanks

Ian

Outcomes