Watchdog and Wake Up from Deep Sleep LPC11Uxx

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by SimonWakley on Fri Aug 07 20:57:36 MST 2015

I have seen quite a few posts about waking up the LPC11xx and many of the use a STARTRSRP0CLR address, but that is not present on the LPC11U apparently. I have been trying to get the watchdog to wake up my device, but I can't seem to get it to work as expected.  It will run and generate the interrupt, but it is not causing my main loop to progress past the __WFI().  I have tried setting the SLEEPONEXIT bit both ways to no avail.

Does anyone have working code for the LPC11Uxx to wake itself up (actually it is an LPC11U24) either using the watchdog or using an internal counter timer. DEEPSLEEP is my first power down level target.

Does anyone have an idea that __WFI() doesn't wake up on the watchdog interrupt.  Strangely if I run BOTH the systick timer and the watchdog warning interrupt, then the WFI wakes up more frequently than either of the interrupts, so the watchdog DOES seem to cause it to WFI when the systick is ALSO running, but not when it isn't. Confusing.

I can put into into DEEPSLEEP and after a few times almost bricking it, I have got it to wake up from DEEPSLEEP, but it apparently also resets the chip which DOESN'T happen if I just use the watchdog in SLEEP mode. I have set that bit (WDRESET) correctly too I believe but it seems to behave differently waking from a SLEEP and a DEEPSLEEP.

I am using the WARNINT interrupt, so I guess it goes off shortly before the Watchdog goes off. Maybe there is a timing issue with that and the chip doesn't wake up fast enough to feed the Watchdog before it really triggers.??