Wakeup with different interrupt sources

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Wakeup with different interrupt sources

ソリューションへジャンプ
1,513件の閲覧回数
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,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!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

3 返答(返信)
1,289件の閲覧回数
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,288件の閲覧回数
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,288件の閲覧回数
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!
-----------------------------------------------------------------------------------------------------------------------