完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
亲爱的,我已经产生PWM和闪光到控制器,但是我看不到输出上的各个引脚上的示波器。我已经产生了手写代码相同,我可以看到在示波器输出。当我比较了PTER的寄存器设置时,CLKDIV、PWMCON等不同于自动生成的代码。我的目标是从微芯片块中生成自动代码,并用它来查看示波器上的PWM。控制器使用的是DSPIC33 FJ32 202,FCY=10MHz,PWM=20kHz,PWM INT-PROGO-GT;4,死区时间1.16μs。端口引脚启用-RB12(PWMH)。我尝试启用OC和IC模块,但是我不确定模型中的设置,因此不能成功。我使用正弦查找表来生成PWM,正如鲁宾的一个论坛所建议的。谁能帮我解决这个问题?如果有人使用SIMULINK实现PWM,并在控制器上观察输出,请分享。谢谢。
以上来自于百度翻译 以下为原文 Dear All, I have generated PWM and flashed to the controller, however I couldnt see the output on the respective pins on the oscilloscope. I have generated hand written code for the same and I could see outpt on oscilloscope. When I compared the register settings of PTER, CLKDIV,PWMCON etc differs from that of auto generated code. My aim is to generate auto code from the Microchip blocksets and flash it to view the PWM on oscilloscope. Controller used is dsPIC33fJ32202, Fcy = 10Mhz, PWM = 20Khz, PWM int prio-> 4, dead time - 1.16µs. Port pins enabled - RB12(PWMH). I tried to enable OC and IC module but I am not sure about the settings in the model so couldnt succeed with it. I used sine Look up table to generate PWM as suggested by one of Lubin's forum. Could anybody help me to overcome the issue? kindly share if anybody have implemented the PWM using simulink and observed the output on controller. Thanks in advance. |
|
相关推荐
6个回答
|
|
嗨,请更正你的帖子1,DSPIC33 FJ32 202不存在…问候
以上来自于百度翻译 以下为原文 Hi, Please correct your post #1, the dsPIC33fJ32202 does not exist... Regards |
|
|
|
你好,RISC,谢谢。我在这里修正DSPIC控制器。其DSPIC33 FJ32 MC202。
以上来自于百度翻译 以下为原文 Hello RISC, Thank you. I correct the dsPIC controller here. Its dsPIC33FJ32MC202. |
|
|
|
Amika,请看一下这个线程及其链接和参考文档。我敢打赌,在端口输入上有一个整数的缩放问题。HTTP://www. MigCHIP.COM/FUMMS/FUNDSPE/945 120,如果它仍然不好,请张贴您的模型或屏幕截图。鲁宾。
以上来自于百度翻译 以下为原文 Aemika, Please have a look on that thread and its links and reference doc. I bet you have a problem with the scaling of integer at port input. http://www.microchip.com/forums/FindPost/945120 If it is still not Ok, please post your model or a screenshot of it. Lubin |
|
|
|
嗨,鲁宾,我没有什么结果,但没有预料到。我在MPLAB编写了应用程序代码,运行良好。我已经附加了我的模型分型PWM和代码生成的快照。我已经把代码GEPWM的PWM命名为ExpEdTyxXX.JPEG。我也附上了一个模型截图。正弦LUT从32767到32767不等,有4000个样本,具有相移。我尝试了两种不同的方式,但是我不理解偏置块背后的真正内涵(我在论坛中遵循例子)。我可以产生正弦变化的PWM,但存在不连续性(我不知道原因)在一种情况下,在另一种情况下它是连续的,但不是周期性的(随机变化)。我希望不断改变中心对齐正弦PWM如预期情节。请引导我通过这一点。
以上来自于百度翻译 以下为原文 Hi Lubin, I got few results but not as expected. I have written code in MPLAB for the application and works well. I have attached snaps of both my model genrated PWM and code generated ones. i have named code genrated PWM as Expected_xxx.jpeg. I have attached a screenshot of model too. The sine LUT is varying from 32767 to -32767 having 4000 samples and with phase shift. I tried two different ways as seen however I don understand the real intension behind bias block(I followed due to examples in forum). I could generate sinusoidally varying PWM but there is discontinuity( I donot know the reason) in one case and in another it is continuous but not periodic(randomly varies). I would like to have continously varying centre aligned sine PWM as in expected plots. Please guide me through this. Attached Image(s) |
|
|
|
Aemika,我怀疑PWM块输入的增益问题。当你模拟这个模型时,PWM范围显示PWM块输入。它应该显示0和pWM1MAX之间的值。如果使用死区,您可能必须减少范围(从+X到PWM1MAX-X)鲁宾。
以上来自于百度翻译 以下为原文 Aemika, I suspect an issue with the gain used for the PWM block input. When you simulate this model, the PWM scope shows the PWM block input. It should show values between 0 and PWM1max. If you use dead time, you might have to reduce the range (from +X to PWM1max-X) Lubin |
|
|
|
你好,鲁宾,谢谢你的更新。它现在起作用了。这是关于块内增益的再次缩放问题。
以上来自于百度翻译 以下为原文 Hello Lubin, Thank You for the update. It works now. It was again scaling issue with respect to gain within the block. |
|
|
|
只有小组成员才能发言,加入小组>>
5158 浏览 9 评论
1997 浏览 8 评论
1926 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3169 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2222 浏览 5 评论
723浏览 1评论
606浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
494浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
620浏览 0评论
519浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 11:25 , Processed in 1.204142 second(s), Total 58, Slave 51 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号