Hi, I am running ePWM 1-6 using eCAP 1-6...all at different phases and duties. I would now like to run some code to check if its safe for the PWM to be active each cycle of the PWM...so I need an interup that triggers every time the ePWM is executed...I am I right to think the below code can run from flash ok...is this the correct approach? I would then repeat each interrupt for every pwm channel...Thanks
// ISR interrupt
interrupt void epwm1_timer_isr(void)
{
if(GPIOxx == 1){ //system safe...run
EPwm1Regs.AQCSFRC.bit.CSFA=11; // PWM active A
EPwm1Regs.AQCSFRC.bit.CSFB=11; // PWM active B
}else{ //system unsafe...disable
EPwm1Regs.AQCSFRC.bit.CSFA=01; // PWM disabled A
EPwm1Regs.AQCSFRC.bit.CSFB=01; // PWM disabled B
}
EPwm1Regs.ETCLR.bit.INT = 1; // Clear INT flag for this timer
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; // Acknowledge this interrupt to receive more interrupts from group 3
}