deep sleep mode issue

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Mar 8, 2017 by Daniel Toma
Content originally posted in LPCWare by jpplus on Thu May 07 23:36:24 MST 2015
I am trying to put my 4337 into deep sleep mode and I start from the LPCopen's example of pmc_states.c (using 2.16 version from lpcopen for 4337)
when I put my board to deep sleep, it simply shuts down itself. I have serveral quesitons related to this example and general deep sleep mode.
1) I don't see __WFI() or Chip_PMC_Sleep(); be called in this example which contradicts with the data sheet.   Does this example really working?  I read a thread saying this example has bug, but need fix in latest one, but not sure 2.16 contains this fix.
2) hardware control of deep-sleep mode, I put below code and WFI(), but MCU never wake up when I trigger wakeup pin 0.  Do the hardware control of deep sleep also require all clock shutdown/off. still need enable the event router?
   LPC_PMC->PD0_SLEEP0_HW_ENA = 0x01; //M4 core
   LPC_PMC->PD0_SLEEP0_MODE = 0x003000AA;//deep sleep
   SCB->SCR = 0x04; // Set SLEEPDEEP to 1
   LPC_EVENTROUTER->SET_EN = 0xf;//wakeup pin 0-3 to wakeup
3) any working example/reference about the deep sleep mode except the pmc_states.c?