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.

TMS320F28035 Trip Zone 6 ePWM Stop during Emulation halt

I am using the LV Motor kit with F28035.  I added the following code to stop the PWMs on an emulator halt, but it is not working.  I still see PWM's being driven on my scope while I'm halted.  Do I also have to set the TBCTL in additon to the code below?

 

 

 

/* Init Trip Zone Select Register*/

EPwm1Regs.TZSEL.bit.OSHT6= 1;

EPwm2Regs.TZSEL.bit.OSHT6= 1;

EPwm3Regs.TZSEL.bit.OSHT6= 1;

EPwm4Regs.TZSEL.bit.OSHT6= 1;

 

 

/* Init Trip Zone Control Register*/

EPwm1Regs.TZCTL.bit.TZA = 2;

EPwm1Regs.TZCTL.bit.TZB = 2;

EPwm2Regs.TZCTL.bit.TZA = 2;

EPwm2Regs.TZCTL.bit.TZB = 2;

EPwm3Regs.TZCTL.bit.TZA = 2;

EPwm3Regs.TZCTL.bit.TZB = 2;

EPwm4Regs.TZCTL.bit.TZA = 2;

EPwm4Regs.TZCTL.bit.TZB = 2;

 

 

 

 

 

  • Tom,

    I apologize this is not very well documented in the EPWM users guide, however the emulation halt trip is connected to trip zone for CBC cycle by cycle and not one shot, also you have to configure what are the action events that take place, the following code dose it for EPWM1,

    // Cycle by cycle interrupt for CPU halt trip
        EPwm1Regs.TZSEL.bit.CBC6=0x1;
       
    // What do we want the OST/CBC events to do?
    // TZA events can force EPWMxA
    // TZB events can force EPWMxB
        EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWM1A will go low
        EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWM1B will go low

    Hope this helps,

    regards

    Manish Bhardwaj

  • OK, just verified this is working.  In the Multi Axis motor demo kit, there was a macro (PWM_INIT_MACRO) which changed my values.  Thanks!