This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Deep sleep mode.

Hi,

We have created an application with BLE multi peripheral where I have to put my chip into deep sleep mode by long pressing the tactile button & also I have to wake it up by long pressing the same tactile button. could you please guide me to achieve this by listing out the procedures to follow. kindly, do the needful. Thanks in advance.

Warm regards,

Roshan.

Parents
  • Hi Roshan, 

    How familiar you are with our nRF5 SDK ? 
    In the SDK we provide you a bsp library that can handle button press. 

    For example if you have a look at the ble_app_hrs example, you can find the bsp_event_handler() where if you quick press button 0 (on the nRF52 DK) the device will enter sleep mode (deep sleep). 
    and if you long press the same button it will do Disconnection if it's in a connection. 

    You can modify that handle so that when you long press a button it enter deep sleep mode instead. 

    Regarding waking up, you can find in sleep_mode_enter() how it's prepared before enter sleep mode so that you can wake the chip up with a button. However it always wakes up with an interrupt (button press) doesn't matter if it's long press or short press. You would need to implement in your code so that if it wakes up from a button press, it would start a timer and if the button is released before a period of time (short press) the chip will enter sleep mode again. And if it's longer than a certain time, it will boot up normally. This we don't have yet and you would need to implement.  

Reply
  • Hi Roshan, 

    How familiar you are with our nRF5 SDK ? 
    In the SDK we provide you a bsp library that can handle button press. 

    For example if you have a look at the ble_app_hrs example, you can find the bsp_event_handler() where if you quick press button 0 (on the nRF52 DK) the device will enter sleep mode (deep sleep). 
    and if you long press the same button it will do Disconnection if it's in a connection. 

    You can modify that handle so that when you long press a button it enter deep sleep mode instead. 

    Regarding waking up, you can find in sleep_mode_enter() how it's prepared before enter sleep mode so that you can wake the chip up with a button. However it always wakes up with an interrupt (button press) doesn't matter if it's long press or short press. You would need to implement in your code so that if it wakes up from a button press, it would start a timer and if the button is released before a period of time (short press) the chip will enter sleep mode again. And if it's longer than a certain time, it will boot up normally. This we don't have yet and you would need to implement.  

Children
Related