Wakeup with different interrupt sources

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

Wakeup with different interrupt sources

Jump to solution
1,070 Views
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!

Labels (3)
1 Solution
845 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
846 Views
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!
-----------------------------------------------------------------------------------------------------------------------

845 Views
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 Kudos
845 Views
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!
-----------------------------------------------------------------------------------------------------------------------