完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我使用CYBLY-01400—00,我使用PWM模块(UDB)遇到了一些问题。我想使用PWM作为一个单触发触发的控制寄存器模块(即由固件触发),时钟使用的是LFCK在32.768千赫。 一切都在工作模式和睡眠模式良好,除非我使用了函数pWMySeLePe()和pMMWAWEKUP()。然后PWM停止工作。 我试着在PWMWAWEKUP()之后添加30US延迟,然后它就工作了!我可以用我的系统去睡觉和深度睡眠没有问题。 我的问题是:这是正常的吗?UDB模块(特别是PWM)唤醒后需要延迟吗?如果是的话,我在哪里可以看到规格?经过反复试验,我发现从睡梦中醒来后需要6微秒的延迟,从深度睡眠醒来后,需要40微秒。 谢谢您, 弗莱德 以上来自于百度翻译 以下为原文 Hi, I'm using the CYBLE-014008-00 and I've had some problems using a PWM module (UDB). I want to use the PWM as a single shot triggered by a Control Register module (i.e. triggered by firmware), and the clock used is LFCLK at 32.768 kHz. Everything was working fine in active mode and sleep mode, unless I used the functions PWM_Sleep() and PWM_Wakeup(). Then the PWM stopped working. I tried adding a 30us delay after PWM_Wakeup() and then it works! I can go to sleep and deepsleep with my system without problems. My question is: is this normal? Do the UDB modules (specifically the PWM) require a delay after waking up? If so, where can I see the specs? By trial and error, I found that I need ~6 microseconds delay after waking up from sleep, and ~40 microseconds after waking up from deep sleep. Thank you, Fred |
|
相关推荐
9个回答
|
|
我假设你的示意图如下。
请让我问几个问题。 1)控制寄存器的输出模式是什么?如果使用脉冲模式,什么提供给时钟输入? 2)控制寄存器组件具有睡眠/唤醒方法。你使用这些API吗?如果使用,这些API的调用顺序是什么? 当做, 诺里基 以上来自于百度翻译 以下为原文 I assumed that your schematic is as follows. Please let me ask some questions. 1) What is the output mode of the Control Register? If Pulse mode is used, what is provided to the clock input? 2) Control Register component has _Sleep/_Wakeup methods. Did you use these APIs? If you used, what is the calling order of these APIs? Regards, Noriaki |
|
|
|
你好, 你是正确的示意图,除了PWM是在16位只有一个输出,复位输入被迫在零。 控制Reg模式为同步模式,时钟为HFCLK/2。复位输入是PWM的TC输出。 顺序如下: 用WDT唤醒 PWMWAWEKUP(); CR1AWAKEUP(); CydelayUS(30); CR1-写(1); /做某事,现在准备睡觉 CR1X睡眠(); pMMLILSEP(); CysSpMyDeSLeLeP(); 我没有想到,但是控制权可能是罪魁祸首。然而,当我只测试睡眠(不是深度睡眠)时,我使用了控制Reg的API睡眠和唤醒功能,并且该系统运行良好。 谢谢你的时间, 弗莱德 以上来自于百度翻译 以下为原文 Hi, You're right for the schematic, except the PWM is in 16 bits with only one output, and the reset input is forced at zero. The Control Reg mode is Sync mode, and the clock is HFCLK/2. The reset input is the TC output of the PWM. The order is as follows: // Wake up with WDT PWM_Wakeup(); CR1_Wakeup(); CyDelayUs(30); CR1_Write(1); // Do something, now ready to sleep CR1_Sleep(); PWM_Sleep(); CySysPmDeepSleep(); I didn't think about it, but it's right that the Control Reg could be the culprit. However, when I was testing with only Sleep (not deep sleep), I used the API Sleep and Wakeup functions of the Control Reg, and the system worked well. Thank you for your time, Fred |
|
|
|
chm1 发表于 2018-12-14 14:23 谢谢你的澄清。看来,PWM组件不接受触发器,直到提供第一时钟边缘。如果问题是控制寄存器组件比PWM组件快,请尝试使用相同的时钟来控制寄存器和PWM组件。下面是我的解决方案。但我没有尝试,如果示意图工作得很好,因为我现在没有硬件。 LFCLK与24MHz(HFCLK/2)时钟同步,并驱动两个组件。控制寄存器配置为脉冲模式以产生单触发脉冲。 当做, 诺里基 以上来自于百度翻译 以下为原文 Thank you for clarification. It seems that the PWM component does not accept a trigger until the first clock edge is provided. If the problem is that the Control Register component is faster than the PWM component, please try to use same clock for the Control Register and the PWM components. Following figure is my solution. But I didn't try if the schematic works well because I have no hardware right now. The LFCLK is synchronized with the 24MHz (HFCLK/2) clock and drives both components. The Control Register is configured as the Pulse mode to generate a one-shot pulse. Regards, Noriaki |
|
|
|
numuwewr 发表于 2018-12-14 14:38 我相信睡眠/深度睡眠模式也关掉时钟以节省电力(取决于你的固件/代码)。潜在的,时钟还没有准备好使用/稳定? 我可能错了,但我认为这是值得思考的事情。 以上来自于百度翻译 以下为原文 I believe the sleep/deep sleep modes also turn off the clocks to save power (depending on your firmware/code). Potentially, the clocks aren't quite ready for use/stable? I'm probably wrong with this, but I figured it was something worth thinking about. |
|
|
|
numuwewr 发表于 2018-12-14 14:38 谢谢你的回答, 这绝对是可能的,下周我会尝试的!但是它不会导致和固件延迟一样的结果,更精确吗? 此外,增加同步块消耗更多的电流吗? 弗莱德 以上来自于百度翻译 以下为原文 Thanks for the answer, That definitely is possible, I will try that next week! But won't it result in the same result as just adding a delay in firmware, just more precise? Also, does adding the Sync block consume more current? Fred |
|
|
|
yuhe82 发表于 2018-12-14 14:44 睡眠模式没有,但深度睡眠确实关闭了高频时钟。但是,我没有使用与PWM相同的时钟的问题,所以我不认为问题是时钟。此外,在进入和退出深度睡眠时,我使用CcLogyDeabable()和CcLogyEnable(),并且我认为这些函数中的代码确保时钟是稳定的。 谢谢, 弗莱德 以上来自于百度翻译 以下为原文 The sleep mode doesn't, but deep sleep does turn off the high frequency clocks. However, I didn't have problems with a timer that uses the same clock as the PWM, so I don't think the problem is the clock. Also, I use Clock_Disable() and Clock_Enable() when entering and exiting deep sleep, and I think there's code in those functions that ensures that the clock is stable. Thanks, Fred |
|
|
|
是的,等待时钟稳定是固件延迟的一个原因。如果时间不同,那么你需要做一个更长的延迟,这并不总是必要的,但是这取决于时间和时间的变化。 同步块可能消耗一些功率,但我认为它会非常小;晶体管级的单与门将实现同步效应,并且只使用极小的功率。 (同步模块的文档应该提供更多关于功耗和规范的直接信息;右击该模块并选择打开的数据表选择)。 以上来自于百度翻译 以下为原文 Yeah, waiting for the clock to stabilize would be the same thing as a delay in firmware. If the timing varies, then you would need to make a longer delay that isn't always necessary, but that depends on if and how much the timing varies The Sync block might consume some power, but I would think it would be very small; A single AND gate at the transistor level would achieve the sync effect and would only use miniscule amounts of power. (The documentation for the sync module should give you more direct information on the power consumption and specifications; Right-click on the module and select the open datasheets selection) |
|
|
|
chm1 发表于 2018-12-14 15:08 你有没有试着为NIOKAI建议使用PWM和控制时钟相同的时钟? 以上来自于百度翻译 以下为原文 Have you tried putting the same clock for both the PWM and the Control_Reg as Noriaki suggested? |
|
|
|
还没有,我星期一就去。 以上来自于百度翻译 以下为原文 Not yet, I'll do it on Monday. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2075 浏览 1 评论
1829 浏览 1 评论
3645 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1766 浏览 6 评论
1517 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
516浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
370浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
413浏览 2评论
360浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
868浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 11:59 , Processed in 1.082679 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号