Is there a code example for forcing the DA14680 into low power mode ad then waking it up from an interrupt?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
alarner
Offline
Last seen:1 month 2 weeks ago
加入:2017-05-27 02:11
Is there a code example for forcing the DA14680 into low power mode ad then waking it up from an interrupt?

I'm trying to simulate an on / off button on my device and would like to force my DA14680 chip into low power mode when the button is pressed an held for a certain amount of time. Is there an adapter / api that I can use to manually put the chip into low power mode?

Device:
MT_dialog
Offline
Last seen:1 year 2 months ago
工作人员
加入:2015-06-08 11:34
Hi alarmer,

Hi alarmer,

The mode of the device is set right when the device starts to run (pm_set_sleep_mode() function), so you set a default sleep mode and then the device will stay awake or go to sleep depending on the workload, for example if you have send an advertising command to the stack the device will wake up and sleep in order to advertise on the advertising interval. So if you dont command the device to do anything it will just go to sleep as soon as there is nothing to do.

Thanks MT_dialog

alarner
Offline
Last seen:1 month 2 weeks ago
加入:2017-05-27 02:11
Thanks for the help. Is there

Thanks for the help. Is there a way to monitor when it changes from one mode to another for testing purposes?

MT_dialog
Offline
Last seen:1 year 2 months ago
工作人员
加入:2015-06-08 11:34
Hi alarmer,

Hi alarmer,

What exactly do you mean ? The mode changes from the application level, you (or better your application code) decides the mode that the device will operate, the sleep mode that the device is configured to operate wont change depending on the state of the device.

Thanks MT_dialog

alarner
Offline
Last seen:1 month 2 weeks ago
加入:2017-05-27 02:11
Thanks. I probably worded my

Thanks. I probably worded my question poorly. I'd like to know when the chip goes to sleep and when it wakes up. Is there a way to monitor that?

MT_dialog
Offline
Last seen:1 year 2 months ago
工作人员
加入:2015-06-08 11:34
Hi alarner,

Hi alarner,

There is a default debugging functionallity that would indicate when the device wakes up and falls to sleep, the default functionallity is toggling specific pins in order to indicate sleep and wake up triggers ? But i am not sude how exactly you would like to indicate that the device has awaken and went back to sleep ? I am asking this because since the device wakes up it goes through a set of stages settling of the XTAL powering up LDOs, peripherals etc in order to be operational, so you will have to be more specific on what is that you would like to do, since when the device wakes up you dont have access to the peripherals in order to print for example. The default debug functionallity can be enabled via re - defining the CPM_USE_TIMING_DEBUG and CPM_USE_FUNCTIONAL_DEBUG and offcourse CPM debug in the bsp_debug.h file. The SDK will map the CPMDBG_SLEEP_ENTER and CPMDBG_SLEEP_EXIT on the P16 and P17 pins.

Thanks MT_dialog