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.

TZFRC in TMS320F28035

I'm already using the trip zone submodule (coupled with the analog comparators) to shut down (OSHT) the system (and it works fine). I am trying to add an additional OSHT event using software, but it doesn't seem to be working. I copied the relevant code snippets below for your reference. Any ideas?

(in the main interrupt loop)

// Overvoltage Protection via software
  if (Vabsense > 600)
  {
      EALLOW;
      EPwm1Regs.TZFRC.bit.OST = 1;
      EPwm2Regs.TZFRC.bit.OST = 1;
      EDIS;
  }
  else {}

(ePWMx initialization)

// Set Trip Zone Submodule
   EPwm1Regs.TZSEL.bit.DCAEVT1 = 1;               // Enable DCAEVT1 as one-shot trip source
   EPwm1Regs.TZSEL.bit.DCBEVT1 = 1;                  // Enable DCBEVT1 as one-shot trip source
   EPwm1Regs.TZCTL.bit.DCAEVT1 = 2;                 // 2 = force EPwmxA low
   EPwm1Regs.TZCTL.bit.DCBEVT1 = 2;                  // 2 = force EPwmxB low
   EPwm1Regs.TZEINT.bit.OST = 1;                  // any one-shot trip event generates a TX interrupt
 // Digital Compare Submodule (EALLOW protected)
   EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 8; //COMP1OUT is input to DCAH
   EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 8; //COMP1OUT is input to DCBH
   EPwm1Regs.TZDCSEL.bit.DCAEVT1 = 2; //if DCAH goes Hi, event generated
   EPwm1Regs.TZDCSEL.bit.DCBEVT1 = 2; //if DCBH goes Hi, event generated

  •  

    Hi Brian,

    Are you sure the first OST event (based on comparator output) is correctly working? To configure which PWM actions to take on OST or CBC events you need to configure the bits TZCTL[TZA] and TZCTL[TZB]. The TZCTL[DCAEVT1] and TZCTL[DCBEVT1] result in actions at the PWM output that are active only for the time when these respective events are active (DCAEVT1/DCBEVT1).

    Just change your TZCTL configuration and this should work.

    Hrishi

  • Hi Hrishi,

    Yes, the OST event triggered by the comparators worked fine.

    Following your suggestion (to configure TZA, etc) solved my problem, thank you very much.

    Fig. 39 in the ePWM User Guide is somewhat confusing.

    -Brian

  • Posting for Hrishi (his E2E is having issues at the moment):
    ---
    Hi Brian,

    It is really good to know that this is working for you now. About the documentation, we have spent some time trying to figure out how these features can be documented better. Achieving this is sometimes difficult with some of our highly flexible and feature rich peripherals. We hope to make it more user/reader friendly going forward.

    Hrishi
    ---