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.

TMS320F28035: PWM输出不按照设置改变

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

按照如图设置了epwm1的DC以及TZ模块,当COMP1OUT输出高电平时,EPWM1A输出低电平,EPWM1B输出高电平,但是现在COMP1OUT有输出了,但是EPWM1输出并未发生变化

  • 蓝色通道为GPIO20的输出(我复用了GPIO20看COMP1OUT的输出),黄色通道为EPWM1A(GPIO00)的输出

  • 1. DCxEVT1用于单次触发,DCxEVT2用于逐次触发;

    你选的是单次触发,所以只会触发一次。

    解决的方法就是将DCxEVT1修改为DCxEVT2

    2. 也可以试一下这个方法:

    红色部分注释掉,黄色部分替换为:

    Fullscreen
    1
    2
    EPwm1Regs.TZCTL.bit.DCAEVT1 = TZ_FORCE_LO;
    EPwm1Regs.TZCTL.bit.DCBEVT1 = TZ_FORCE_HI;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  •   您好,按照您说方法尝试了一下,EPWM1的输出还是没有任何变化,两种方法尝试代码如图

  • 有试过例程吗?

    C:\ti\c2000\C2000Ware_5_00_00_00\device_support\f2803x\examples\c28\epwm_dcevent_trip

    C:\ti\c2000\C2000Ware_5_00_00_00\device_support\f2803x\examples\c28\epwm_dcevent_trip_comp

    C:\ti\c2000\C2000Ware_5_00_00_00\device_support\f2803x\examples\c28\epwm_trip_zone

  • 昨天重新仿照例程编写了代码,当比较器高电平时,epwm1输出有了变化,但是epwm1的两相pwm都输出低电平了,我预想的是两路为互补输出,我比较器正向输入现在是用的一个直流源

  •  这是EPWM1的配置

  • 你把你的工程上传一下,我帮你看一下

  • 您好,因为其它代码涉及项目所以不能上传所有的代码。。但是我现在用TI的例程C:\ti\controlSUITE\device_support\f2803x\v130\DSP2803x_examples_ccsv5\epwm_dcevent_trip_comp,对其做一定配置后也不能实现我想要的效果

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //###########################################################################
    // Description:
    //! \addtogroup f2803x_example_list
    //! <h1>ePWM DC Event Trip Comparator (epwm_dcevent_trip_comp)</h1>
    //!
    //! In this example ePWM1 is configured for PWM Digital Compare Event
    //! Trip using Comparator1A and comparator1B pin inputs.
    //! DCAEVT1, DCBEVT1 events are triggered by increasing the voltage on
    //! COMP1B pin to be higher than that of COMP1A pin.
    //! In this example:
    //! - ePWM1 has DCAEVT1 and DCBEVT1 as one shot trip sources
    //! DCAEVT1 will pull EPWM1A high
    //! DCBEVT1 will pull EPWM1B low
    //!
    //! Initially make the voltage level at COMP1A to be higher than that of COMP1B.
    //! Increase voltage on inverting side of comparator(COMP1B pin) to trigger
    //! a DCAEVT1, and DCBEVT1. ePWM1 will react to DCAEVT1 and DCBEVT1 as a 1 shot
    //! trip. View the EPWM1A/B waveforms on an oscilloscope to see the effect of
    //! the events.
    //!
    //! \b External \b Connections \n
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 一步一步的调试,先不要添加TZ相关的代码,把正常的PWM波先调出来,再添加TZ相关的代码

  • 普通的PWM是正常的,添加TZ是为了配合控制才加上的,加上后无法实现想要的效果

  • 这里是1,使能OST