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.
Hello,
I have a question about interrupt generation. I am configuring my ePWM's Digital Compare submodule. Here trip 11 is configured to DCAEVT1 to cause a trip on ePWM6.
My question is, which interrupt does this DCAEVT1 generates?
I looked at the TZENT register and it says using One shot (OST) causes EPWMx_TZINT PIE Interrupt. So, similarly what interrupt occurs on trip event DCAEVT1.
I have written my configurations along with little info about TZENT from user manual.
/*************** From TZENT register: *******************/
Bit3 DCAEVT1 R/W 0h
Digital Compare Output A Event 1 Interrupt Enable
0: Disabled
1: Enabled
Reset type: SYSRSn
Bit2 OST R/W 0h
Trip-zone One-Shot Interrupt Enable
0: Disable one-shot interrupt generation
1: Enable Interrupt generation
a one-shot trip event will cause a EPWMx_TZINT PIE interrupt.
Reset type: SYSRSn
/*************** MY configurations *******************/
//Configure EPWM output A & B to go low on trip. EPwm6Regs.TZCTL.bit.TZA = TZ_FORCE_LO; EPwm6Regs.TZCTL.bit.TZB = TZ_FORCE_LO; //Configure DCA to be TRIP11 EPwm6Regs.TZDCSEL.bit.DCAEVT1 = TZ_DCBH_HI; EPwm6Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 0xA; // Trip11 EPwm6Regs.DCAHTRIPSEL.bit.TRIPINPUT11 = 0; // Single trip input; Not ORed //Configure DCA as DCAEVT1 EPwm6Regs.TZSEL.bit.DCAEVT1 = 1; // Enable //Configure DCA path to be unfiltered & async EPwm6Regs.DCACTL.bit.EVT1SRCSEL = DC_EVT1; EPwm6Regs.DCACTL.bit.EVT1FRCSYNCSEL = DC_EVT_ASYNC; // Clear trip flags EPwm6Regs.TZCLR.bit.DCAEVT1 = 1; // Writing 1 clears trip flags. EPwm6Regs.TZCLR.bit.INT = 1; //Enable DCB interrupt EPwm6Regs.TZEINT.bit.DCAEVT1 = 1;
I appreciate your help.
Thanks
Sagar
I see that the EPWM6 outputs A & B are going low when the trip11 goes high. But I don't see the control coming to respective EPWM_TZ interrupt.
I have enabled proper TZ interrupt in PIE vector table and have a callback as follows:
PieCtrlRegs.PIEIER2.bit.INTx6 = 1; /* EPWM6_TZ */ /* This is init block */ PieVectTable.EPWM6_TZ_INT = &epwm_INV_2D_tzint_isr; /* This is ISR callback block */
Anything am I doing wrong?
Hi Sagar,
Could you check the status of the various interrupt registers along the path from the EPWM to the CPU? In the EPWM, please look at TZFLG. Then also please check PIEIFR and IFR.
You will also need a command such as "IER |= M_INT2;" to enable row 2 in the PIE.
Regards,
Kris
Sagar,
Thank you for the information. This confirms that the EPWM is setup correctly to generate the interrupt. Can you step through the PIE configuration code and verify that the registers are in fact being updated? I'm wondering if there is an EALLOW or similar missing.
Regards,
Kris