how to wake up automatically, after deep sleeping for a couple of hours or days
hi dialog,
I want to let da14580 going into deep sleep mode for a couple of hours or days, then it wakes up automatically, how to do it with minimal energy consumed?
@ Peter: Generally you can wake up the device by using a Kernel timer (app_timer_set). You must create a timer_handler or use an existing handler. I use the APP_ADV_BLINK_TIMER for example. The maximal timer delay is limited by the KE_TIMER_DELAY_MAX = 30000 -> 300 seconds. I think this constant can be changed to 0xFFFF = 65535 -> 655 seconds. I have the same problem. I like to wake up the device after hours too. In the moment, I would solve this problem by wake up the device after 655 sec. and start the Kernel timer again. This should take less time an energy.
@ Dialog team: is this a good way to realize a very long sleep interval? Or, how would you solve this? How can be solved this the best way?
You can put your device in deep sleep and configure a kernel timer to wake up. But the kernel timers dont have the ability to be set in such a long time intervals such as hours or days, the kernel timers maximum value is up to approximatelly 5 minites. You will have to wake up and reset the timer. Changing the KE_TIMER_DELAY_MAX to larger values is not reccommended since its not tested and we can't guarantee a proper function. I agree that is a limitation but at the time is how the ke_timer works properly.
Just set a kernel timer and set it in the largest value it can take (KE_TIMER_DELAY_MAX), if you want to use a hardware timer you cant go into sleep mode, once the device falls into sleep all the peripherals are powered down.
Hi, Dialog Can we do the same in 14585 which using timer to wakeup from deep sleep. If yes, wakeup form deepsleep will cause system reset, how can I judge whether it's wakeup from timer?
@ Peter:
Generally you can wake up the device by using a Kernel timer (app_timer_set). You must create a timer_handler or use an existing handler. I use the APP_ADV_BLINK_TIMER for example. The maximal timer delay is limited by the KE_TIMER_DELAY_MAX = 30000 -> 300 seconds. I think this constant can be changed to 0xFFFF = 65535 -> 655 seconds.
I have the same problem. I like to wake up the device after hours too. In the moment, I would solve this problem by wake up the device after 655 sec. and start the Kernel timer again. This should take less time an energy.
@ Dialog team: is this a good way to realize a very long sleep interval? Or, how would you solve this? How can be solved this the best way?
Thanks!
Hi achao1104, cosianer
You can put your device in deep sleep and configure a kernel timer to wake up. But the kernel timers dont have the ability to be set in such a long time intervals such as hours or days, the kernel timers maximum value is up to approximatelly 5 minites. You will have to wake up and reset the timer. Changing the KE_TIMER_DELAY_MAX to larger values is not reccommended since its not tested and we can't guarantee a proper function. I agree that is a limitation but at the time is how the ke_timer works properly.
Thanks MT_dialog
thanks, could you please provide sample of using the kernel timer with 5 minutes sleep interval?
timer0 isn't suitable for this case?
Hi achao1104,
Just set a kernel timer and set it in the largest value it can take (KE_TIMER_DELAY_MAX), if you want to use a hardware timer you cant go into sleep mode, once the device falls into sleep all the peripherals are powered down.
Thanks MT_dialog
thanks.
嗨achao1104:
you could use an extra variable to store how many times of 5 mins timer timed out. I also did it like your use case.
but the device wakes up, and cost energy, though we can control whether it is going to advertise or not.
Hi, Dialog
Can we do the same in 14585 which using timer to wakeup from deep sleep. If yes, wakeup form deepsleep will cause system reset, how can I judge whether it's wakeup from timer?