Wake from sleep with OSTimer

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

Wake from sleep with OSTimer

599 Views
otsl
Contributor III

I'm trying to put the LPC55S69 into deep sleep and/or power down mode and wake it with the OS Timer.

I use OSTIMER_SetMatchValue(...) to configure the sleep duration.  If I use a simple __WFI(), I get "woken" and code continues to execute.  If I substitute either of these for the __WFI(), the code does not wake up on the OS Timer match (OS Timer is clocked from external 32K crystal):

POWER_EnterDeepSleep(kPDRUNCFG_PD_XTAL32K,0x7FFF,WAKEUP_OS_EVENT_TIMER | WAKEUP_GPIO_GLOBALINT0,0);

 

POWER_EnterPowerDown(kPDRUNCFG_PD_XTAL32K,0x7FFF, WAKEUP_OS_EVENT_TIMER | WAKEUP_GPIO_GLOBALINT0, 1);

Both options do wake up correctly when one of the gpio interrupts triggers.  I have referred to the power_manager_lpc project as well as the utick_wakeup projects, but neither has given me any clue as to why the OS Timer does not wake the processor.

Labels (1)
Tags (2)
0 Kudos
1 Reply

501 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello ,

Hope you are doing well.

I recommend to use the example for the OS Timer in the SDK. The OSTIMER project is a simple demonstration program of the SDK OSTIMER driver. It sets the OSTIMER as the wakeup source from deep-sleep mode. After wakeup from deep-sleep mode, OS timer will set match value  to trigger the interrupt while the timer count tick reach the match value about every 2 seconds.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos