lpcware

LPC812 WKT + WAKEUP PIN Not working

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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...

Outcomes