Dear Dialog_support Team,
我在我的应用中使用Timer0和Timer2来播放蜂鸣声,并计算按钮按下的时间。现在我想在我的应用程序中添加睡眠模式,并在添加扩展睡眠模式后,定时器无法正常工作。我还阅读了不同的对话框的论坛帖子,即Timer0和Timer2将无法使用睡眠模式。那么我可以通过app_easy_timer替换两个计时器吗?我在Timer0,2中配置了职责周期,以播放蜂鸣声。那么如何使用app_easy_timer设置职责循环?
Thanks and Regards,
Ruchi Patel
Keywords:
Device:
Hi Ruchi Patel,
定时器0和2是硬件定时器,因此它们具有生成脉冲宽度调制信号的能力,基于此功能可以产生蜂鸣声。没有选择用App_easy_Timer(软件计时器)替换这两个定时器中的一个
布罗尔,
sts_dialog。
Dear Dialog_support Team,
Sorry i have given you wrong explanation regarding Timer0,2.
我希望我的设备处于睡眠模式,当按下按钮或应用程序没有任何中断时。在设备中断后,Timer0,2应该从睡眠中醒来,完成工作,然后再次睡觉。我不想在睡眠期间运行Timer0,2。所以有可能吗?
Can you suggest me any good and relevant example of extended sleep mode?
Thank you in advance.
带着敬意,
Ruchi Patel
Hi Ruchi Patel,
大多数示例在扩展睡眠模式下运行,如果您想要使用按钮的按钮运行的示例,例如在睡眠模式下,并且一旦按下按钮或发生中断,设备会唤醒您可以检查BLE_APP_SLEEPMODE,原始配置用于深度睡眠,但您可以通过将APP_DEFAULT_SLEEP_MODE从ACH_DEEP_SLEEP_ON更改为ARCH_EXT_SLEEP_ON来轻松更改,并通过将内存配置更改为CFG_MEM_MAP_EXT_SLEEP。完成后,您可以设置定时器以便生成PWM并在运行时禁用睡眠,只要您希望设备生成PWM,就可以在准备好进入睡眠时,禁用计时器并设置将睡眠模式返回到EXTED(为了在运行时更改睡眠模式,您可以使用ARCH_DISABLE_SLEEP()和ARCH_SET_EXTEDED_SLEEP())。
Thanks MT_dialog
Dear Dialog_support Team,
感谢您的答复。我根据您的建议配置了我的设备。现在我想知道,在睡眠模式下可以广告可以广告吗?如果是,则在代码中,如果从按钮或app没有任何中断,则将睡眠模式函数(API)。
Thanks and Regards,
Ruchi Patel
Hi Ruchi Patel,
当睡眠模式启用它意味着德维克e is capable of advertising and sleeping in between the advertising or the connection periods, when the device doesn't implement sleep it means that the device will stay awake even if there is no BLE activity. So in short, the when the 580 is in sleep mode it will wake up advertise and go back to sleep automatically. Regarding the question "where to put the sleep mode function (api)" i dont quite get it, apparently you would like to enable the PWM and keep the device awake for a certain period between two events, one that it will trigger the PWM event and one that will end the PWM and send the device back in sleep mode, so when the event is triggered you will disable the sleep and start the timer in PWM mode and when its over you will disable the PWM and send the device back to sleep.
Thanks MT_dialog
Dear Dialog_Support Team,
感谢您的快速答复。
1.您能否指导我,如果我的设备处于扩展睡眠模式和设备应始终广告。是否可以?如果设备始终广告,则功耗如何?
我正在使用加速度计传感器。传感器通过I2C与DA14580通信。每当有移动时,加速度计会导致控制器中断。理想情况下,控制器应从睡眠模式中唤醒,但在扩展睡眠模式下,控制器未接收来自加速度计的任何类型的中断。其在完全活动模式下工作正常。
3.当我按下按钮时,设备从睡眠模式唤醒,然后立即再次进入睡眠模式。由于此,我的蜂鸣器音没有正常工作。蜂鸣器戒指非常快。如何增加唤醒时间或者我想完成我的任务然后在任务结束时,设备再次进入睡眠模式。
带着敬意,
Ruchi Patel
Hi Ruchi Patel,
1)是的,存在是睡眠模式,并且可以唤醒广告,设备的电源增量取决于设备的广告频率(意味着唤醒和发送广告包的频率)。所以它取决于广告间隔,并且功耗的值不是固定的,你唤醒了你的功率越多。
2)为了从睡眠中唤醒,您必须配置唤醒定时器,这意味着您必须配置580的唤醒模块,以便从外部中断唤醒,而设备处于睡眠状态模式。您可以检查BLE_APP_SLEEPMODE项目,其中设备从通过按钮按下的外部中断从外部中断唤醒。在你醒来之后,你可以履行你想要的行动,宣传或阅读加速度计等。如果您正确配置了唤醒定时器,设备仍然没有醒来,那么您应该检查唤醒的手机发信号,也许是你有套装等的脱髓。
3)由于设备将通过外部中断唤醒它将检查是否有任何未决的BLE事件,如果没有任何情况,那么设备将重新睡眠,以防止设备返回睡眠状态,您可以刚刚调用ARCH_DISABLE_SLEEP()并保留设备唤醒,当它的时间返回睡眠时,您可以调用ARCH_SET_EXTEDDED_SLEEP()另一种方式是留下睡眠状态并防止设备往往通过在app_on_ble_powered()中应用一些自定义代码或在app_on_system_powered()回调中休眠,并在条件上返回Keep_powered(以防止设备进入睡眠)或Goto_Sleep(允许设备进入睡眠)。因此,只要您希望蜂鸣器响起,您可以保持设备唤醒,随时随地睡觉。
Thanks MT_dialog
Dear Dialog_support,
Thank you for your reply.
1)我明白这一点。我在我的应用程序代码中实现了这一点。即使在睡眠模式下,我也希望我的设备要做广告。所以它成功实施了。
2) I have implemented external interrupt same as ble_app_sleepmode example. But in my custom application, there is 3 different functionalities are implemented using single push button. For example, If push button is pressed for 3 times then functionality 'A' will run, if push button is long pressed for 3 seconds then functionality 'B' will run, if push button is pressed for 5 times then functionality 'C' will run. But i can generate external interrupt wake up for one functionality only although i wrote a code for 3 functionalities. Can you please help me out for this? Can you explain me more about how polarity and debouncing affect to sleep and wake up functionality.
3)是的我已经使用了这两个函数ARCH_DISABLE_SLEEP()和ACH_SET_EXTEDDE_SLEEP()唤醒设备并放置设备处于睡眠模式。
再次感谢您的乐于助人的回复。我面临一个问题。每当移动应用程序尝试连接到设备时(当设备处于睡眠模式时,设备处于睡眠模式及其广告时),设备无法平滑连接,这意味着它需要长时间连接,有时它会显示连接失败,断开连接。我的意思是它在睡眠模式下不顺利工作,因为它在活动模式下顺利工作。这可能是什么原因?我还配置了,每当应用程序连接到设备时,设备应从睡眠中唤醒,然后在设备断开连接时返回睡眠状态。
带着敬意,
Ruchi Patel
Hi Ruchi Patel,
Regarding the second question, sorry, i am not able to understand the question, yes you can implement a functionallity where you can track the time that a button is pressed, but from the previous post i understood that the device is not able to wake up via an interrupt from a sesnor, so what i can assume is that perhaps this has something to do either with the pollarity that the wake up timer has to track or due to the debouncing feature that the wakeup timer implements. You will be able to find more info regarding these settings in the UM-B-051 DA1458x Software Platform Refence.pdf in the drivers section paragraph 10.7 Wake-Up Timer.
睡眠模式和始终是关于设备的连接过程的活动模式之间没有区别,我的意思是中央将等待广告事件以启动连接过程,以及睡眠时的设备或设备没有,将以固定的连接间隔宣传,可以延迟连接过程是广告间隔很大的事实,这与睡眠模式无关。我建议在睡眠模式下运行某些对话框,然后在没有睡眠模式的情况下再次尝试,并检查您是否可以将这些示例复制为参考。
Thanks MT_dialog
Dear Dialog_support,
Thank you for your constant support. Now i am able to wake up the from the sleep using sensor interrupt. After configuring extended sleep mode, i have noticed that my custom application is not working smoothly as it was before. The issues i am facing are,
1. Smartphone's App is not getting connected easily with board (development kit or custom board). It shows status like "connecting", "connection fail", "Disconnected".
2. There is one push button used for my custom application. And i have configured that as i press push button, device should wake up from the sleep. But sometime after pressing push button, device is not waking up.
带着敬意,
Ruchi Patel
Hi Ruchi Patel,
Since your previous issue has been answered, please dont post additional questions in irrelevant forum topics, you can always create a new topic for your question.
Thanks MT_dialog