SWT example

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

SWT example

752 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zbandit20 on Sat Sep 14 10:45:43 MST 2013
Hello everyone,

I've been trying to get the self wake up timer to work based on whats mentioned in the User Guide.

Also I followed an example that was posted here :

http://www.lpcware.com/content/forum/lpc812-wkt-deep-power-down-mode-working-only-once



I followed both the example in the link above and also the steps mentioned in the UG to no luck.

I'm using the LPC810 board from NXP with LPCXpresso. 

Basically, I'm trying to make the board go to sleep and wakeup at different intervals.

I tried putting the board to sleep using the provided code with LPC Xpresso but I dont think that works either, because I noticed one of the LEDs I turned on remains turned on even when I put the board to sleep. I know I'm doing something wrong.

Any directions will be appreciated.  I've been fighting this for a few weeks.  I'm not very experienced with the ARM Cortex, I'm trying to learn as I go.

Thank you.
Labels (1)
0 Kudos
Reply
1 Reply

679 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Sun Sep 15 15:56:00 MST 2013
There is an example in the LPCOpen release for the LPC8xx that shows how to do enter sleep mode and wakeup via WKT more than once. (See the periph_wkt example.)
You can get it for LPCXpresso here: http://www.lpcware.com/system/files/lpcopen_v2_00_lpcxpresso_nxp_lpcxpresso_812.zip

http://www.lpcware.com/content/nxpfile/lpcopen-platform

The example progressively cycles through all the PMU power modes ending with deep power down (and a board reset on the WKT event).
The basic code looks something like this.

void WKT_IRQHandler(void)
{
/* Clear WKT interrupt request */
Chip_WKT_ClearIntStatus(LPC_WKT);

/* Wakeup IRQ handling here */
. . .
}

int main(void)
{
. . .

/* Alarm/wake timer as chip wakeup source */
Chip_SYSCTL_EnablePeriphWakeup(SYSCTL_WAKEUP_WKTINT);

/* Enable and reset WKT clock */
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_WKT);
Chip_SYSCTL_PeriphReset(RESET_WKT);

/* 10KHz clock source */
Chip_WKT_SetClockSource(LPC_WKT, WKT_CLKSRC_10KHZ);

/* Setup for wakeup in 5s */
Chip_WKT_LoadCount(LPC_WKT, Chip_WKT_GetClockRate(LPC_WKT) * 5);

/* Tell PMU to go to sleep */
Chip_PMU_Sleep(LPC_PMU, PMU_MCU_DEEP_SLEEP);

/* Will return here after wakeup and WKT IRQ */
Chip_WKT_Stop(LPC_WKT);

. . .

return 1;
}

0 Kudos
Reply