Hi,
I'm using USB development kit , To minimize power consumption we are trying to incorporate one of sleep modes from following link
http://lpccs-docs.dialog-semiconductor.com/DA14531_Sleep_Mode+/introduct...
My requiremets are,
1.在每100毫秒循环中,它应该睡50毫秒。(剩下50毫秒,它将DO读取和更新到BLE)
2. ThroughBLE timerit should wake up.
Can you provide me some example with above constraints.
Thanks in advance
Balaji.
Keywords:
Device:
嗨巴拉吉,
The SDK6 manages sleepmode after you select one of threee different modes. In your case the optimal mode will be extended sleep. When this mode is set (as per the Sleepmode Tutorial) the device will automatically wake up to perform any BLE transactions - you will not have to do anything in your code to ensure proper BLE wakeups.
As far as your regular ADC activity, you have the option to either use the app_easy_timer to trigger readings or you can tie your ADC reads to the tail of every BLE event. You can find instructions on how to use the app_easy_timer here:http://lpccs-docs.dialog-semiciondiond.com/tutorial_sdk6/timer.html.
Tying the ADC readings to the end of every BLE event can be slightly more energy efficient because it limits the amount of wakeups. You can define a macro function in your main header file such as user_myproj.h:
In this file also add a prototype to the function:
Finally in user_myproj.c, implement your ADC read in this function.
I hope this helps.
/MHv
Hi MHv,
Thanks for your quick reply , i will try to look into it , just a follow up query I need to acheive same adc operation for every 100 ms when BLE isnot connected.My advertising interval is 687.5ms and advertising timeout is 3 mins.The advertising cycle restarts only if user press a push button,till then the radio should remain off. Is is it possible to go with "Extended sleep" if BLE is connected as you mentioned above and "沉睡" when BLE is not connected.Any alternate suggestion for the same.
Thanks in advance!
Br,
BALAJI.
嗨巴拉吉,
这使得你app_easy_timer easiest one to implement. Extended sleep is the lowest power solution for a device that needs to wake up every 100ms (to perform the ADC readings in your case). Waking up from deep sleep requires additional energy for every wakeup in order to copy from OTP to RAM foir execution. If your application code is in flash, then deep sleep would only be useful for sleep duration of days or weeks.
And remember that sleep is managed by the SDK. The device will go to sleep unless:
/MHv
Hi MHv,
我拍了BLE_APP_SLEEPMODE项目,并配置了APP_EASY TIMERuser_sleepmode.c
Inside this ble_timer_wake()
I made ble adv timeout of 5 sec , sleep time is 10 sec , and after wakeup. It worked as expected.
Now I have a user application task which is configured in following user_app_callback
.app_on_set_dev_config_complete = user_on_set_dev_config_complete
创建的功能原型和定义如下
My concern is if app is advertising there is a delay in execution of above task , but when ble is in exteneded sleep it woks as expected.What might be the possible mistake.
I need to know how sleep is acheived once adv is stopped,从下面的片段中推荐。
1 . How the main loop set sleep mode ?
2. where BLE_APP_PRESENT is disabled for app to enter sleep ?
Thanks in advance,
Br,
Balaji.
Hi Belaji,
Bluetooth activity has higher priority than any of your user application. This means that sometimes your app_easy_timer will trigger a little later. The only way to acheieve near realtime execution is to stop all Bluetooth LE activity (no advertising, no connections).
The sleep implementation is the most complex part of the SDK, and is completely abstracted from the user for that reason. It is beyond the scope of the forum to explain the intricate details of this. As mentioned in the previous reply, all you need to know about sleep is that you can set the default mode of operation and the device will sleep when it can. Please take a look at the "getting Started with SDK6" tutorial I referred to earlier. In that tutorial you can find everything you need to know about sleep mode.
undefining ble_app_present仅在gtl模式(您不是)中使用的设备时相关,因此请留下。
/MHv
Hi MHv,
Thanks for your detailed response. As you said when there is no advertisment or app not connected. The user application is executed as expected.But Our product requirements are not met. My mail id :巴拉吉.s@pmsind.com. I can share our requirements , After 4 months of development we got stuck up here. We need support in slight modification of SDK . we are forced to change our BLE module, if this issue is not resolved. Till now your product is awesome , keep in mind we have our smartcane product ( for which we opted for ble design using da14531) sold 100K units so far. Kindly consider my request and revert back at earliest.
Thanks in advance
Br
Balaji
Hi MHv,
When I set sleep mode as
in user_config.h and project file isble_sleepmode projectfrom SDK.
After timeout it entered sleep (asPD_SYS is Off), as mentioned in documentation we can use multiple option for wakeup so I prefered BLE timer
我在user_app_callbacks内配置了一个ble timer
Device goes to sleep but didnt wake up from sleep. How to wake up using RTC / Timer 1 / BLE Timer . share me a small snippet for the same.
Does user app timers are cancelled when device enter sleep ?
Thanks in advance
Br,
BALAJI
嗨巴拉吉,
I read the whole conversation and regarding this statement:
>>当BLE未连接时,我需要为每100毫秒达到相同的ADC操作。我的广告间隔是687.5ms,广告超时是3分钟。
当设备配置为扩展睡眠模式时,它将在间隔(广告或连接间隔)之间睡眠。在睡眠模式下,所有外围域都断电,以便系统消耗较低的功率。因此,如果系统处于扩展睡眠模式,这意味着不可能使用包括ADC的任何外围块。
As MHv_Dialog mentioned, in order to wake-it up periodically, the app_easy_timer() should be used. This API is using the BLE timer, so it is valid in extended sleep mode. Can you please check if the callback registered in the app_easy_timer() is getting triggred?
>>> Device goes to sleep but didnt wake up from sleep. How to wake up using RTC / Timer 1 / BLE Timer .
Which is the sleep mode? Is it the extended sleep?
Thanks, PM_Dialog