Hi,
Our PWM in 28335 is used to trigger ADC conversions and this drives the scheduler, other words all the product activity is derived off the PWM and its time-base counters. An added feature had been implemented: a Trip-Zone pin which is halting PWM outputs once an over -current is sensed. Whenever this TZ pin is activated - the associated PWM outputs are disabled and a TZ interrupt is fired.
This works well. However, it had been found that the scheduler is actually halted once the TZ pin is active. Shouldn't TZ input pin only affect the PWM outputs and *not* the internal Time-Base counters?
Thanks for looking, Isaac
============================================
The way TZ had been implemented is:
EALLOW;
// Configure GPIO14 as as TZ3
GpioCtrlRegs.GPAPUD.bit.GPIO14 = 0x0; // Enable pull-up on GPIO14 (TZ3)
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0x1 ; // Configure GPIO14 as TZ3
// Configure EPWM modules to drive the axis 1 outputs off when TZ3 occurs
EPwm1Regs.TZSEL.bit.OSHT3 = TZ_ENABLE;
EPwm2Regs.TZSEL.bit.OSHT3 = TZ_ENABLE;
EPwm3Regs.TZSEL.bit.OSHT3 = TZ_ENABLE;
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO;
EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO;
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO;
EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO;
EPwm3Regs.TZCTL.bit.TZA = TZ_FORCE_LO;
EPwm3Regs.TZCTL.bit.TZB = TZ_FORCE_LO;
// Configure TZ3 Interrupt
EPwm3Regs.TZEINT.bit.OST = 1; // Enables TZ interupt event
EPwm3Regs.TZCLR.bit.OST = 1; // Clears TZ Pending event
PieCtrlRegs.PIEIFR2.bit.INTx3 = 0;
EPwm3Regs.TZEINT.bit.OST = 1; // Enables TZ interupt event
PieCtrlRegs.PIEIER2.bit.INTx3 = 1;
EDIS;