Content originally posted in LPCWare by mhjerde on Tue Dec 11 07:01:43 MST 2012 Hi I have this weird behavior where I can put the mcu in sleep and wake it up with an interrupt on P2.10. But if I put it in deep sleep, it won't wake up. The MCU is an LPC1756.
The only code change is adding the line
SCB->SCR = 0x4;
So this works:
LPC_SC->PCON = 0x00;
__WFI();
But it wont wake up after this:
SCB->SCR = 0x4;
LPC_SC->PCON = 0x00;
__WFI();
The code immediately following __WFI() restarts the MCU:
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);// Initialize WDT, IRC OSC, interrupt mode
WDT_Start(500000);// restart time in us (sec/1000000)
while(1); //infinite loop to wait chip reset from WDT
Any suggestions? If I assume the interrupt fires, so maybe the error is in the WDC restart code? Morten