Kinetis sleep enable/disable

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

Kinetis sleep enable/disable

Jump to solution
1,664 Views
martindusek
Contributor V

Hello,

is there any HW control of sleep mode enable/disable in Kinetis K MCUs? I can see SMC->PMPROT register, but it is writable only once after reset.

Using a variable, setting it true or false and then checking before sleep mode entry is not an option as there is a need to disable sleep mode when an asynchronous (interrupt) event occurs.

Labels (1)
Tags (1)
1 Solution
1,337 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Martin,

Thanks for the clarification! Kinetis devices execute the "WFI" instruction to enter low power modes, but WFI is a conditional instruction, so you may define a macro for this instruction with a condition, and change the condition to FAIL in the ISR which happens right before this intruction, so that this instruction does not execute at all in such case. Please kindly refer to the following for more details.

1.png

2.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
1,337 Views
martindusek
Contributor V

Hello,

sorry not to be more specific.

Yes I want to disable sleep mode in ISR which can occur just before sleep mode entry instruction. I think only HW based sleep mode disable can handle this.

0 Kudos
Reply
1,338 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Martin,

Thanks for the clarification! Kinetis devices execute the "WFI" instruction to enter low power modes, but WFI is a conditional instruction, so you may define a macro for this instruction with a condition, and change the condition to FAIL in the ISR which happens right before this intruction, so that this instruction does not execute at all in such case. Please kindly refer to the following for more details.

1.png

2.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,337 Views
miduo
NXP Employee
NXP Employee

Hi,

I am not quite understand what you really would like to do? Why  "here is a need to disable sleep mode when an asynchronous (interrupt) event occurs."? If more information provide, it will much helpful.

0 Kudos
Reply