How to reliably wake K24F from VLPS mode with GPIO edge?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to reliably wake K24F from VLPS mode with GPIO edge?

513 Views
ashesman
Contributor III

Hi,

I am am having some trouble using external falling edge interrupt to wake my K24F from VLPS mode.  I believe my code is correct and it works exactly as expected IF the pin state is high when the device enters stop mode.  However, if the device enters stop mode with the pin level low, a falling edge is never detected and it is stuck in stop mode forever! 

It looks like the pin level is captured before entering stop mode and used as a reference for edge detection.  Using low level interrupt provides exactly the same behavior!  Interestingly, either edge interrupt mode also has exactly the same behavior.  The only wak I can get a wakeup interrupt is if my pin level is high when entering stop mode.  If pin level is low on stop mode entry, it will never wake. 

I have confirmed pin state is changing on a scope while in stop mode.  I have also tried using and pins digital filter falling edge mode with LPO clock, but no better.

HELP!!!!

Labels (1)
0 Kudos
1 Reply

443 Views
ashesman
Contributor III

Please disregard.  After further testing I have discovered the issue was caused by the interrupt occurring before the device went into stop mode.  As the interrupt handler assumes that it only occurs on exit of stop mode it disables the interrupt.  So interrupt was disabled on entry to stop mode if it occurred just before entering stop mode meaning that it could never occur in stop mode.