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.

TMS320F28P650DK: How to route CMPSS2_CTRIPH to EPWM1 trip zone signal

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: TIDM-02014, SYSCONFIG

Hi Sir/Madam,

I have tested the comparator in CMPSS block. I am able to get CMPSS  analog comparator to generate CTRIPH and CTRIPOTH. How to connect CTRIPH to trip 1 to 15, to EPWM for Over current kind of protetction.

Thanks and Regards,

Prashant Gugle

  • Hi Prashant,

    There is no direct path from the CMPSS to the trip zone submodule — you must route through the ePWM X-BAR and Digital Compare submodule [1][2]. Here's the complete signal chain:

    Signal Routing Path

    CMPSS2_CTRIPH → ePWM X-BAR (MUX) → TRIP4 → Digital Compare (DCAH) → DCAEVT1 → Trip Zone → Force EPWM1 outputs safe

    Step-by-Step Configuration

    1. Configure the ePWM X-BAR

    Route CMPSS2_CTRIPH to one of the trip inputs (TRIP4–TRIP12). For CMPSS2, use the appropriate MUX position from the ePWM X-BAR Mux Configuration Table in the TRM [3][4]:

    // Route CMPSS2_CTRIPH to EPWM X-BAR TRIP4
    XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX02_CMPSS2_CTRIPH);
    XBAR_enableEPWMMux(XBAR_TRIP4, XBAR_MUX02);
    Important for F28P65x: This device requires explicit EPWM X-BAR configuration — unlike some other C2000 devices, the crossbar connection is not implicit [5].

    2. Configure EPWM1's Digital Compare Submodule

    Select TRIP4 as the Digital Compare A High (DCAH) input and define the event condition [6][7]:

    // Select TRIP4 as DCAH input via trip combination
    EPWM_selectDigitalCompareTripInput(EPWM1_BASE,
    EPWM_DC_TRIP_TRIPIN4, EPWM_DC_TYPE_DCAH);
    
    // Define DCAEVT1: trigger when DCAH goes high
    EPWM_setTripZoneDigitalCompareEventCondition(EPWM1_BASE,
    EPWM_TZ_DC_OUTPUT_A1, EPWM_TZ_EVENT_DCXH_HIGH);

    3. Configure the Trip Zone Submodule

    Set the trip zone to respond to DCAEVT1 with a one-shot trip (appropriate for overcurrent protection) [8]:

    // Enable DCAEVT1 as one-shot trip source
    EPWM_enableTripZoneSignals(EPWM1_BASE, EPWM_TZ_SIGNAL_DCAEVT1);
    
    // Set action: force EPWM1A and EPWM1B low on trip
    EPWM_setTripZoneAction(EPWM1_BASE,
    EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);
    EPWM_setTripZoneAction(EPWM1_BASE,
    EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);

    Summary Table

    Step
    Module
    Register/API
    Purpose
    1
    ePWM X-BAR
    XBAR_setEPWMMuxConfig()
    Map CMPSS2_CTRIPH → TRIP4
    2
    Digital Compare
    EPWM_selectDigitalCompareTripInput()
    TRIP4 → DCAH
    3
    Digital Compare
    EPWM_setTripZoneDigitalCompareEventCondition()
    DCAH high → DCAEVT1
    4
    Trip Zone
    EPWM_enableTripZoneSignals()
    DCAEVT1 triggers one-shot trip
    5
    Trip Zone
    EPWM_setTripZoneAction()
    Force outputs low

    This creates a fast, hardware-based protection path that forces PWM outputs to a safe state immediately when the comparator detects overcurrent — no CPU intervention required [9]. Reference design TIDM-02014 provides a complete implementation example [10].


    To help refine this recommendation, it would be helpful to know:

    • Whether you need one-shot (latched until software clears) or cycle-by-cycle (auto-clears each PWM cycle) trip behavior
    • The desired output state on trip (force low, force high, or high-impedance)
    • Whether you're using SysConfig or direct register/API configuration

    1. TMS320F28P65x TRM - CMPSS Block Diagram
    2. SPRAD12A - Routing CMPSS to Trip Zone
    3. TMS320F28P65x Datasheet - CMPSS Connectivity
    4. SPRACY3 - CMPSS to EPWM X-BAR Configuration
    5. E2E - F28P65x requires explicit EPWMXBAR configuration
    6. TMS320F28P65x TRM - Digital Compare Submodule
    7. C2000 Academy - ePWM Module
    8. TMS320F28P65x TRM - Trip Zone Submodule
    9. SPRACX0 - X-BAR and ePWM DC Module Interface
    10. E2E - CMPSS to PWM XBAR routing for trip zones

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,

    Thanks for so much detailed reply. I could follow it and it worked.

    Later on we may think of cycle by cycle trip, for peak current mode control using CMPSS.

    Thanks and Regards,

    Prashant Gugle

  • Hi Zackary,

    I am answering your questions, please see reply in green.

    • Whether you need one-shot (latched until software clears) or cycle-by-cycle (auto-clears each PWM cycle) trip behavior

                 For evaluation purpose one-shot is okay, later on we may think of cycle by cycle for PSFB control

    • The desired output state on trip (force low, force high, or high-impedance)

             The desired output state on trip is force low

    • Whether you're using SysConfig or direct register/API configuration

              I am using SysConfig for configuration

    Thanks and Regards,

    Prashant Gugle

  • Hi Prashant,

    Glad the configuration worked. :)

    Based on your follow-up answers, here's a summary of your current setup and guidance for your future cycle-by-cycle implementation.

    Current Configuration (Confirmed Working)

    Your one-shot trip with force-low output via SysConfig follows the correct signal chain:

    CMPSS2_CTRIPH → ePWM X-BAR (TRIP4) → Digital Compare (DCAH → DCAEVT1) → Trip Zone (One-Shot, Force Low)

    This creates a hardware-based overcurrent protection path that forces PWM outputs low immediately—no CPU intervention required [1][2][3].

    Critical F28P65x note: This device requires explicit EPWMXBAR configuration in SysConfig. Unlike other C2000 devices, the crossbar connection is not implicit—if you ever port to another project, ensure the EPWMXBAR instance is added [4].

    Future: Cycle-by-Cycle Trip for PSFB Peak Current Mode Control

    When you transition to cycle-by-cycle (CBC) for your Phase-Shifted Full-Bridge control, the key differences are:

    Aspect
    One-Shot (Current)
    Cycle-by-Cycle (Future)
    Trip behavior
    Latched until software clears
    Auto-clears each PWM cycle
    Clear event
    EPWM_clearTripZoneFlag() in software
    Automatically at PRD or Zero event
    Use case
    Overcurrent fault shutdown
    Peak current mode limiting
    API change
    EPWM_TZ_SIGNAL_OSHT1
    EPWM_TZ_SIGNAL_CBC6 (DCAEVT1)

    In SysConfig, this is a straightforward change in the Trip Zone configuration section—switch from one-shot to CBC trip source for DCAEVT1.

    Reference

    The TIDM-02014 reference design provides a complete implementation example of CMPSS-based overcurrent protection with ePWM trip zones that you can reference for both one-shot and CBC configurations [6].


    To help refine the cycle-by-cycle recommendation when you're ready:

    • What PWM frequency and count mode (up-count or up-down) will you use for the PSFB?
    • Whether you need blanking window functionality to filter noise during switching transitions
    • Whether CMPSS DAC synchronization with ePWM events is needed for dynamic threshold adjustment
    Note: We will close this thread since the original issue is resolved, please create a new thread for any follow up questions.

    1. TMS320F28P65x TRM - Digital Compare Submodule
    2. SPRAD12A - Routing CMPSS to Trip Zone
    3. TMS320F28P65x Datasheet - CMPSS Connectivity
    4. E2E - F28P65x requires explicit EPWMXBAR configuration
    5. E2E - TMS320F28P659DK-Q1 Trip Zone Peak Current Control
    6. SPRACX0 - X-BAR and ePWM DC Module Interface

    Best Regards,

    Zackary Fleenor