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.

F28035 ePWM占空比设置

Other Parts Discussed in Thread: CONTROLSUITE

如题,请问各位,F28035通过GPIO输出PWM波时如何设置波形的占空比(任意比例)?具体通过操作那个寄存器?有没有相关的例程?谢谢!

  • 你好,

    PWM占空比比较关键的寄存器有:

            EPwm1Regs.TBCTL.bit.CTRMODE,计数模式设置,通常有up和up-down模式;

            EPwm1Regs.TBPRD,计数周期设置,决定PWM的输出频率;

            EPwm1Regs.CMPA.half.CMPA,PWM电平变换的动作值,与动作方式一起决定占空比大小;

            EPwm1Regs.AQCTLA.bit.CAU,动作选择,计数到动作值是执行哪种动作,如置1或清零;

            EPwm1Regs.AQCTLB.bit.ZRO,动作选择,计数到零时执行哪种动作,如置1或清零;

    这些是计算占空比的几个关键寄存器,其他寄存器的设置也同样必不可少。

    例程你可以看controlSUITE中PWM控制LED灯闪烁的例程:

    C:\ti\controlSUITE\device_support\f2803x\v127\DSP2803x_examples_ccsv5\epwm_blanking_window

  • 谢谢,问题解决了~