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.

EPWM Trip Zone usage, TZA?

Hello,

 

I'm using Piccolo F28027's EPWM as a Buck requlator, and I'd like to use the Comparator 1 device for short-circuit protection. 

I don't understand completely the Trip Zone Control Register functionality. Several Events can be assigned to an EPWM to force the output to a predefined state.

Theoretically, the priorities of the Events: 1. TZA, 2. DCAEVT1, 3. DCAEVT2. 

 

What is the meaning of the TZA event? I cannot assing any signal to TZA event, however, this has the highest priority.

 

In code examples, I always see:

    EPwm3Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT;

    EPwm3Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCAH_HI;

    EPwm3Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC;

    EPwm3Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2;

    EPwm3Regs.TZSEL.bit.DCAEVT2 = 1;

    EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO;

Why should I use here TZCTL.bit.TZA, instead of TZCTL.bit.DCAEVT2 ?

If I'd like to use DCAEVT2, should I disable the higher priority DCAEVT1, and TZA by initialization: TZCTL.bit.TZA=0x3, TZCTL.bit.DCAEVT1=0x3 ???

(When I've tried the code example above with  EPwm3Regs.TZCTL.bit.DCAEVT2 = TZ_FORCE_LO, then the Trip Zone didn't make any actions in case of an overcurrent event).

  • Atilla -

    Sorry it took a while to respond.  Basically this is how the EPWM module treats the TZA/B vs DCxEVT1/2 events:

    1. TZCTL[TZA]/[TZB] are used to control ePWMxA/ePWMxB output actions as a result of a OSHT or CBC trip event.  So if any of the bits in TZSEL register are set, then TZA and TZB bits should be used to control the ePWMxA/B actions.
      1. For CBC - the output changes per TZCTL[TZA/B] settings immediately upon detection of event, but output returns back to original state when TBCTR = 0x0000.
      2. For OSHT - the output changes per TZCTL[TZA/B] settings immediately upon detection of event and remains in changed condition until user manually writes clear bit to clear the event.
    2. TZCTL[DCxEVT1/2] are used to control ePWMxA/ePWMxB output actions upon detection of the DCxEVT1/2 events.
      1. For DC event - the output changes per TZCTL[DCxEVT1/2] settings immediately upon detection of event, and as soon as event condition is gone, the output returns back to original state.
      2. When OSHT or CBC mode is enabled via TZSEL register, the TZCTL[TZA]/[TZB] have higher priority, and so the ePWM module looks to those bits to see what action should occur on a CBC or OSHT basis (that's why the trip zone module didn't perform any action when you set EPwm3Regs.TZCTL.bit.DCAEVT2 = TZ_FORCE_LO - because TZSEL register has bits set to 1, indicating OSHT/CBC action takes precedence- so it instead looks at the TZA/TZB bits).
      3. Therefore, if you want the TZCTL[DCxEVT1/2] actions to apply instead, you can only use these when TZSEL = 0x0000.