Kinetis sleep enable/disable

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Kinetis sleep enable/disable

跳至解决方案
1,103 次查看
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.

标签 (1)
标记 (1)
1 解答
776 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

3 回复数
776 次查看
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 项奖励
回复
777 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

776 次查看
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 项奖励
回复