I am trying to stop a PWM on the occurrence of an external stop signal by tripzone and need to execute a few more things in the trip interrupt service routine.
I have configured tz1 as a OST interrupt for tz1' at GPIO15.
On the occurrence of 0 at GPIO15 the ePWM1 is tripped. However the TZ_INT isr is not executed.
The reason for this is that pie vector table group 2 flag is not raised and also the IFR INT2 flag is not raised.
In my code I have the following related commands.
PieVectTable.EPWM1_TZINT = &tzint; PieCtrlRegs.PIEIER2.bit.INTx1 = 1; PieCtrlRegs.PIEACK.all = 0xFFFF; PieCtrlRegs.PIECTRL.bit.ENPIE = 1; IER |= M_INT2; EPwm1Regs.TZEINT.bit.OST = 1;
They have many lines of code inbetween and wherever required EALLOW; and EDIS; is performed.
On implementation, when I externally try to trip the ePWM, it is tripped however the service routine is not executed.
The following are flag register contents:
IER = 0x0207 IFR = 0x0004 ePWM1.TZSEL = 0x0100 ePWM1.TZCTL = 0x000A ePWM1.TZFLG = 0x0005 ePWM1.TZEINT = 0x0004 PIEACK = 0x0006 PIEIER2 = 0x0001 PIEIFR2 = 0x0000
So the IFR and PIEIFR2 themselves do not reflect the occurrence of an interrupt. Whereas ePWM1.TZFLG does reflect that interrupt is encountered.
As a result the interrupt service routine is not run.
Thanks in advance.