LPC1225 Deep Seelp mode and RTC

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

LPC1225 Deep Seelp mode and RTC

833 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Redbull68 on Mon Apr 07 13:37:54 MST 2014
Hi,

I will try to use RTC to wake up lpc 1225 from deep sleep mode and i have a problem, the microncontroler don't wake up ( it's a really problem).
I try like it is say in the user manual and after some bad test, I read the errata sheet and it say that to wake up from deep sleep mode via RTC, the system must be clocked by the WDTosc while in deep sleep mode.

If you you see i error in my code...

__irq void INT_RtcHandler (void)
{
    RTCICR_bit.RTCICR = 1; // Clear IT flag
}


RTCMR = RTCDR + 5; // Update RTC value to wake up from Deep Sleep mode (5sec just to try)
RTCIMSC = 1; // Enable RTC IT

PCON_bit.DPDEN = 0;
// BOD and WDT configuration in Deep Sleep mode
PDSLEEPCFG_bit.BOD_PD = 0; // BOD circuit powered
PDSLEEPCFG_bit.WDTOSC_PD = 0; // WDT oscillator powered

PDAWAKECFG = PDRUNCFG; // Save Power configuration

PDRUNCFG_bit.WDTOSC_PD = 0; // WDT oscillator powered

MAINCLKSEL_bit.SEL = 2; // WDT oscillator clock source
WDTOSCCTRL_bit.FREQSEL = 1; // FREQSEL : 0,5MHz (errata sheet)
WDTOSCCTRL_bit.DIVSEL = 31; //DIVSEL : 64 (errata sheet)

// Then reset and set UEN for changes to take effect
MAINCLKUEN = 0;
MAINCLKUEN = 1;
while ((MAINCLKUEN & 1) == 0); // Wait changes to be done

// Configure RTC to wake up
STARTAPRP1_bit.ARPINT30 = 1; // Rising edge
STARTERP1_bit.ERINT30 = 1; // Enable start signal
STARTRSRP1CLR_bit.RSRINT30 = 1; // Reset start signal
HalIrqInstall(RTC_IRQ, 3); // Enable RTC interrupt (priority 3)

SYSAHBCLKCTRL_bit.WDT = 1; // Enable clock for WDT

SCR_bit.SLEEPDEEP = 1;
__WFI();
Labels (1)
0 Kudos
2 Replies

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Sun Oct 26 01:37:29 MST 2014
Is it a periodic wake up interrupt or not?
I want to use RTC wake up for every 10 minutes wake up for deep sleep  is it possible ?
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxp_apps on Sun Apr 13 23:53:50 MST 2014
Hi,

Please see the application + software example.
Hopefully this helps.

http://www.lpcware.com/content/nxpfile/lpc122x-power-modes

Thanks.

nxp_apps
0 Kudos