完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
您好,我使用PIC32 MZ2048 EFH和2.5.1i来产生3个相同频率(40kHz)和0到100%的脉冲。3个PWM是相同的。我把PWM放在OC3 OC4 OC5管脚上。像是在OCYPWM样本上做的,我配置了OC驱动器和timeR2。OC驱动器,但没有PWM的输出。有什么想法?谢谢
以上来自于百度翻译 以下为原文 Hi, I'm using a PIC32MZ2048EFH with HARMony 2.5.1 I would like to generate 3 PWM with the same frequency (40khz)and pulse from 0 to 100%. The 3 PWM are idenpendent. I put the PWM on the OC3 OC4 OC5 pins. Like it is made on the OC_PWM sample I configure the OC driver and the timer2. after this I start the OC drivers DRV_OC0_Start(); DRV_OC1_Start(); DRV_OC2_Start(); DRV_TMR0_Start(); But no PWM a the ouput. any ideas ? Thanks Attached Image(s) |
|
相关推荐
3个回答
|
|
|
也许:A)尝试:如果你正在使用一个BSP去掉它并定义在MHCB中新鲜的东西)尝试一个新的空项目:应用配置-&应用程序0 CFG & GT;生成应用程序代码& &驱动程序-GT;OC…它生成与和声版本相匹配的示例代码(我发现这比文档中的任何东西都好)。然后,再创建一个新的空项目,然后使用“超越比较”之类的东西来看看“生成应用程序代码-OC”发生了什么变化,也许这会带来一些启发。然后,你甚至可以做这3个任务,每一个不同的PWM只是为了看看它产生什么。C)尝试得到一个PWM开始第一。D)尝试:关闭:[ [计时器中断模式]尝试:改变计时器预分机到一些更高(我用256)f)确保你的OC引脚设置在PIN管理器)肯定没有加载OC引脚,直到你得到它的工作)检查勘误为您确切的ICI)尝试不同的引脚(即移动OC3到一个不同的引脚)。我发现了一些HW、Hyg和MHC bug,它阻止了一些引脚的功能。我确实在PIC32 MZ上工作,但是找不到我用保罗做的测试项目。
以上来自于百度翻译 以下为原文 Maybe: a) Try: If you are using a BSP get rid of it and define everything fresh in MHC b) Try with a fresh empty project: Application Configuration ->App 0 Cfg -> Generate App Code -> Drivers -> OC... It generates example code matched to the Harmony version (I find this better than anything in Documentation). After get that going then create another fresh empty project, Then use something like "Beyond Compare" to see what was changed by the "Generate App Code - OC", and maybe that will shed some light. Then maybe you can even do this for 3 Tasks, each with different PWM just to see what it generates. c) Try getting a single PWM going first. d) Try: Turn off: []Timer Interrupt Mode e) Try: Change the Timer Prescale to something higher (I used 256) f) Ensure you have the OC pins set in Pin Manager g) Ensure nothing loading OC pins till you get it working h) Check Errata for your exact IC i) Try different pins (i.e. Move OC3 to a different pin). I have found some HW, Harmony, and MHC bugs that block some functions on some pins. I did have it working on a PIC32MZ, but can't find the test project I did it with. Paul |
|
|
|
|
|
文档的卷V有一个代码应该是什么样子的示例(第4944页:启用故障的PWM模式)。我这样做对我起了作用。我只有一个PWM虽然(OC4)。
以上来自于百度翻译 以下为原文 Volume V of the documentation has an example for what the code should look like (page 4944: PWM Mode with Enabled Faults). I did it that way and it worked for me. I only had one PWM though (OC4). |
|
|
|
|
|
好吧,我已经让他们工作了。自从第一个作品正确,我只是增加了2个OC和和谐做所有的工作。
以上来自于百度翻译 以下为原文 Ok, I've made them working. Since the first works correctly, I've just to add 2 more OC and Harmony do all the job correclty. You add DRV_OC0_Start(); DRV_OC1_Start(); DRV_OC2_Start(); DRV_TMR0_Start(); PLIB_OC_PulseWidth16BitSet(OC_ID_5, 1000);//PWM 1 PLIB_OC_PulseWidth16BitSet(OC_ID_4, 1000);//PWM 2 PLIB_OC_PulseWidth16BitSet(OC_ID_3, 1000);//PWM 3 and everything works Thanks you |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:55 , Processed in 0.740457 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1617