LPC812 WKT + WAKEUP PIN Not working

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

LPC812 WKT + WAKEUP PIN Not working

290 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lukman2012 on Thu Oct 16 21:17:54 MST 2014
Hi,

I have problem to combine WKT and WAKEUP PIN to wake LPC812 from deep power down. The WKT is working fine, it can wake up cpu from deep power down as expected. But while in deep power down, when I trigger WAKEUP PIN to low nothing is happen, cpu is not wake up. And if I keep WAKEUP PIN low until wkt timeout, cpu is freeze.

I have pull-up PIO0_4, RESET, and ISP.

Here is my wkt function to start deep power down

void wkt_start(void){
// + turn-off peripherals
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<6);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<7);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<11);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<14);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<18);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<19);

NVIC_ClearPendingIRQ(WKT_IRQn);
NVIC_DisableIRQ(WKT_IRQn);
/* Enable clock for WKT */
LPC_SYSCON->SYSAHBCLKCTRL |= (1 << SYSCTL_CLOCK_WKT);
/* Reset WKT */
LPC_SYSCON->PRESETCTRL &= ~(1 << RESET_WKT);
LPC_SYSCON->PRESETCTRL |= (1 << RESET_WKT);

LPC_PMU->DPDCTRL |= (1<<LPOSCEN);
LPC_PMU->DPDCTRL |= (1<<LPOSCDPDEN);

/* Enable Interrupt for WKT in NVIC */
NVIC_EnableIRQ(WKT_IRQn);
/* Config WKT */
LPC_WKT->CTRL = (1 << 2);
LPC_WKT->COUNT = ( SLEEP_TIME * (10000 - 920) ) / 1;
LPC_WKT->CTRL = 1;
/* Set wakeup config to same as run config */
LPC_SYSCON->PDAWAKECFG = LPC_SYSCON->PDRUNCFG;
/* WKT can wake up */
LPC_SYSCON->STARTERP1 = SYSCTL_WAKEUP_WKTINT;
SCB->SCR |= (1<<2);

LPC_PMU->DPDCTRL &= ~(1<<WAKEPAD_DISABLE);

/* Go to deep power down mode */
LPC_PMU->PCON = PMU_MCU_DEEP_PWRDOWN;
__WFI();
}


Need help,please...
Labels (1)
0 Kudos
1 Reply

195 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Fri Oct 17 10:53:10 MST 2014
Hi lukman2012,

Do you initialize the WAKEUP pin? The code you provided initializes the timer correctly but does not mention initializing the WAKEUP pin. For reference, you can look at our low power app note here:

http://www.lpcware.com/content/nxpfile/lpc800-low-power-modes-and-wake-times
0 Kudos