Problems with Power modes

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by robert.palmer on Wed Oct 10 14:01:02 MST 2012
I'm using an LPC1756 and working with SLEEP mode and PowerDown mode.  I finally got it running, but still have some questions/issues.

I am currently disabling the PLL before PowerDown() mode and then re-enabling after wakeup().
I am using a GPIO2 pin to trigger the wake up.  All my ISR does is clear the interrupt

In the CMSIS2.0 lib from NXP the CLKPWR_Sleep()
- sets ONLY the LPC_SC->PCON
[INDENT] -- it does NOT CLEAR the DEEPSLEEP bit.  This means if you use a CLKPWR_PowerDown()
         and then the next time, you call CLKPWR_Sleep() you'll actually drop into DeepSleep().
        Was this an oversight or is there a specific reason it's not cleared inside this helper function?
- sets ALL bits in the LPC_SC->PCON register not just the sleep mode bits
[INDENT]   -- this includes ENABLING the BOD flags, while the DeepSleep() and PowerDown() explicitly
        DISABLE the BODG.  Why?
I looked at this thread: http://knowledgebase.nxp.com/showthread.php?t=2071

He had an issue with BOD getting set and then the chip resets, but I saw no resolution.  I'm have the same issue.  if I modify the CLKPWR_Sleep() to ONLY clear the sleep mode bits (b0, b1) and keep the BODG disabled, my code works.  However, if I use the NXP original code (LPC_SC->PCON = 0x00) as
soon as I execute this, my processor resets and the BOD flag gets set.

I thought maybe it was a lingering flag, so I made sure I cleared the BOD flag before calling CLKPWR_Sleep() this didn't help.  If I turn on the BODG (clear the bit) then I get a reset.  Is this some errata related to sleep modes? 

I have used a scope to verify that my Vdd is NOT dropping.  I'm running at 3.0V and the lowest I see it go is about 2.9V, but no where near the 2.2V to trigger BOD and the time when it does drop is AFTER the reset, during startup, not BEFORE the reset where I would expect to see it if it were actually triggering the BOD reset.


- Why does CLKPWR_Sleep() not clear the DEEPSLEEP bit?
- Why am I seeing a BOD reset when I call CLKPWR_Sleep(), specifically at the point when I set the LPC_SC->PCON register to 0x00, BEFORE the WFI instruction.