LCP4337 WAKEUP0 doesn't work

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

LCP4337 WAKEUP0 doesn't work

717 Views
lpcware
NXP Employee
NXP Employee
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
Labels (1)
0 Kudos
Reply
1 Reply

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Wed Apr 01 07:42:00 MST 2015
Hi IanMellor,

There is sample code available in our LPCOpen software platform, downloadable here:

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages

There should be a pmc_states example under the miscellaneous category. There is a known bug in software that causes the part to not wake up properly from any low power state other than Sleep mode. To fix the wake-up for Deep-sleep,call "Chip_Clock_EnableCrystal();" upon wake-up from Deep-sleep mode (you can add it on line 347 of pmc_states.c). This will be fixed in the next release of LPCOpen.
0 Kudos
Reply