完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
PWMblock上的数据表表示,pWMLRead COMPARATE()可以返回Uti8或UIT16。我只能让它返回UTIT8值,但是我需要它来回复UTIT16,我该怎么做?
PWM被设置为16位UDB。 以上来自于百度翻译 以下为原文 The data sheet on the PWM block says that the PWM_ReadCompare() can return either a uint8 or uint16. I can only get it to return a uint8 value, but I need it to returna uint16, how can I do this? The PWM is set as a 16-bit UDB |
|
相关推荐
6个回答
|
|
DS中存在一些“框图和配置”,这意味着生成。
API的返回正确值。API调用的SAMEIN描述。 快速测试编译器,返回到8位变量,就应该抱怨了。 问候,Dana。 以上来自于百度翻译 以下为原文 There is some verbiage in DS, under "Block Diagram and Configuration" that implies generated API's return correct vaule. Same in descriptions of API call. Quick test of compiler, return to an 8 bit variable, it should complain. Regards, Dana. |
|
|
|
是否有任何理由改变代码中PWM块的比较值和周期值将导致周期在达到期望值之前尖峰?
以上来自于百度翻译 以下为原文 Is there any reason that changing the compare value and period value of a PWM block in code will cause the period to spike before reaching the desired value? |
|
|
|
相信我,我们仍然不知道为什么E= IX R,为什么这是真实的。也没有其他解决办法。
我们不知道宇宙膨胀的速度为什么远离凝聚体的质量。我们认为 暗物质是一个用来描述我们不了解的物质的术语。 编译器。如果它是好的,发出警告,而不是错误。有时我也会有不同。 更改到Reg的编写、周期和比较,API描述没有显示任何副作用……?不知道什么 事实上正在发生。 问候,Dana。 以上来自于百度翻译 以下为原文 Trust me, we still do not know why E = I x R, why that is physically true. And can be no other solution. We do not know why the universe's rate of expansion is away from the mass that coeleseces it. We think it is dark matter, a convienent term to describe a prtoblem we do not understand. The compiler. if it is good, issues a warning, not an error. Sometimes the difference escapes me. Change to reg writes, period and compare, the API descriptions do not show any side effects......? Not sure whats actually happening. Regards, Dana. |
|
|
|
当当前PWM计数器高于新的比较值(取决于配置)时,改变比较值可以立即影响比较输出的状态(这也在数据表中说明)。在这种情况下,比较可能不会触发,PWM计数器在整个周期内运行,再次启动,然后触发比较。改变周期值不影响输出,因为它只在PWM计数器到达终端计数时才使用。
以上来自于百度翻译 以下为原文 Changing the compare value can immediately affect the state of the compare output (this is also stated in the data sheet), when the current PWM counter is above the new compare value (depending on the configuration). It might also be, in that case, that the comparision doesn't trigger, and the PWM counter runs for the full period, starts again and only then triggers the compare. CHanging the period value should not affect the output, as it is used only when the PWM counter reaches the terminal count. |
|
|
|
我想它可能有点像,如果我增加比较值中跑,因为它立即更新,它只是添加到我的信号已经很高。我只看到穗,当我增加,这是有道理的。是否有办法确保我只在脉冲结束时更新比较值和周期值。我想我可以使用一个中断和一个标志
以上来自于百度翻译 以下为原文 I figured it might have been something like if I increase the compare value mid run, since it updates immediately, it would just add on to my signal that was already high. I only see that spike when I increase so that makes sense. Would there be a way to make sure I only update my compare and period values at the end of a pulse. I guess I could use an interrupt and a flag |
|
|
|
虽然我忘了我看的输出通过一个非门,这意味着我的尖峰实际上是一个很长的低时间从PWM块。但问题仍然是相同的,也就是说,在完成前一次迭代之前,我正在重新设置比较值和周期值。
以上来自于百度翻译 以下为原文 Although I forgot I'm looking at the output through a NOT gate so that means my spike is really a long low time from the PWM block. But the problem remains the same, that is I'm resetting my compare and period values before they completed the previous iteration. |
|
|
|
只有小组成员才能发言,加入小组>>
749个成员聚集在这个小组
加入小组2054 浏览 1 评论
1809 浏览 1 评论
3621 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1746 浏览 6 评论
1499 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
483浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
336浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
400浏览 2评论
341浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
834浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-7 17:52 , Processed in 0.970759 second(s), Total 89, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号