I am doing step-by-step setting-up of putting LPC11u67 device to power-down. However, even after doing everything exactly as I am told by manual, device can't get back from power-down. Maybe my code could provide some things that I understood in a wrong way.
Chip_SYSCTL_EnableStartPin(2); // Getting PIN INT to wake up device
Chip_SYSCTL_EnablePeriphWakeup((1 << 20) | (1 << 12)); // GINT0 interrupt wake-up | RTC wake-up
// Not needing BOD and WDT on sleep
Chip_SYSCTL_SetDeepSleepPD(SYSCTL_DEEPSLP_BOD_PD | SYSCTL_DEEPSLP_WDTOSC_PD);
// Switching to IRC as main clock
Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_IRC_PD);
/* Wait for at least 580uS for osc to stabilize */
for (i = 0; i < 2500; i++) {}
Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC);
// Turn on IRC, Flash, SysOsc and PLL on wakeup
Chip_SYSCTL_SetWakeup(~(SYSCTL_SLPWAKE_IRCOUT_PD | SYSCTL_SLPWAKE_IRC_PD | SYSCTL_SLPWAKE_FLASH_PD | SYSCTL_SLPWAKE_SYSOSC_PD | SYSCTL_SLPWAKE_SYSPLL_PD));
Chip_RTC_SetAlarm(LPC_RTC, Settings.nextHeartbeatTimeStamp);
// Go to power down
Chip_PMU_PowerDownState(LPC_PMU);
// Setup device from beginning - power on crystal and setup PLL
Chip_SetupXtalClocking();
One more thing - on wakeup only certain amount of things are optionally powered back up (IRC, BOD, FLASH, TS, etc.). Does that mean that after wakeup I should reinitialize a device as a whole? Does that mean that my UART which I use for modem handling is not going to work because of wake up?
Hi Arturas Jonkus,
Thanks for your reply.
1) Does that mean that after wake up I should reinitialize a device as a whole?
-- No, you needn't do that.
2) Does that mean that my UART which I use for modem handling is not going to work because of wake up?
-- No, I don't think so.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
This example doesn't seem to switch between RC clock and external clock, is that right? User manual suggest doing so I was wondering if that's absolutely required.
Hi Arturas Jonkus,
Thanks for your reply.
1) This example doesn't seem to switch between RC clock and external clock, is that right?
-- Yes, it's not the absolutely required.
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 interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you to refer to the periph_pmu demo in the LPCOpen library.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------