Processor: K22FN512 64-pin
Board: Custom and FRDM-K22F
IDE: KDS and Processor Expert
Problem is I am unable to wake from LPTMR when in STOP MODE.
It works fine if I use the function
Cpu_SetOperationMode(DOM_SLEEP, NULL, NULL);
Cpu_SetOperationMode(DOM_WAIT, NULL, NULL);
with DOM_STOP, it never wakes.
Clock source is 32KHz crystal (confirmed it always oscillates, even in stop)
Here are the settings for the CPU
I have set up the LLWU as well, but the interrupt is never called (even in SLEEP or WAIT)
This interrupt function gets called in DOM_SLEEP or DOM_WAIT after the LPTMR0 completes the count.
And here is the main routine that blinks LED 10 times and goes to LP mode.
* blink led 10 times
* go into low power mode
LPTMR0_CSR |= 1; //enable timer
Cpu_SetOperationMode(DOM_STOP, NULL, NULL);//works if use DOM_WAIT or DOM_SLEEP
LPTMR0_CSR &= ~1; //disable timer
Thanks for your help.