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:
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
Thanks for the help. Is there a way to monitor when it changes from one mode to another for testing purposes?
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
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?
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