完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好。微调PWM在我的PIC24FJ64 GC66上的应用时,我遇到了PWM时序的两种不同的描述。首先在“PIC24家庭手册第16部分输出比较”(WW1. Microchip .com/下载/ En/DeVicoDC/3706A。PDF)中,请参阅第25页的图16-19。家庭参考手册,部分输出与专用计时器比较(WW1. Microchip .com/下载/ En/DeViceOC/7000 05159A .pdf),请参阅第27页的图3-17。这两个都是相同的,应该是相同的。请看一下“OCx Pin”的定时,看看脉冲的起点(周期)。对于这些文件来说,它们是不同的。从每一个文档中提取哪一个时序图并不重要,它们都是相同的:脉冲起点,第一个1,第二个0。我想知道哪一个是正确的时序图。在第二个变型中,我不喜欢OCXR=1,得到2个周期的脉冲宽度,对于OCXR=0,脉冲宽度为0个周期,这意味着我不能获得宽度为1的脉冲。
以上来自于百度翻译 以下为原文 Hello everyone. While fine-tuning PWM in my application on PIC24FJ64GC006 I came across two different descriptions of PWM timing. First in "pic24 family manual section 16 output compare" (ww1.microchip.com/downloads/en/DeviceDoc/39706a.pdf), please see Figure 16-19 on page 25. Second in "dsPIC33/PIC24 Family Reference Manual, section Output Compare with Dedicated Timer" (ww1.microchip.com/downloads/en/DeviceDoc/70005159a.pdf) , please see Figure 3-17 on page 27. Those two are all about the same and should be identical. Please have a look at "OCx Pin" timing and see the starting points (in cycles) of a pulse. They are different for these documents. It doesn't really matter which timing diagram Figure you take from each document, they all differ in the same: the pulse starting point, which is 1 in first, and 0 in second. What I would like to know is which one is the correct timing diagram. What I don't like in second variant is that for OCxR=1 I get pulse width of 2 cycles, and for OCxR=0 I get pulse width of 0 cycles, which means I am unable to ever get a pulse of width 1. |
|
相关推荐
4个回答
|
|
谢谢你们的回应,我肯定错了,我希望我是错的。请你指出这两种模式,如果你知道的话,在每一种文件中描述哪种模式?我也一样。存在或不能够设置1%的占空比,但只有2-100%的循环不是一个大问题,该设备正在工作,PWM是PWM ing,事情可以被称为“完成”。但问题仍然没有答案,这使我感到不舒服。因此,问题仍然存在。如果我们看“PIC24家庭手册第16条输出比较”的图16-21(WW1. Microchip .com/下载/ En/DeVicoDC/3706A.PDF),很明显地观察到一个简单的规则:0下降EDG后的上升沿。在OCxR之后。通过这种方式,我可以设置PWM占空比从0到OCXRS,从而获得每一个之间的职责。但是如果我遵循图3-14的“DSPIC33/PIC24家庭参考手册,部分输出与专用计时器比较”(WW1. Microchip .com/下载/ En/DeViceOC/7000 05159A .pdf),则此规则被打破。上升沿是在0之前,而下降仍然是在OCXR之后。真正地?现在我该如何设定PWM到0的任务?如果我设定OCXR=0会发生什么?PWM定时是0还是1?好的,大概是0吧。因此,我得到了一系列实际的PWM任务可用:0, 2, 3,4,…OCxR,但不是1。这1点是我非常关注的问题。
以上来自于百度翻译 以下为原文 Thanks guys for your response @antipo Surely I could be wrong and I hope I am. Would you please point out those two modes and which one is described in each of these documents, if you know? @Nikolay_Po ***ривет нашим Yep, just the same with me. Being or not being able to set 1% of duty, but only 2-100% cycle is not a big problem, the device is working, pwm is pwm-ing and things could be referred to as "done". But the question is still unanswered and this makes me feel uncomfortable. So the question remains. If we look at Figure 16-21 of "pic24 family manual section 16 output compare" (ww1.microchip.com/downloads/en/DeviceDoc/39706a.pdf), a simple rule is obviously observed: rising edge after 0 falling edge after OCxR. This way i can set pwm duty from 0 to OCxRS and thus obtain each every duty in between. But if i follow Figure 3-14 of "dsPIC33/PIC24 Family Reference Manual, section Output Compare with Dedicated Timer" (ww1.microchip.com/downloads/en/DeviceDoc/70005159a.pdf), then this rule is broken. The rising edge is here BEFORE 0, and the falling is still AFTER the OCxR. Really? Now how am I supposed to set pwm to 0 duty? If I set OCxR=0 what will happen? Will it be 0 or 1 duty for pwm timing? Ok, probably that will become 0, i guess. So I get the following series of actual pwm duties available: 0, 2, 3, 4, .... OCxR, but no 1. This 1 is my very small concern. |
|
|
|
我所强调的一段文字不是一种不同的模式——它是一种不同的外设。检查你的芯片中的两个外设中的哪一个,并使用适当的文档。这就是为什么时序图和其他位不同的原因。
以上来自于百度翻译 以下为原文 The piece of text I have highlighted is not a different mode - it is a different peripheral. Check which of the two peripherals your chip has and use the appropriate document. That is why the timing diagram and other bits are different. |
|
|
|
如上所述。请再读一遍Antipo…事实上说。
以上来自于百度翻译 以下为原文 As above. Please read again what Antipo... actually said. |
|
|
|
我发现确保你拥有最适合你的设备的FRM部分的最新版本的最好方法是去Microchip网站上的设备页面。你不仅会发现数据表链接作为右上角附近的一个大红色按钮,如果你向下滚动到底部附近的“文档”项目,并扩展它,你就会看到数据表链接、勘误表链接和一系列FRM链接。对实际设备的正确FRM部分的苏珊。
以上来自于百度翻译 以下为原文 The best way I've found to make sure that you have the latest version of the correct FRM section that is appropriate for your device is to go to the devices page on the Microchip web site. Not only will you find the data sheet link as a big red button near the top right-hand corner, if you scroll down to the 'Documentation' item near the bottom and expand that, you will see the data sheet link, the errata link and a whole series of FRM links. Those last links will be to the latest version of the correct FRM section for the actual device. Susan |
|
|
|
只有小组成员才能发言,加入小组>>
5250 浏览 9 评论
2037 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2266 浏览 5 评论
791浏览 1评论
682浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
612浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
686浏览 0评论
584浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 13:50 , Processed in 1.490427 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号