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.

TMS320F28379D: Trip Zone ISR Not Being Entered But PWM Action Is Being Fullfilled

Part Number: TMS320F28379D


Hello,

I am setting up a trip zone interrupt from a GPIO via Xbar and the PWM is able to respond to a trip event, but the ISR I wrote is not being entered. When I removed my interrupt name from the PieVectTable (e.g. commenting out the line: PieVectTable.EPWM1_TZ_INT = TripZoneISR), the Default ISR is reached so I believe I have the interrupt set up properly, but I am missing something small detail. Here is my config:

EALLOW;
PieVectTable.EPWM1_TZ_INT = TripZoneFault;

InputXbarRegs.INPUT1SELECT = 38;
EDIS;

// Enable CPU INT2 which is connected to EPWM1-3 INT:
IER |= M_INT2;
// Enable EPWM INTn in the PIE: Group 3 interrupt 1-3
PieCtrlRegs.PIEIER2.bit.INTx1 = 1;
PieCtrlRegs.PIEIER2.bit.INTx2 = 1;

EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC =0;
EDIS;

//trip zone select and action
EALLOW;
EPwm1Regs.TZSEL.bit.CBC1 = 1;
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_HI;
EPwm1Regs.TZEINT.bit.CBC = 1;
EPwm1Regs.TZCLR.bit.INT = 1;
EDIS;

EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC =1;
EDIS;

then I have an ISR elsewhere, 

interrupt void TripZoneISR(void) {

//code

}

I put a breakpoint inside the TripZoneISR and it is never reached even when the trip event occurs.

In my program, I have other interrupts that function properly by assigning the PieVectTable values without using the address of the ISR as I have shown before (i.e. PieVectTable.INTx = ISR versus PieVectTable.INTx = &ISR) but I see other examples typically use the address of the ISR. I suppose sides question are, how can my other interrupts work without the address of the ISR (i.e. PieVectTable.ADCA1_INT = anotherISR), whether this is the root of my problem for the trip zone ISR, and what the difference between the two is?

  • Can you check in the registers window of CcS during debug you make sure your initialization values have been written to the corresponding registers?

  • Jeff,

    Were you able to find the solution? if yes, can you post what your problem was?

    Nima

  • Jeff,

    I will be closing this thread. Just to make sure others are aware here are the main key parts for TZ INT:

    //Interrupt proto type
    __interrupt void epwm1TZISR(void);
    
    
    //In main register
    Interrupt_register(INT_EPWM1_TZ, &epwm1TZISR);
    
    // Enable TZ interrupt and set the source
    EPWM_enableTripZoneInterrupt(EPWM1_BASE, EPWM_TZ_INTERRUPT_DCAEVT1);
    
    
    //Enable the interrupt
    Interrupt_enable(INT_EPWM1_TZ);
    
    //
    // epwm1TZISR - ePWM1 TZ ISR
    //
    __interrupt void epwm1TZISR(void)
    {
    
        //
        // To re-enable the Interrupts
        //
        EPWM_clearTripZoneFlag(EPWM1_BASE,
                               EPWM_TZ_FLAG_DCAEVT1 | EPWM_TZ_FLAG_DCBEVT1 | EPWM_TZ_INTERRUPT);
    
        //
        // Acknowledge this interrupt to receive more interrupts from group 2
        //
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
    }