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!
Solved! Go to Solution.
Hi
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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
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!
-----------------------------------------------------------------------------------------------------------------------