完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
你好,我想使用PWM故障3。我的PWM代码是工作的,但故障3针是3.3,当它没有故障3。
以上来自于百度翻译 以下为原文 hi, I want to use pwm fault3 . My pwm code is work but Fault 3 pin is 3.3 when it didn't fault 3 . this code : PTCONbits.PTEN =0; // ~~~~~~~~~~~~~~~~~~~~~~ PWM1 Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IOCON2bits.PENH = 0; // PWM1H is controlled by PWM module IOCON2bits.PENL = 0; IOCON3bits.PENH = 0; // PWM1H is controlled by PWM module IOCON3bits.PENL = 0; IOCON1bits.PENH = 1; // PWM1H is controlled by PWM module IOCON1bits.PENL = 1; // PWM1L is controlled by PWM module IOCON1bits.PMOD = 0; // Select Complementary Output PWM mode PWMCON1bits.ITB = 1; // PHASE1 provides the PWM time period value PWMCON1bits.CAM = 1; // Center-Aligned Mode PHASE1 = PWM1_PERIOD_VALUE; ALTDTR1 = PWM1_DEADTIME_VALUE; PDC1 = PWM1_INITIAL_VALUE; FCLCON1bits.FLTMOD = 3; //fault mode is disabled PTCON2 = 0; // FAULT FCLCON1bits.FLTMOD = 1; // PWM generator pins for FLTDAT values (cycle-by-cycle condition) FCLCON1bits.IFLTMOD = 0; // Normal Fault Mode FCLCON1bits.FLTSRC = 9; // Select fault source FLT3, FCLCON1bits.FLTPOL = 0; // Fault input pin is set to active-low //////// IOCON1bits.FLTDAT = 0; // Shuts down PWM1L and PWM1H signals to inactive state PWMCON1bits.FLTIEN = 1; /* Enable fault interrupt */ TRIG1 = 0; //Point at which the ADC module is to be triggered by primary PWM TRGCON1bits.TRGDIV = 0; // Trigger output divider set to trigger ADC on every trigger match event TRGCON1bits.TRGSTRT = 0; // First ADC trigger event occurs after ONE trigger match events PTCONbits.PTEN = 1; |
|
相关推荐
3个回答
|
|
|
在故障引脚上配置了数字输入缓冲区吗?还确保销处于三态。您的代码缺少两种设置(我不确定PIN 3是否具有模拟模式)。
以上来自于百度翻译 以下为原文 Have you configured digital input buffer on FAULT pin? Also ensure the pin is in tristate. Your code lacks both setups (I'm not sure pin 3 has analog mode though). |
|
|
|
|
|
|
|
|
|
|
|
对不起的。我忘了。我的芯片DSIC33 EP32 MC204。
以上来自于百度翻译 以下为原文 Sorry . I forgot it . My chip dsPIC33ep32mc204. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 07:19 , Processed in 0.728957 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
506