Sleep - Wake up - Sleep

⚠️
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 https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9 posts / 0 new
Last post
harry84
Offline
Last seen: 4 months 3 weeks ago
Joined: 2020-09-01 13:33
Sleep - Wake up - Sleep

Hi,
I m working on DA14531. How the SoC go into extended or deep sleep mode and how to set a timer to wake up it automatically.
Actually, I need that device automatically wakes up after every minute and reads data from a GPIO and then writes them to RAM and finally go back to sleep mode.

Is there any example code for this kind of scenario?

It should be mention that the device must sent the saved data to another device through BLE connection every day.

 

Thanks in advance

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi harry84,

Hi harry84,

Thanks for your question online and for your interest in our TINY module BLE solution. You could take a look at the ble_app_sleepmode or prox_reporter examples of the SDK. Both are located under 6.0.14.1114\projects\target_apps\ble_examples SDK path. The ble_app_sleepmode is using a timer to stop advertising and configures the device into permanent sleep mode. It will wake up from an external interrupt trigger via the WAKEUP controller.  In your case you could use the app_easy_timer() in order to wake up periodically. Upon its expiration, you should place your preferable functionality in the callback function.  This can be achieved by setting the timer as shown here:

app_easy_timer(100,cb_my_timeout);

The first argument specifies the timer to time out after 100 * 10 ms = 1000ms = 1s. At this time the callback cb_my_timerout() get's called.

I would also recommend looking at the DA14531 Sleep Mode Tutorial (HTML) .

The data can be stored either in the Retention-RAM or in the on-module SPI flash.

Thanks, PM_Dialog

harry84
Offline
Last seen: 4 months 3 weeks ago
Joined: 2020-09-01 13:33
Hi again

Hi again

I tried to use app_easy_timer function to wake up the DA from extended sleep mode, but I couldn't. 
could you share a sample code with me?

Thanks

harry84
Offline
Last seen: 4 months 3 weeks ago
Joined: 2020-09-01 13:33
Hi

Hi
Thanks for your reply
Is there any sample project for storing and loading data from memory, and send them via BLE?

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi harry84,

Hi harry84,

Could you please indicate which memory you would like to use? On-module SPI Flash, System-RAM, OTP?

Thanks, PM_Dialog

harry84
Offline
Last seen: 4 months 3 weeks ago
Joined: 2020-09-01 13:33
thanks for your quick reply

thanks for your quick reply

I would to receive the data via BLE and store them in System-RAM or vice versa, read the data from System-RAM and send them to the central 

 

Thanks in advance.

 

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi harry84,

Hi harry84,

Since you are using sleep mode in you project, I assume that you would like to you the Retention-RAM memory. Please take a look at the DA14531: Different ways of handling RESET mechanism SW Example.

This example aims to demonstrate how to store data in the unitialized section of the Retention-RAM.

Please also check global variable definitions from the SDK examples, for instance the ble_app_peripheral example.

Thanks, PM_Dialog

harry84
Offline
Last seen: 4 months 3 weeks ago
Joined: 2020-09-01 13:33
Hi

Hi

I tried to use app_easy_timer function to wake up the DA from extended sleep mode, but I couldn't. 
could you share a sample code with me?

Thanks

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi harry84,

Hi harry84,

Once as the device goes into sleep mode, you should configure the timer. Upon its expiration, you should place your preferable functionality in the callback function.  This can be achieved by setting the timer as shown here:

app_easy_timer(100,cb_my_timeout);

The first argument specifies the timer to time out after 100 * 10 ms = 1000ms = 1s. At this time the callback cb_my_timerout() get's called.

In the callback, you should pace the code snippet from app_button_press_cb() from the ble_app_sleepmode example of the SDK.

Thanks, PM_Dialog