Sleep Configuration for DA14583

Learn More常见问题教程

9 posts / 0 new
最后一篇文章
Utkarash
离线
Last seen:6个月1周前
已加入:2019-01-18 06:36
Sleep Configuration for DA14583

Hello All,

I am using Dialog's DA14583 based Dev Kit with a I2C based capacitive proximity sensor with touch key.

我的主要应用是感测邻近变化(即,触摸检测),并基于此通过更新广告包来共享少量数据字节,此广告包由另一设备收集。

此传感器具有以下特性
-它有一个额外的数据中断引脚除了基本的I2C通信引脚在传感器端,理想情况下保持高。
- The sensor pulls the Data interrupt pin LOW whenever the data is ready and is about to send it over the respective I2C pin to the MCU.

I have connected this Data interrupt pin of sensor to my MCU GPIO pin which is configured to give an interrupt whenever this pin goes LOW.

I have programmed the sensor in such a way that whenever there a proxomity change (i.e., Touch detected) the sensor will pull the Data interrupt pin LOW and then MCU can initiate the Read operation. Also i have programmed the sensor in low power mode so that it consumes less power.

在我的应用程序中,人体运动检测上的数据中断引脚将中断MCU,并根据读取的传感器值更新广告包中的数据。

This Logic works properly in Active Mode, However my device would be battery operated i want to implement Extended Sleep Mode in this device.

对于睡眠模式,我参考了“ble\u app\u Sleep\u Mode”和“proxy\u reporter”示例代码,并对代码进行了相应的更改
- In user_config.h file

app\u default\u sleep\u mode=ARCH\u EXT\u sleep\u开启

-为了唤醒

arch_disable_sleep();if(GetBits16(SYS_STAT_REG,PER_IS_DOWN)){periph_init();}if(arch_ble_ext_wakeup_get()){arch_set_sleep_mode(app_default_sleep_mode);arch_ble_force_wakeup();arch_ble_ext_wakeup_off();app_easy_wakeup();}

- For activating Sleep

arch_set_sleep_mode(ARCH_EXT_SLEEP_ON);

For Longer battery life i have changed application as follows,
- First i do the respective sensor configuration and MCU configurations and after that i send the MCU in sleep mode.
-使用数据中断引脚唤醒设备,然后检查传感器数据并执行更新广告包的相应操作。
-之后,我发送设备在睡眠模式再次等待下一个中断。

Now when i incorparate sleep mode i am not able to get proper response from device, whole logic fails, where i am not able to get proper interuupts or proper data
因此,我也尝试了下面提到的唤醒逻辑的一些变化

arch_disable_sleep();if(GetBits16(SYS_STAT_REG,PER_IS_DOWN)){periph_init();}if(arch_ble_ext_wakeup_get()){arch_set_sleep_mode(app_default_sleep_mode);arch_ble_force_wakeup();arch_ble_ext_wakeup_off();app_easy_wakeup();}i2c_init();

My question is that whether sleep aftects I2C data communication, If yes how can i fix it ?

MCU是否有最短的特定睡眠时间,也就是说,如果我每30秒成功中断4到5次,睡眠模式就会正常工作。

Please help me with this at the earliest

Thanks and Regards

Device:
PM_Dialog
离线
Last seen:8 hours 2 min ago
工作人员
已加入:2018-02-08 11:03
Hi Utkarash,

Hi Utkarash,

Yes, the sleep mode has an effect on the I2C communication. When the device is in any of sleep modes, all the peripheral domains (SPI. I2C, UART etc. ) are powered down. This means that when the device is in extended sleep mode, it is not possible to have any I2C activity. Additionally, keep in mind that if the devices configured in sleep mode, then it will go into sleep mode between advertising and connection intervals.

Could you please let us if there is an specific reason for using DA14583? Do you have any specific requirement?

If you are starting a new design / project, we would strongly recommend to start with DA14531 or DA14585/586 products and our latest SDK6.0.14, as it is much more improved. We have a lot of code examples and improved documentation, and there is also software roadmap support. There is no software roadmap support for DA14580 product family and SDK5.

Please check out DA14531:

//www.wsdof.com/products/connectivity/bluetooth-low-energy/products/da14531

We also have a DA14531 module, namely DA14531 SmartBond TINY™ Module! It has very small dimensions and is very low power. Follow the link below to find datasheet, documentation and HW collaterals for the module:

//www.wsdof.com/products/bluetooth-module-da14531-smartbond-tiny

还有一些参考设计可以帮助您缩短开发阶段,因为您不需要花费太多时间来开发应用程序代码。

CodeLes

无代码允许您通过一组AT命令快速启动无线物联网应用程序。无代码AT命令平台允许通过BLE控制本地UART连接设备和远程设备。您可以雷竞技安卓下载创建简单的演示/应用程序/概念验证,而无需任何代码开发,或者在上面构建您自己的应用程序!

//www.wsdof.com/雷电竞官网登录products/smartbond-codeless-commands

对话串行端口服务(DSPS)

DSP模拟串行电缆通信。它提供了一个简单的RS-232连接的替代品,包括通过蓝牙低能耗熟悉的软件流控制逻辑。SPS软件发行版包括应用程序和配置文件源代码,并支持GAP中央/外围角色。

//www.wsdof.com/products/dialog-serial-port-service-dsps

对于DA14531,有一个完整的软件示例,用于读取I2C接口并通过BLE通知将值发送到对等设备。你可以作为参考!

DA14531-DA14585-586 Reading I2C Accelerometer BLE

谢谢。PM\U对话框

Utkarash
离线
Last seen:6个月1周前
已加入:2019-01-18 06:36
Thank you for your reply and

Thank you for your reply and suggestions,

很抱歉,由于一些限制,我将无法更改此状态下的MCU或SDK对话框,

In next version of the device i will defiently refere you suggestions of new MCU and SDK,

不过,我请求您帮助睡眠配置与当前版本的SDK和MCU。

I had shared the code snipet i refered for sleep configurations so can you please check them and let me known whether i am correct?

Also after refereing ble_app_sleep_mode example i made sleep configuration of extended sleep mode keeping DA14583 limitations in mind.

我注意到了下面的行为。-

一旦我闪光的代码和重新供电的设备是广告和几分钟后,如果我再次重新供电的设备停止广告。

所以你能帮我解释一下为什么这个设备停止了广告吗?有什么我遗漏的吗?

Please help at the earliest

谢谢和问候

Utkarash

PM_Dialog
离线
Last seen:8 hours 2 min ago
工作人员
已加入:2018-02-08 11:03
Hi Utkarash,

Hi Utkarash,

您是从SPI闪存还是系统RAM引导?你能在调试模式下运行它并检查它是否得到了stauck(NMI,WDG,assertion等等)吗?

我想再次强调,当设备处于睡眠模式时,不可能有任何I2C活动。

Thanks, PM_Dialog

Utkarash
离线
Last seen:6个月1周前
已加入:2019-01-18 06:36

Thank you for your reply and suggestions,

Are you booting from SPI Flash or System-RAM?-- I am booting using SPI Flash, I use the hex file generated after build process and using smart snippet tool i dump the file into my board.

Can you please run it in debug mode and check if it gets stauck (NMI, WDG, assertion etc. )?--代码现在没有陷入NMI或WDG和广告的问题,我提到的eralier解决了。

我想再次强调,当设备处于睡眠模式时,不可能有任何I2C活动。——我完全明白I2C并不在extended sleep. However when i wake up the device from sleep at least then the I2C should work. Also in reference to this i am asking whether my sleep configuration which i have made are correct? i.e.,

如前所述,

对于睡眠模式,我参考了“ble\u app\u Sleep\u Mode”和“proxy\u reporter”示例代码,并对代码进行了相应的更改
- In user_config.h file

app\u default\u sleep\u mode=ARCH\u EXT\u sleep\u开启

-为了唤醒

arch_disable_sleep();if(GetBits16(SYS_STAT_REG,PER_IS_DOWN)){periph_init();}if(arch_ble_ext_wakeup_get()){arch_set_sleep_mode(app_default_sleep_mode);arch_ble_force_wakeup();arch_ble_ext_wakeup_off();app_easy_wakeup();}

- For activating Sleep

arch_set_sleep_mode(ARCH_EXT_SLEEP_ON);

Now Please check these statements and let me know if i am using correct code for sending device in sleep and for waking it up?

等待你的回应。

Thanks and Regards

Utkarsh

PM_Dialog
离线
Last seen:8 hours 2 min ago
工作人员
已加入:2018-02-08 11:03
Hi Utkarsh,

Hi Utkarsh,

这似乎是正确的-你想停止广告,把设备进入永久睡眠模式?

What is the power consumption you are measuring with this implementation?

还请查看DA14580的睡眠模式教程–下面提供了链接:

//www.wsdof.com/sites/default/files/training_04_sleep_mode_configurations.pdf

Thanks, PM_Dialog

Utkarash
离线
Last seen:6个月1周前
已加入:2019-01-18 06:36
Thank you for your reply and

Thank you for your reply and suggestions,

是否要停止广告并将设备置于永久睡眠模式?--不,我不想停止广告,也不想把设备在永久睡眠。请检查下面提到的几点,以了解我的设备应该在哪里睡眠,什么时候醒来?

- I wakeup the device when there is an interrupt from sensor update the advertising packets and after 5 secs again go to sleep and wait untill next interrupt is received from sensor.

This is how i need the sleep to work, if you need to understand regarding the sensor and my application please refere my initial post.

What is the power consumption you are measuring with this implementation? --我断开连接的传感器和测量只有MCU current which i am getting in the range of 50 to 150 MicroAmps(current varies in this range), which is not ideal for my case i want a current which shoud not exceed more then 50MicroAmps for only MCU . As after connecting my sensor it will again Increase.Also while measuring current i refered the same tutorial suggested by you.

还请查看DA14580的睡眠模式教程–下面提供了链接:--I have refered this tutorial itself and implemented my sleep logic which i have shared with you also.

除此之外,我还有一个问题,在实现睡眠的同时,我浏览了几篇文章,发现下面提到的评论是由对话引起的。

"Additionally, since it is DA14583, if the flash is NOW powered down, then the consumption will increased again.
There is a function in order to place the SPI in power down mode - spi_flash_power_down() - and in that case you won’t be able to interact with the flash unless you instruct the SPI flash to be powered up. Before starting to interact with the flash, you should invoke spi_flash_release_from_power_down()."

Now in my case also i am using DA14583 so should i bother about this?

If Yes,then with reference to this comment i have made these changes in my code Please check if it is correct?

  • Before sending device into sleep mode i call spi_flash_power_down, for example,
spi_flash_power_down(); arch_set_sleep_mode(ARCH_EXT_SLEEP_ON);
  • And while waking the device up i again relaese the spi_power_down mode, for example,
arch_disable_sleep(); spi_flash_release_from_power_down(); if (GetBits16(SYS_STAT_REG, PER_IS_DOWN)) { periph_init(); } if (arch_ble_ext_wakeup_get()) { arch_set_sleep_mode(app_default_sleep_mode); arch_ble_force_wakeup(); arch_ble_ext_wakeup_off(); app_easy_wakeup(); }

If No, then should ignore this comment in my case?

Please help at the earliest.

Thanks and regrads

Utkarash

PM_Dialog
离线
Last seen:8 hours 2 min ago
工作人员
已加入:2018-02-08 11:03
Hi Utkarsh,

Hi Utkarsh,

您也可以使用DA14583中的-spi\u flash\u power\u down()–来关闭flash。这将减少睡眠模式下的电流消耗。然后,当芯片唤醒时,您应该调用-da14583\u spi\u flash\u release()–将flash从掉电模式中释放出来。

>>>Before sending device into sleep mode i call spi_flash_power_down, for example,

I don’t see anything work - you are calling the correct APIs.

>>>And while waking the device up i again relaese the spi_power_down mode, for example,

请尝试使用da14583\u spi\u flash\u release()而不是spi\u flash\u release\u from\u power\u down()。

Thanks, PM_Dialog

Utkarash
离线
Last seen:6个月1周前
已加入:2019-01-18 06:36
Thank you for your reply and

Thank you for your reply and suggestions,

请尝试使用da14583\u spi\u flash\u release()而不是spi\u flash\u release\u from\u power\u down()。--Thank you for your suggestion, i will make the respective changes.

谢谢和问候