我们可以通过app_easy_timer替换timer0和timer2吗?

⚠️
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//www.xmece.com/support。We’ll be fixing bugs / optimising the searching and tagging over the coming days.
12 posts / 0 new
Last post
Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
我们可以通过app_easy_timer替换timer0和timer2吗?

亲爱的Dialog_Support团队,

I was using Timer0 and Timer2 in my application to play buzzer sound and to calculate push button pressed time. Now i want to add sleep modes in my application and after adding extended sleep mode, timers are not working properly. I have also read different Dialog's forum posts that Timer0 and Timer2 will not work with sleep modes. So can i replace both timers by app_easy_timer? And i have configured duty cycles in Timer0,2 to play buzzer sounds. So how to set duty cycle using app_easy_timer?

感谢致敬,
Ruchi Patel.

设备:
STS_Dialog (not verified)
嗨Ruchi Patel,

嗨Ruchi Patel,

定时器0和2是硬件定时器,因此它们具有生成脉冲宽度调制信号的能力,基于此功能可以产生蜂鸣声。没有选择用App_easy_Timer(软件计时器)替换这两个定时器中的一个

布罗尔,
STS_Dialog.

Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
亲爱的Dialog_Support团队,

亲爱的Dialog_Support团队,

对不起,我已经给了你对timer0,2的错误解释。

我希望我的设备处于睡眠模式,当按下按钮或应用程序没有任何中断时。在设备中断后,Timer0,2应该从睡眠中醒来,完成工作,然后再次睡觉。我不想在睡眠期间运行Timer0,2。所以有可能吗?

你能建议我的延长睡眠模式的任何好的和相关的例子吗?

先感谢您。

With regards,
Ruchi Patel.

mt_dialog.
Offline
最后一次露面:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ruchi Patel,

嗨Ruchi Patel,

大部分的例子运行在延长睡眠mode, if you would like an example that would run with a press of a button, for example be in sleep mode and as soon as the button is pressed or an interrupt occurs the device would wake up you can check the ble_app_sleepmode, the original configuration is for deep sleep but you can easily change that by changing the app_default_sleep_mode from ARCH_DEEP_SLEEP_ON to ARCH_EXT_SLEEP_ON and by changing the memory configuration to CFG_MEM_MAP_EXT_SLEEP. After doing that you can set up the timer in order to generate the pwm and disable the sleep in runtime as long as you would like the device to generate the PWM, as soon as you are ready to go to sleep, disable the timers and set back the sleep mode to exteded (in order to change the sleep modes during runtime you can use arch_disable_sleep() and arch_set_exteded_sleep()).

谢谢mt_dialog.

Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
亲爱的Dialog_Support团队,

亲爱的Dialog_Support团队,

感谢您的答复。我根据您的建议配置了我的设备。现在我想知道,在睡眠模式下可以广告可以广告吗?如果是,则在代码中,如果从按钮或app没有任何中断,则将睡眠模式函数(API)。

感谢致敬,
Ruchi Patel.

mt_dialog.
Offline
最后一次露面:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ruchi Patel,

嗨Ruchi Patel,

当启用睡眠模式时,它意味着当设备无法实现睡眠时,设备能够在广告或连接时段之间进行广告和睡眠,这意味着即使没有BLE活动,该设备也会保持醒索。所以简而言之,当580处于睡眠模式时,它将唤醒广告并自动睡觉。关于问题“将睡眠模式函数(API)”的问题“我不太明白,显然您想要启用PWM并保持设备在两个事件之间的某个时段内唤醒,其中一个会触发PWM事件并且一个将结束PWM并将设备发送回睡眠模式,因此当触发事件时,您将禁用睡眠并以PWM模式启动计时器,当其上方将禁用PWM并将设备发送回睡眠时。

谢谢mt_dialog.

Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
亲爱的Dialog_Support团队,

亲爱的Dialog_Support团队,

Thank you for your quick reply.

1.您能否指导我,如果我的设备处于扩展睡眠模式和设备应始终广告。是否可以?如果设备始终广告,则功耗如何?

我正在使用加速度计传感器。传感器通过I2C与DA14580通信。每当有移动时,加速度计会导致控制器中断。理想情况下,控制器应从睡眠模式中唤醒,但在扩展睡眠模式下,控制器未接收来自加速度计的任何类型的中断。其在完全活动模式下工作正常。

3.当我按下按钮时,设备从睡眠模式唤醒,然后立即再次进入睡眠模式。由于此,我的蜂鸣器音没有正常工作。蜂鸣器戒指非常快。如何增加唤醒时间或者我想完成我的任务然后在任务结束时,设备再次进入睡眠模式。

With Regards,
Ruchi Patel.

mt_dialog.
Offline
最后一次露面:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ruchi Patel,

嗨Ruchi Patel,

1)是的,存在是睡眠模式,并且可以唤醒广告,设备的电源增量取决于设备的广告频率(意味着唤醒和发送广告包的频率)。所以它取决于广告间隔,并且功耗的值不是固定的,你唤醒了你的功率越多。

2) In order to wake up from sleep you will have to configure the wake up timer, that means that you will have to configure the wake up module of the 580 in order to wake up from an external interrupt, while the device is in sleep mode. You can check the ble_app_sleepmode project where the device wakes up from an external interrupt emulated via a button press. After you are awake, then you can perform whatever actions you would like, advertise or read the accelerometer etc. If you have configured the wake up timer properly and the device still doesn't wake up, then you should check the pollarity of the wake up signal, perhaps the debouncing that you have set etc.

3)由于设备将通过外部中断唤醒它将检查是否有任何未决的BLE事件,如果没有任何情况,那么设备将重新睡眠,以防止设备返回睡眠状态,您可以刚刚调用ARCH_DISABLE_SLEEP()并保留设备唤醒,当它的时间返回睡眠时,您可以调用ARCH_SET_EXTEDDED_SLEEP()另一种方式是留下睡眠状态并防止设备往往通过在app_on_ble_powered()中应用一些自定义代码或在app_on_system_powered()回调中休眠,并在条件上返回Keep_powered(以防止设备进入睡眠)或Goto_Sleep(允许设备进入睡眠)。因此,只要您希望蜂鸣器响起,您可以保持设备唤醒,随时随地睡觉。

谢谢mt_dialog.

Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
亲爱的Dialog_Support,

亲爱的Dialog_Support,

感谢你的回复。

1) I understand this point. I have implemented this in my application code. I want my device to do advertising even when it is in sleep mode. So its successfully implemented.

2)我已经实现了与BLE_APP_SLEEPMODE示例相同的外部中断。但在我的自定义应用程序中,使用单个按钮实现了3个不同的功能。例如,如果按下按钮3次,那么功能'a'将运行,如果按钮长按3秒钟,那么功能'b'将运行,如果按下按钮5次,那么功能'c'将跑步。但是,我只能生成外部中断唤醒,只有我为3个功能编写了代码而仅为一个功能唤醒。你能帮我帮忙吗?你能更重要地解释我,了解极性和脱嘴如何影响睡眠和唤醒功能。

3) Yes i have used these 2 functions arch_disable_sleep() and arch_set_extended_sleep() to wake up the device and to put the device is in sleep mode.

Thank you again for your helpful reply. I am facing one issue. Whenever mobile application tries to connect to device(when device is in sleep mode and its advertising), device is not getting connected smoothly, means its taking long time to connect and sometimes it shows message like connection fail, disconnected. I mean its not working smoothly in sleep mode as it was working smoothly in active mode. What could be the reason for that? I have also configured that, whenever app connects to the device, device should wake up from sleep and then go back to sleep whenever device disconnects from app.

With Regards,
Ruchi Patel.

mt_dialog.
Offline
最后一次露面:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ruchi Patel,

嗨Ruchi Patel,

关于第二个问题,对不起,我无法理解这个问题,是的,你可以实现一个函数,你可以在哪里跟踪按下按钮的时间,但从上一个帖子我明白设备无法唤醒。设备无法唤醒通过来自SESNor的中断,所以我可以假设的是,也许这与唤醒定时器必须跟踪或由于唤醒定时器实现的替代功能的特征有关。您将能够在UM-B-051 DA1458X软件平台refence.pdf中找到有关这些设置的更多信息,请参见第10.7段唤醒定时器。

There is no difference between the sleep mode and always active mode regarding the connection procedure of a device, i mean that the central will be waiting for an advertising event in order to start the connection procedure, and the device, either when sleeping or when its not, will advertise in fixed connection intervals, what can delay the connection procedure is the fact that the advertising interval is large and this is irrellevant with the sleeping mode. I would recommend to run some dialog examples in sleep mode and then try again without the sleep mode, and check if you can replicate your issue having those examples as reference.

谢谢mt_dialog.

Ruchi Patel.
Offline
最后一次露面:2年6个月前
加入:2017-03-29 10:50
亲爱的Dialog_Support,

亲爱的Dialog_Support,

谢谢你的不断支持。现在我能够使用传感器中断唤醒睡眠状态。配置扩展睡眠模式后,我注意到我的自定义应用程序在之前的情况下不顺利工作。我面临的问题是,
1.智能手机的应用程序无法轻松连接电路板(开发套件或定制板)。它显示了“连接”,“连接失败”,“断开连接”的状态。
2.使用自定义应用程序有一个按钮。而且我已配置为我按下按钮,设备应该从睡眠中唤醒。但是在按下按钮后有时,设备不会醒来。

With Regards,
Ruchi Patel.

mt_dialog.
Offline
最后一次露面:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ruchi Patel,

嗨Ruchi Patel,

由于您之前的问题已得到解答,请不要在无关的论坛主题中发布其他问题,您可以随时为您的问题创建一个新主题。

  1. 难以连接的事实可能与许多因素有关,以及您的描述,我无法确定可能是问题。关于外围侧的连接过程大多数与广告相关,如果设备是广告,并且中央能够看到设备需要两个广告事件,以便连接过程启动。什么可以减慢连接过程是广告间隔,设备越频率越频越多,外围设备将与中央连接的越多。同样可以与电话或手机应用程序本身相关,并且在任何情况下都没有使您实现外部唤醒或通过计时器唤醒。
  2. 关于您的第二个问题,您必须调试这一点以弄清楚为什么会发生这种情况,检查中断是否每次按下按钮时会发生中断,可能对您的代码有一个条件,以防止启动通告命令发送到堆栈,如果未发生中断,请检查唤醒定时器是否始终正确配置(相同的极性和衰弱配置),如果发生在您的自定义板上可能与HW相关。

谢谢mt_dialog.