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.

TMS320F28075: TI Trip Zone CBC problem

Part Number: TMS320F28075
Other Parts Discussed in Thread: SYSCONFIG

HI : 

    We are currently implementing a boost converter, which needs to clamp the PWMH Duty. At present, my method is to use the CMPSS module + EPWM XBAR + DC + tripzone CBC to complete it. However, after the CBC is triggered, the waveform at the end of the PWMH will have an additional wrong waveform. Type, the picture below is my F28075 sysconfig and experiment picture.

  • Poyi,

    I will forward this to our expert on F2807x EPWM. 

    Nima

  • Hi Poyi,

    Sorry I did not see the pulse that is being generated after the CBC trigger. 

    Could you also provide your SysConfig source code with just the PWM settings? I would like to see your AQ events etc and be able to run this on my end to see if I can replicate this.

    Best,

    Ryan Ma

  • HI Ryan

    Below picture is we want PWM wave and our pwm setting. THX~

      

        EPWM_setEmulationMode(myEPWM7_BASE, EPWM_EMULATION_FREE_RUN);	
        EPWM_setClockPrescaler(myEPWM7_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);	
        EPWM_setTimeBasePeriod(myEPWM7_BASE, 600);	
        EPWM_setTimeBaseCounter(myEPWM7_BASE, 0);	
        EPWM_setTimeBaseCounterMode(myEPWM7_BASE, EPWM_COUNTER_MODE_UP);	
        EPWM_disablePhaseShiftLoad(myEPWM7_BASE);	
        EPWM_setPhaseShift(myEPWM7_BASE, 0);	
        EPWM_setSyncOutPulseMode(myEPWM7_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_A, 600);	
        EPWM_setCounterCompareShadowLoadMode(myEPWM7_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_B, 48);	
        EPWM_setCounterCompareShadowLoadMode(myEPWM7_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_C, 181);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_D, 300);	
        EPWM_setActionQualifierT1TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierT2TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);	
        EPWM_setActionQualifierT1TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierT2TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_T1_COUNT_UP);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCAEVT1, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCAEVT2, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCBEVT1, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCBEVT2, EPWM_TZ_ACTION_DISABLE);	
        EPWM_enableTripZoneSignals(myEPWM7_BASE, EPWM_TZ_SIGNAL_DCAEVT2);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCAH);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCAL);	
        EPWM_setTripZoneDigitalCompareEventCondition(myEPWM7_BASE, EPWM_TZ_DC_OUTPUT_A2, EPWM_TZ_EVENT_DCXL_HIGH);	
        EPWM_setDigitalCompareEventSource(myEPWM7_BASE, EPWM_DC_MODULE_A, EPWM_DC_EVENT_1, EPWM_DC_EVENT_SOURCE_FILT_SIGNAL);	
        EPWM_setDigitalCompareEventSource(myEPWM7_BASE, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2, EPWM_DC_EVENT_SOURCE_FILT_SIGNAL);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCBH);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCBL);	
        EPWM_setDigitalCompareFilterInput(myEPWM7_BASE, EPWM_DC_WINDOW_SOURCE_DCAEVT2);	
        EPWM_enableDigitalCompareBlankingWindow(myEPWM7_BASE);	
        EPWM_setDigitalCompareBlankingEvent(myEPWM7_BASE, EPWM_DC_WINDOW_START_TBCTR_ZERO);	
        EPWM_setDigitalCompareWindowOffset(myEPWM7_BASE, 576);	
        EPWM_setDigitalCompareWindowLength(myEPWM7_BASE, 84);	
        EPWM_setDeadBandDelayPolarity(myEPWM7_BASE, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);	
        EPWM_setDeadBandDelayMode(myEPWM7_BASE, EPWM_DB_RED, true);	
        EPWM_setRisingEdgeDelayCount(myEPWM7_BASE, 12);	
        EPWM_setDeadBandDelayMode(myEPWM7_BASE, EPWM_DB_FED, true);	
        EPWM_setFallingEdgeDelayCount(myEPWM7_BASE, 12);	
        EPWM_setDeadBandOutputSwapMode(myEPWM7_BASE, EPWM_DB_OUTPUT_A, true);	
        EPWM_setDeadBandOutputSwapMode(myEPWM7_BASE, EPWM_DB_OUTPUT_B, true);	
        EPWM_enableInterrupt(myEPWM7_BASE);	
        EPWM_setInterruptSource(myEPWM7_BASE, EPWM_INT_TBCTR_U_CMPD);	
        EPWM_setInterruptEventCount(myEPWM7_BASE, 1);	
        EPWM_enableADCTrigger(myEPWM7_BASE, EPWM_SOC_A);	
        EPWM_setADCTriggerSource(myEPWM7_BASE, EPWM_SOC_A, EPWM_SOC_TBCTR_U_CMPC);	
        EPWM_setADCTriggerEventPrescale(myEPWM7_BASE, EPWM_SOC_A, 1);	

  • Hi Poyi,

    When are you clearing the cycle by cycle trip zone flag? 

    Could you set an outputxbar for EXTSYNCOUT of the PWM module on the scope to see when TBCTR reaches 0 or PRD or CMPA and send that along with those output signals you sent originally?

    Best,

    Ryan Ma

  • HI Ryan

       1. Our program clean CBC trip zone flag when TBPRD zero.

       2. below pic is outputxbar,but it always pull high.

  • Hi Poyi,

    Within your SysCfg, you have enabled CMPD to trigger an ISR. Are you doing anything to affect the outputs within this ISR?

    Also I have editted the scope picture you gave me, do these markings I have labeled look correct? You swapped the outputs of 1A and 1B. So your orange waveform is 1B, and your green waveform is 1A correct? There seems to be something going on before CMPA that is causing the output to go high again and then low. I want to make sure I understand your waveform first. Your blanking window starts at TBCTR = 0, then it is offset to start blanking around CMPA. 576 + 84 TBCLK counts. I am wondering if you change the offset for your blanking window to see if this pulse gets moved? Are you using a custom PCB, CC, or launcpad?

    Best,

    Ryan Ma

  • HI Ryan : 

    Sorry that my previous description was not clear enough, I re-did the experiment.

    CMPD is only used for trigger CLA task and has no other purpose.

    We implement diode emulation. The figure below shows the actual waveform of our experiment. PWMA and PWMB pass through the output swap of the DB module, so the A and B outputs are swapped. The value set by our blanking window is dynamically adjusted, Blanking time = CMPA point+84. The purpose of the experiment is to turn off the PWMB output when the inductor current is lower than 5A, but a wrong waveform will appear at the end of each PWM cycle.

    As shown in the picture below, the wrong waveform position is exactly 200ns set by DEADBAND, you can help me to confirm whether it is deadband causing PWM error or I have some wrong settings, thank you.


  • Hi Poyi,

    Could you increase the deadband from 200ns to 300ns to see if this moves this pulse occurring at the deadband? If so, then it is most likely something to do with deadband and we can move from there. 

    Otherwise if this doesn't move the pulse being generated, we can look into other possibilities.

    Are you using a launchpad or controlCARD?

    Best,

    Ryan Ma

  • HI Ryan:

    We use custom PCB.

    Below pic I increase the deadband from 200ns to 400ns.

    I think is deadband module problem.

  • Hi Poyi, 

    This seems to be some type of configuration issue because PWM7A and EPWM10A seem to have no issue. If you disable deadband, do you still get these same jitters? I want to just verify that this is indeed dead band. If you enable it back, does the incorrect pulse come back?

    Best,

    Ryan Ma

  • HI Ryan

    Since PWMA is the source of deadband module, PWMB deducts deadband from PWMA to generate PWM wave, so it causes wrong PWM waveform, because I don’t have EVM board at hand, can you help me use EVM board to help me experiment with my situation?

  • Hi Poyi,

    Yes I will test this and see if I am able to replicate this issue.

    Best,

    Ryan Ma

  • Hi Poyi,

    I have tried to copy your SysConfig code generation and I noticed you had CMPA and TBPRD equal to 600. Was this a typo? Could you instead attach your entire sysconfig source code or email the sysconfig source code to me?

    r-ma2@ti.com

    Best,

    Ryan Ma

  • HI Ryan

    The following code is our sysconfig file board.c board.h, please help us to solve this problem, thank you.

    board.c

    /*
     * Copyright (c) 2020 Texas Instruments Incorporated - http://www.ti.com
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    
    #include "board.h"
    
    void Board_init()
    {
    	EALLOW;
    
    	PinMux_init();
    	SYNC_init();
    	CMPSS_init();
    	EPWM_init();
    	EPWMXBAR_init();
    
    	EDIS;
    }
    
    void PinMux_init()
    {
    	//
    	// EPWM7 -> myEPWM7 Pinmux
    	//
    	GPIO_setPinConfig(GPIO_12_EPWM7A);
    	GPIO_setPinConfig(GPIO_13_EPWM7B);
    
    }
    
     
    void CMPSS_init(){
    
    	//myCMPSS0 initialization
    	// Sets the configuration for the high comparator.
    	CMPSS_configHighComparator(myCMPSS0_BASE,(CMPSS_INSRC_DAC | CMPSS_OR_ASYNC_OUT_W_FILT));
    	// Sets the configuration for the high comparator.
    	CMPSS_configLowComparator(myCMPSS0_BASE,(CMPSS_INSRC_DAC | CMPSS_INV_INVERTED | CMPSS_OR_ASYNC_OUT_W_FILT));
    	// Sets the configuration for the internal comparator DACs.
    	//  - ePWM module must be configured before using here.
    	CMPSS_configDAC(myCMPSS0_BASE,(CMPSS_DACVAL_PWMSYNC | CMPSS_DACREF_VDDA | CMPSS_DACSRC_SHDW));
    	// Sets the value of the internal DAC of the high comparator.
    	CMPSS_setDACValueHigh(myCMPSS0_BASE,620U);
    	// Sets the value of the internal DAC of the low comparator.
    	CMPSS_setDACValueLow(myCMPSS0_BASE,124U);
    	//  Configures the digital filter of the high comparator.
    	CMPSS_configFilterHigh(myCMPSS0_BASE, 0U, 1U, 1U);
    	// Configures the digital filter of the low comparator.
    	CMPSS_configFilterLow(myCMPSS0_BASE, 0U, 1U, 1U);
    	// Sets the output signal configuration for the high comparator.
    	CMPSS_configOutputsHigh(myCMPSS0_BASE,(CMPSS_TRIPOUT_ASYNC_COMP | CMPSS_TRIP_SYNC_COMP));
    	// Sets the output signal configuration for the low comparator.
    	CMPSS_configOutputsLow(myCMPSS0_BASE,(CMPSS_TRIPOUT_ASYNC_COMP | CMPSS_TRIP_SYNC_COMP));
    	// Sets the comparator hysteresis settings.
    	CMPSS_setHysteresis(myCMPSS0_BASE,1U);
    	// Configures the comparator subsystem's ramp generator.
    	CMPSS_configRamp(myCMPSS0_BASE,0U,0U,0U,1U,true);
    	// Disables reset of HIGH comparator digital filter output latch on PWMSYNC
    	CMPSS_disableLatchResetOnPWMSYNCHigh(myCMPSS0_BASE);
    	// Disables reset of LOW comparator digital filter output latch on PWMSYNC
    	CMPSS_disableLatchResetOnPWMSYNCLow(myCMPSS0_BASE);
    	// Configures whether or not the digital filter latches are reset by PWMSYNC
    	CMPSS_configLatchOnPWMSYNC(myCMPSS0_BASE,false,false);
    	// Enables the CMPSS module.
    	CMPSS_enableModule(myCMPSS0_BASE);
    	// Delay for CMPSS DAC to power up.
    	DEVICE_DELAY_US(500);
    }
    void EPWM_init(){
        EPWM_setEmulationMode(myEPWM7_BASE, EPWM_EMULATION_FREE_RUN);	
        EPWM_setClockPrescaler(myEPWM7_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);	
        EPWM_setTimeBasePeriod(myEPWM7_BASE, 600);	
        EPWM_setTimeBaseCounter(myEPWM7_BASE, 0);	
        EPWM_setTimeBaseCounterMode(myEPWM7_BASE, EPWM_COUNTER_MODE_UP);	
        EPWM_disablePhaseShiftLoad(myEPWM7_BASE);	
        EPWM_setPhaseShift(myEPWM7_BASE, 0);	
        EPWM_setSyncOutPulseMode(myEPWM7_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_A, 30);	
        EPWM_setCounterCompareShadowLoadMode(myEPWM7_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_B, 48);	
        EPWM_setCounterCompareShadowLoadMode(myEPWM7_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_C, 181);	
        EPWM_setCounterCompareValue(myEPWM7_BASE, EPWM_COUNTER_COMPARE_D, 300);	
        EPWM_setActionQualifierT1TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierT2TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);	
        EPWM_setActionQualifierT1TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierT2TriggerSource(myEPWM7_BASE, EPWM_AQ_TRIGGER_EVENT_TRIG_DCA_2);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);	
        EPWM_setActionQualifierAction(myEPWM7_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCAEVT1, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCAEVT2, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCBEVT1, EPWM_TZ_ACTION_DISABLE);	
        EPWM_setTripZoneAction(myEPWM7_BASE, EPWM_TZ_ACTION_EVENT_DCBEVT2, EPWM_TZ_ACTION_DISABLE);	
        EPWM_enableTripZoneSignals(myEPWM7_BASE, EPWM_TZ_SIGNAL_DCAEVT2);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCAH);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCAL);	
        EPWM_setTripZoneDigitalCompareEventCondition(myEPWM7_BASE, EPWM_TZ_DC_OUTPUT_A2, EPWM_TZ_EVENT_DCXL_HIGH);	
        EPWM_setDigitalCompareEventSource(myEPWM7_BASE, EPWM_DC_MODULE_A, EPWM_DC_EVENT_1, EPWM_DC_EVENT_SOURCE_FILT_SIGNAL);	
        EPWM_setDigitalCompareEventSource(myEPWM7_BASE, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2, EPWM_DC_EVENT_SOURCE_FILT_SIGNAL);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCBH);	
        EPWM_selectDigitalCompareTripInput(myEPWM7_BASE, EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCBL);	
        EPWM_setDigitalCompareFilterInput(myEPWM7_BASE, EPWM_DC_WINDOW_SOURCE_DCAEVT2);	
        EPWM_enableDigitalCompareBlankingWindow(myEPWM7_BASE);	
        EPWM_setDigitalCompareBlankingEvent(myEPWM7_BASE, EPWM_DC_WINDOW_START_TBCTR_ZERO);	
        EPWM_setDigitalCompareWindowOffset(myEPWM7_BASE, 576);	
        EPWM_setDigitalCompareWindowLength(myEPWM7_BASE, 86);	
        EPWM_setDeadBandDelayPolarity(myEPWM7_BASE, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);	
        EPWM_setDeadBandDelayMode(myEPWM7_BASE, EPWM_DB_RED, true);	
        EPWM_setRisingEdgeDelayCount(myEPWM7_BASE, 12);	
        EPWM_setDeadBandDelayMode(myEPWM7_BASE, EPWM_DB_FED, true);	
        EPWM_setFallingEdgeDelayCount(myEPWM7_BASE, 12);	
        EPWM_setDeadBandOutputSwapMode(myEPWM7_BASE, EPWM_DB_OUTPUT_A, true);	
        EPWM_setDeadBandOutputSwapMode(myEPWM7_BASE, EPWM_DB_OUTPUT_B, true);	
        EPWM_enableInterrupt(myEPWM7_BASE);	
        EPWM_setInterruptSource(myEPWM7_BASE, EPWM_INT_TBCTR_U_CMPD);	
        EPWM_setInterruptEventCount(myEPWM7_BASE, 1);	
        EPWM_enableADCTrigger(myEPWM7_BASE, EPWM_SOC_A);	
        EPWM_setADCTriggerSource(myEPWM7_BASE, EPWM_SOC_A, EPWM_SOC_TBCTR_U_CMPC);	
        EPWM_setADCTriggerEventPrescale(myEPWM7_BASE, EPWM_SOC_A, 1);	
    }
    
    void EPWMXBAR_init(){
    	//myEPWMXBAR0 initialization
    		
    	XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX07_CMPSS4_CTRIPL);
    	XBAR_enableEPWMMux(XBAR_TRIP4, XBAR_MUX07);
    
    }
    void SYNC_init(){
    	SysCtl_setSyncOutputConfig(SYSCTL_SYNC_OUT_SRC_EPWM7SYNCOUT);
    	// For EPWM1, the sync input is: SYSCTL_SYNC_IN_SRC_EXTSYNCIN1
    	SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM4, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);
    	SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM7, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);
    	SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM10, SYSCTL_SYNC_IN_SRC_EPWM7SYNCOUT);
    	SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_ECAP1, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);
    	SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_ECAP4, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);
    	// SOCA
    	SysCtl_enableExtADCSOCSource(0);
    	// SOCB
    	SysCtl_enableExtADCSOCSource(0);
    	SysCtl_lockSyncSelect();
    }
    

    board.h

    /*
     * Copyright (c) 2020 Texas Instruments Incorporated - http://www.ti.com
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    
    #ifndef BOARD_H
    #define BOARD_H
    
    //
    // Included Files
    //
    
    #include "driverlib.h"
    #include "device.h"
    
    #define GPIO_PIN_EPWM7A 12
    #define GPIO_PIN_EPWM7B 13
    
    #define myCMPSS0_BASE CMPSS4_BASE
    
    #define myEPWM7_BASE EPWM7_BASE
    
    void	Board_init();
    void	CMPSS_init();
    void	EPWM_init();
    void	EPWMXBAR_init();
    void	SYNC_init();
    void	PinMux_init();
    
    #endif  // end of BOARD_H definition
    

  • I will take a look into this and get back to you tomorrow.

    Best,

    Ryan Ma