Wakeup with different interrupt sources

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

Wakeup with different interrupt sources

跳至解决方案
1,512 次查看
simonwyss
Contributor III

I have enabled multiple interrupt sources to wakeup my LPC54102 from sleep, deep-sleep and power-down mode.

In the main loop I power down the microcontroller. What happens, if an interrupt fires, while the power-down instructions are executed?

main: I switch the main clock to 32kHz RTC bevor powering down. (Is this necessary? I want to wakeup from RTC and PININT)
Interrupt (PININT): fires, switches main clock back to IRC, handle data, finishes
main: power down (RTC no longer the main clock source, since switched back to IRC in interrupt)

Is this a problem?
I think not, but my microcontroller sometimes got frozen up with 696uA. Doing nothing, can not attach debugger.

The error happens very rarely. In time intervals of some minutes to some hours.

I think it is no option, to set only a flag in the interrupt routine and handle the flag in the main loop. Because if the CPU is powering down while the interrupt happens, the flag will be handled only the next time, the CPU wakes up. However, the flag should force code to be executed immediately!

标签 (3)
1 解答
1,287 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi

Thank you for your interest in NXP Semiconductor products and 
for the opportunity to serve you.
1) What happens, if an interrupt fires, while the power-down instructions are executed?
    You should get some approaches before writing the code to avoid this condition happen.
2) I switch the main clock to 32kHz RTC bevor powering down. (Is this necessary?
    No, it's not necessary.
I think you'd better to learn the Debug limitations when testing some low-power demos.
2017-08-01_10-58-10.jpg
And I'd highly recommend you to refer to the power_manager_lpc demo in the LPC54102's SDK.

Have a great day,
TIC

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

在原帖中查看解决方案

3 回复数
1,288 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi

Thank you for your interest in NXP Semiconductor products and 
for the opportunity to serve you.
1) What happens, if an interrupt fires, while the power-down instructions are executed?
    You should get some approaches before writing the code to avoid this condition happen.
2) I switch the main clock to 32kHz RTC bevor powering down. (Is this necessary?
    No, it's not necessary.
I think you'd better to learn the Debug limitations when testing some low-power demos.
2017-08-01_10-58-10.jpg
And I'd highly recommend you to refer to the power_manager_lpc demo in the LPC54102's SDK.

Have a great day,
TIC

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

1,287 次查看
simonwyss
Contributor III

Hi
Thank you for your reply.

Where is your printscreen from?
31.6.1 Debug limitations: Do you have the document number and download link?

For others with the same question:

One can download the power_manager_lpc demo from this link: (select cpu, generate example, download)
Welcome to MCUXpresso | MCUXpresso Config Tools 

0 项奖励
回复
1,287 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Simon Wyss,

The screenshot is from the reference manual of the LPC54102: UM10850.
Have a great day,
TIC

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