Hello, I am essentially trying to replicate the success of this post (https://community.nxp.com/t5/LPC-Microcontrollers/Deep-sleep-and-wake-up-using-RTC-in-LPC54618/m-p/9...) but using the LPC54018 processor instead. I placed a comment within that thread noting that I can see a wakeup occurring via the RTC however I cannot get execution to return to the main function. Is there some fundamental difference between the LPC54618 and LPC54018 when using the RTC for deep sleep?
解決済! 解決策の投稿を見る。
Hi,
Pls try to use the line:
#define APP_EXCLUDE_FROM_DEEPSLEEP \
(SYSCON_PDRUNCFG_PDEN_SRAMX_MASK | SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK | \
SYSCON_PDRUNCFG_PDEN_VD6_MASK|SYSCON_PDRUNCFG_PDEN_WDT_OSC_MASK)
BR
XiangJun Rong
Hi,
As you know that the waking-up from deep-sleep follows up the interrupt procedure, in other words, when the waking-up happens, it enters ISR firstly, after executing the ISR, it returns to main from ISR.
So you have to enable the alarm interrupt and create an ISR for the RTC alarm interrupt.
Pls have a try.
If you have issue, pls post your code, I will have a review.
BR
XiangJun Rong
Below is the source code. I am running this code on the LPCXpresso54018 development board. Within the RTC_IRQHandler function I put multiple PRINTF statements and those do print so the wake up from sleep is happening. But the "Alarm Occurs" message from the main body never prints. Here is an example of the debug output:
RTC example: set up time to wake up an alarm
Current datetime: 2014-12-25 19: 0: 0
Please input the number of second to wait for alarm
The second must be positive value
5
currSecond =: 1419534002Alarm will occur at: 2014-12-25 19: 0: 7
Interrupt occurs !!!!
I cleared the alarm flag !!!!
I got past the IF errata statement !!!!
_______________________________________________________
Here is the source code:
Hi,
where you declare the bool variable busyWait?
How about commenting the following line
while (busyWait)
{
}
BR
XiangJun Rong
The variable is declared here:
Hi,
Pls try to use the line:
#define APP_EXCLUDE_FROM_DEEPSLEEP \
(SYSCON_PDRUNCFG_PDEN_SRAMX_MASK | SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK | \
SYSCON_PDRUNCFG_PDEN_VD6_MASK|SYSCON_PDRUNCFG_PDEN_WDT_OSC_MASK)
BR
XiangJun Rong
Thank you this was the solution I was missing SYSCON_PDRUNCFG_PDEN_VD6_MASK from the exclusions.