Wait and Stop Mode - How to enter and exit KEA

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

Wait and Stop Mode - How to enter and exit KEA

Jump to solution
2,048 Views
kaslewis
Contributor III

Hello,

How do I enter and exit the wait and stop power modes on the KEA. I am looking to be able to go into a low or very low power mode and wait for an external interrupt, the external interrupt should wake the KEA and put it back in full power mode till the task is completed and then the KEA should go back to low power mode. I would also like to know which interrupt pin caused the KEA to wake.

Thanks

Kas

0 Kudos
1 Solution
915 Views
mjbcswitzerland
Specialist V

Kas

WAIT mode is entered by executing the Cortex WFI instruction [__asm__("wfi")]. Any interrupt will wake from this mode since peripherals and clocks remain functional.

STOP mode is entered by executing the same instruction but first setting the SLEEPDEEP bit in the Cortex SYSTEM_CONTROL_REGISTER. In the STOP mode there are various settings that can be used in the Kinetis derivative to control which clocks remain enabled  (this is part specific so you need to look through the power management section of the manual for your specific device).
In the STOP mode the KBI and IRQ pins can be used to wake-up.

Regards

Mark

View solution in original post

0 Kudos
2 Replies
915 Views
yasuhikokoumoto
Senior Contributor I

Hi Kas,


the Sleep-on-Exit mode would be the best for your solution. In this mode, the CPU always resides in WAIT mode and waking up by an interrupt to enter the correspondent ISR, and enters WAIT mode after exiting the ISR. To enable the Sleep-on-Exit mode, you first set SCR.SLEEPONEXIT=1 and by executing WFI instruction to enter the Sleep-on-Exit mode. Regarding the Sleep-on-Exit, please refer to the article  http://my.safaribooksonline.com/book/electrical-engineering/computer-engineering/9780123854773/chapt....
As for the interrupt, you can choose one of the 16 keyboard interrupts (if KEA128 then 64) and an IRQ (PTA5).


Best regards,
Yasuhiko Koumoto.

0 Kudos
916 Views
mjbcswitzerland
Specialist V

Kas

WAIT mode is entered by executing the Cortex WFI instruction [__asm__("wfi")]. Any interrupt will wake from this mode since peripherals and clocks remain functional.

STOP mode is entered by executing the same instruction but first setting the SLEEPDEEP bit in the Cortex SYSTEM_CONTROL_REGISTER. In the STOP mode there are various settings that can be used in the Kinetis derivative to control which clocks remain enabled  (this is part specific so you need to look through the power management section of the manual for your specific device).
In the STOP mode the KBI and IRQ pins can be used to wake-up.

Regards

Mark

0 Kudos