LPC1769 - Use WDT to Wake-up from Power-Down

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

LPC1769 - Use WDT to Wake-up from Power-Down

736 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Scorpio on Wed Nov 12 00:46:36 MST 2014
Hello,

I am using LPCXpresso, LPC 1769. I am trying to wake up the device from Power-down mode, using the WDT. I would like to perform a reset upon wake-up.

I do the following to setup the WDT and put the device in power-down. LED should blink, then device should go to sleep, WDT overflows and a reset is performed. After the reset I should see the LED blink again.

void WDT_Enable( uint32_t timeout_ms )
{
// Internal RC osc.
LPC_WDT->WDCLKSEL = 0x00;
uint64_t wdt_clk = 4000000/ 4;
uint64_t wdtc = ( ( uint64_t )timeout_msec * wdt_clk ) / 1000;
LPC_WDT->WDTC = ( uint32_t )wdtc;
LPC_WDT->WDMOD = 0x03;
LPC_WDT->WDFEED = 0xAA;
LPC_WDT->WDFEED = 0x55;
}

void Power_Down_Mode_Set( void )
{

SCB->SCR = 0x4;
LPC_SC->PCON = 0x9;
__WFI();
}

int main( void )
{
Led2_init( );
Led2_Toggle( );
delay( 1000 );
Led2_Toggle( );
WDT_Enable( 2000 ); // 2 sec
Power_Down_Mode_Set( );

return 1;
}


The problem is that the device never comes out of Power-Down mode. If I use Sleep mode then the above code works correctly.

Any insights on this?

Regards
Labels (1)
0 Kudos
1 Reply

544 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Wed Nov 12 08:46:00 MST 2014
Hi Scorpio,

According to the user's manual, the wake-up sources for Power-down mode consists of:

"Wake-up from Power-down mode can be brought about by NMI, External Interrupts EINT0 through EINT3, GPIO interrupts, the Ethernet Wake-on-LAN interrupt, Brownout Detect, an RTC Alarm interrupt, a USB input in transition (USB activity interrupt), or a CAN input pin transition, when the related interrupt is enabled."

Unfortunately this does not seem to include the watchdog timer. As an alternative, I would the RTC if you are using a board with the external circuitry. Also as a note, is there a reason why you do not use Deep Power-down? It puts the chip into an even lower power mode and is effectively a reset upon wake up, which is coincidentally what you intend on doing anyway.

Here's a link to the user's manual:
http://www.nxp.com/documents/user_manual/UM10360.pdf
0 Kudos