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_APP_SLEEP_MODE”和“PROXY_REPORTER”示例代码,并在代码中进行了相应的更改
-In user_config.h file
app_default_sleep_mode = arch_ext_sleep_on.
- 唤醒
ARCH_DISABLE_SLEEP();if(getBits16(sys_stat_reg,per_is_down)){periph_init();}如果(arch_ble_ext_wakeup_get()){ARCH_SET_SLEEP_MODE(APP_DEFAULL_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.
- 使用数据中断引脚I唤醒设备,然后检查传感器数据并执行更新广告分组的相应操作。
- 在此之后,我再次在睡眠模式下发送设备等待下一个中断。
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();}如果(arch_ble_ext_wakeup_get()){ARCH_SET_SLEEP_MODE(APP_DEFAULL_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
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.xmece.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.xmece.com/products/bluetooth-module-da14531-smartbond-tiny
还有参考设计,您将帮助您减少开发阶段,因为您不需要花费这么多时间开发您的应用程序代码。
CodeLes
无附件允许您快速使用一组AT命令使用无线IOT应用程序。亚博国际官网平台网址Dodeless AT命令平台允许通过BLE控制本地UART连接的设备以及远程设备。您可以创建简单的演示/应用程序/概念证明,而无需任何代码开发亚博国际官网平台网址或在顶部构建您自己的应用程序!
https://www.dialog-seminile.com/produ亚博电竞菠菜cts/smartbond-codeless-commands.
对话框串行端口服务(DSP)
DSP模拟串行电缆通信。它为RS-232连接提供了简单的替代品,包括通过蓝牙低能量的熟悉的软件流控制逻辑。SPS软件分发包括应用程序和配置文件源代码并支持间隙中央/外设角色。
//www.xmece.com/products/dialog-serial-port-service-dsps
对于DA14531,您有一个完成的SW示例,用于读取I2C接口,并通过BLE通知将值发送到对等设备。您可以将其作为参考!
DA14531-DA14585-586 Reading I2C Accelerometer BLE
谢谢。PM_DIALOG.
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,
但是,我要求您使用Curennt版本的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.
我陈述了Follwing行为。-
一旦我刷新代码并重新推回它,设备是广告,如果我再次重新推回设备,那么设备就停止了广告。
那么你可以帮忙,为什么设备停止广告是有什么我错过的?
Please help at the earliest
感谢致敬
Utkarash
Hi Utkarash,
您是否从SPI Flash或System-RAM启动?您能否在调试模式下运行它,并检查它是否符合stauck(nmi,wdg,断言等)?
我想再次亮点,即当设备处于睡眠模式时,无法具有任何I2C活动。
Thanks, PM_Dialog
Thank you for your reply and suggestions,
您是否从SPI Flash或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.
您能否在调试模式下运行它,并检查它是否符合stauck(nmi,wdg,断言等)?- 现在的代码不会被困在NMI或WDG中,并解决了我提到的广告的问题。
我想再次亮点,即当设备处于睡眠模式时,无法具有任何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_APP_SLEEP_MODE”和“PROXY_REPORTER”示例代码,并在代码中进行了相应的更改
-In user_config.h file
- 唤醒
-For activating Sleep
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
Hi Utkarsh,
它似乎是正确的 - 你想停止广告并将设备放入永久睡眠模式吗?
What is the power consumption you are measuring with this implementation?
还请检查DA14580的睡眠模式教程 - 链接提供:
//www.xmece.com/sites/default/files/training_04_sleep_mode_configurations.pdf
Thanks, PM_Dialog
Thank you for your reply and suggestions,
您想停止广告并将设备放入永久睡眠模式吗?- 不,我不想停止广告,也不想把设备放在永久睡眠中。请检查下面的指向GransanMD,我的设备应该睡觉,什么时候应该醒来?
-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?
If No, then should ignore this comment in my case?
Please help at the earliest.
Thanks and regrads
Utkarash
Hi Utkarsh,
您也可以使用 - SPI_FLASH_POWER_DOWN() - 在DA14583中,因此您可以关闭闪光灯。这将降低睡眠模式下的电流消耗。然后,当芯片唤醒时,您应该调用-da14583_spi_flash_release() - 从下电模式释放闪光灯。
>>>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_spi_flash_release()而不是spi_flash_release_from_power_down()。
Thanks, PM_Dialog
Thank you for your reply and suggestions,
请尝试使用da14583_spi_flash_release()而不是spi_flash_release_from_power_down()。--Thank you for your suggestion, i will make the respective changes.
感谢致敬