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.

TMS320F280025C: CMPSS触发TZ中断,可以单独关闭EPWMA,EPWMB吗?

Part Number: TMS320F280025C


CMPSS触发TZ中断,可以单独关闭EPWMA,EPWMB吗?我现在的代码会同时关闭EPWMA和EPWMB.我想单独关闭A或者B

{
    // Enable CMPSS and configure the negative input signal to come from the DAC
    CMPSS_enableModule(CMPSS3_BASE);
    // Use VDDA as the reference for the DAC and set DAC value to midpoint for arbitrary reference.
    CMPSS_configDAC(CMPSS3_BASE, CMPSS_DACREF_VDDA);

    ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_3, 3);//LDr2

    // Configure the output signals. Both CTRIPH will be fed by the asynchronous comparator output.
    //LDr1
    CMPSS_configHighComparator(CMPSS3_BASE, CMPSS_INSRC_DAC);              // Threshold drive by GPIO or input DAC
    CMPSS_setDACValueHigh(CMPSS3_BASE, max_dac_cmpss);                     // Define threshold
    CMPSS_configOutputsHigh(CMPSS3_BASE, CMPSS_TRIP_SYNC_COMP);            // Set output comparator (synchronous or asynchronous)
    //LDr2
    CMPSS_configLowComparator(CMPSS3_BASE, CMPSS_INSRC_DAC);               // Threshold drive by GPIO or input DAC
    CMPSS_setDACValueLow(CMPSS3_BASE, max_dac_cmpss);                      // Define threshold
    CMPSS_configOutputsLow(CMPSS3_BASE, CMPSS_TRIP_SYNC_COMP);             // Set output comparator (synchronous or asynchronous)

    // Configure TRIP to be CTRIP1H using the ePWM X-BAR. Attach CMPSS output to TRIPINx via EPWMXBAR module

    XBAR_setEPWMMuxConfig(XBAR_TRIP8, XBAR_EPWM_MUX05_CMPSS3_CTRIPL);//LDr2
    XBAR_enableEPWMMux(XBAR_TRIP8, XBAR_MUX05);//LDr2

    EPWM_selectDigitalCompareTripInput(base, EPWM_DC_TRIP_TRIPIN8, EPWM_DC_TYPE_DCBH);
    EPWM_setTripZoneDigitalCompareEventCondition(base, EPWM_TZ_DC_OUTPUT_B1, EPWM_TZ_EVENT_DCXH_HIGH);
    EPWM_setTripZoneAction(base, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);
    EPWM_enableTripZoneSignals(base, EPWM_TZ_SIGNAL_DCBEVT1);
    EPWM_forceTripZoneEvent(base,EPWM_TZ_FORCE_EVENT_DCBEVT1);
    EPWM_clearOneShotTripZoneFlag(base,EPWM_TZ_OST_FLAG_DCBEVT1);
    EPWM_clearTripZoneFlag(base, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_DCBEVT1));
}