This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RM48L952:将 PWM 占空比设置为0时出现问题

Guru**** 2485705 points
Other Parts Discussed in Thread: HALCOGEN

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/733922/rm48l952-problem-setting-pwm-duty-to-0

器件型号:RM48L952
主题中讨论的其他器件:HALCOGEN

在我的代码中、我已将其设置为用户输入来指示 PWM 信号的占空比。  

如果我执行与等效的操作

pwmSetDuty (hetRAM1、pwm0、100);
pwmSetDuty (hetRAM1、pwm0、 0); 

它将使占空比保持在100%。  

如果我执行以下操作-(在每个设定的占空比之间有间隔以查看变化)、每个占空比设置似乎都起作用。 换言之、问题似乎只是从100变为0:

pwmSetDuty (hetRAM1、pwm0、90);
pwmSetDuty (hetRAM1、pwm0、 0);
pwmSetDuty (hetRAM1、pwm0、100);
pwmSetDuty (hetRAM1、 pwm0、50);
pwmSetDuty (hetRAM1、pwm0、0);
pwmSetDuty (hetRAM1、pwm0、20);
pwmSetDuty (hetRAM1、pwm0、 0); 

我不能弄清楚这可能是什么原因。 在 HALCoGen 中、I 将周期设置为41.6us、并以低极性默认为0%。 如有任何建议,请提出