Content originally posted in LPCWare by robert.palmer on Mon Oct 15 07:42:15 MST 2012
Yes, I have seen that App Note. However, I have not tried running the code on a demo board.
Yes, clearing the SLEEPDEEP bit after waking up (this applies to DeepSleep, PowerDown AND DeepPowerDown) would be a reasonable alternative, but I think making sure it is clear before attempting sleep is also necessary - the function call wrapper is called CLKPWR_Sleep(), symantically, this should ensure that ONLY Sleep mode is entered, which means it should ensure that the SLEEPDEEP bit is not set.
Yes, I thought about the BORD bit in the RSID being the problem, therefore, immediately before the CLKPWR_Sleep(), I have a test to see if the BODR bit is set and if it IS set, I do two things:
1. clear it
2. generate a debug trace so I can see if it is ever set at this point.
I also test the BORD bit immediately after waking from PowerDown (or DeepSleep depending on the mode I'm testing) and it is NOT set after waking from PowerDown (or DeepSleep).
It makes no sense why I am getting a Brown-Out reset, but it also appears that I'm not the only one that's run into this issue.
Why is the default for DeepSleep and PowerDown to SET the BOGD (disabling the Brown-Out reset)?
Based on my testing, the BODR bit in the RSID reg is never ON.