完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想使用PWM3来驱动一个电压来控制LED驱动芯片中的电流,但是没有出现在引脚上。我使用PPS模块将输出从PWM3指向RC3(RC3PPS= PWM3OUT;在PPS解锁和PPS锁之间),并且tiSISC被设置为0x04(我使用RC2作为一个比较器的输入)。TMR2=0x60;T2CKCONN=0x01;T2HLT=0x00;T2RST=0x00;T2TMR=0x00;T2CONTITES.TMR2ON=1;PWM3配置如下:PWM3CONC= 0x80;PWM3DCH=0x00;PWM3DCL=0x00;应用调整PWM3DCH和PWM3DCL以获得适当的输出电压。除了它没有。输出保持在0V。我已经检查了短路到地面。有没有其他地方我没有发现和配置的寄存器?
以上来自于百度翻译 以下为原文 I'm tring to use PWM3 to drive a voltage to control the current in an LED driver chip, but there's nothing appearing on the pin. I'm using the PPS module to point the output from PWM3 to RC3 ( RC3PPS = PWM3OUT; in between PPS unlock and PPS lock), and TRISC is set to 0x04 (I'm using RC2 as an input to one of the comparators). TMR2 is configured as follows: T2CON = 0x60; T2CLKCON = 0x01; T2HLT = 0x00; T2RST = 0x00; T2PR = 0xFF; T2TMR = 0x00; T2CONbits.TMR2ON = 1; PWM3 is configured as follows: PWM3CON = 0x80; PWM3DCH = 0x00; PWM3DCL = 0x00; The application adjusts PWM3DCH and PWM3DCL to get the appropriate output voltage, except that it doesn't. The output stays at 0V. I've checked for shorts to ground. Is there some other register somewhere that I haven't spotted and configured? |
|
相关推荐
2个回答
|
|
这是错误的--- PWM3OUT是PWM3CON(5)位的一个小定义。有时候,明显的答案不是正确的答案。你需要从数据表的PPS章节中获得价值:在PIC16F15355(和类似的)项目上测试了无数次。(在那里,做了它的疤痕,更不用说几根白发)。戴夫。
以上来自于百度翻译 以下为原文 That's wrong---PWM3OUT is a bit definition for bit 5 of PWM3CON (!) Sometimes the obvious answer is not the correct answer. You need the value from the PPS chapter of the data sheet: // From Table 15-5 of Data Sheet DS40001897A RC3PPS = 0x0B; //PWM3OUT value for PPS; Tested numerous times on several PIC16F15355 (and similar) projects. (Been there, done that, have the scars to show for it, not to mention a few gray hairs.) Regards, Dave |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 13:28 , Processed in 1.316583 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号