Hi,
I have the following setup to EPwmRegs1
- GPIO is routed to TZ1 via input X-bar. (GPIO is inverted in the setup)
- An under voltage signal to TZ3 via input X-bar.
- TZ5 and TZ6 are as usual system clock fail logic and EMUSTOP resp.
When interrupt occurs, I read the TZOSTFLG register, I see the value as 1 ie, OST1 is 1. But I do not see GPIO value read as 0. It stays at 1! (It should be 0 when TZ1 becomes active; otherwise 1)
My question is that, is there any reason why would ePWM1_TZ gives an interrupt when there is no input from external input? Or Am I doing anything wrong?
// Source 1
EALLOW;
GpioCtrlRegs.GPAINV.bit.GPIO31 = 1; /* TZ active low - Input inversion control for this pin */
GpioCtrlRegs.GPACTRL.bit.QUALPRD3 = 0; /* Qual period = SYSCLKOUT = 10ns */
GpioCtrlRegs.GPAQSEL2.bit.GPIO31 = 2; /* Qual Samples = 6; Total samples=10 and if input is high for 6 samples (6*10ns=60ns), then it is REALLY high. */
GpioCtrlRegs.GPAPUD.bit.GPIO31 = 1; /* Enable pull-up on GPIO (TZx) - 1: Disables the Pull-Up. */
InputXbarRegs.INPUT1SELECT = 31; /* INPUT1 is link with TZ1 - PFC_TRIP */
EDIS;
// Source 2
EALLOW;
GpioCtrlRegs.GPBINV.bit.GPIO52 = 1; /* TZ active low - Input inversion control for this pin */
GpioCtrlRegs.GPBCTRL.bit.QUALPRD2 = 0; /* Qual period = SYSCLKOUT = 10ns */
GpioCtrlRegs.GPBQSEL2.bit.GPIO52 = 2; /* Qual Samples = 6; Total samples=10 and if input is high for 6 samples (6*10ns=60ns), then it is REALLY high. */
GpioCtrlRegs.GPBPUD.bit.GPIO52 = 1; // Enable pull-up on GPIO (TZ3) - 1: Disables the Pull-Up.
InputXbarRegs.INPUT3SELECT = 52; /* INPUT3 is link with TZ3 - BP_UVL0V_TRIP */
EDIS;
__interrupt void epwm_PFC_B_tzint_isr(void) /* PFC - Inverter must stop since PFC stop - ePWM1_TZ */
{
T_u32 tmp_time_0;
T_u16 tmp_defect;
//tz.epwmx_pfc = PWM_MOD_1->TZOSTFLG.bit.OST1; // Reading a 1 indicates a trip has occured on the OST1 selected event.
tz.epwmx_pfc = EPwm1Regs.TZOSTFLG.all;
tz.counter_pfc++;
RST_SYS_status.tab_fifo_error[12] = GpioDataRegs.GPADAT.bit.GPIO31;
RST_SYS_status.tab_fifo_error[13] = GpioDataRegs.GPBDAT.bit.GPIO36;
RST_SYS_status.tab_fifo_error[11] = GpioDataRegs.GPBDAT.bit.GPIO52;
RST_SYS_status.tab_fifo_error[0] = GpioDataRegs.GPBDAT.bit.GPIO32;
RST_SYS_status.tab_fifo_error[1] = GpioDataRegs.GPBDAT.bit.GPIO33;
RST_SYS_status.tab_fifo_error[2] = GpioDataRegs.GPBDAT.bit.GPIO34;
RST_SYS_status.tab_fifo_error[3] = GpioDataRegs.GPBDAT.bit.GPIO35;
RST_SYS_status.tab_fifo_error[4] = GpioDataRegs.GPBDAT.bit.GPIO37;
RST_SYS_status.tab_fifo_error[5] = GpioDataRegs.GPBDAT.bit.GPIO38;
RST_SYS_status.tab_fifo_error[6] = GpioDataRegs.GPBDAT.bit.GPIO39;
RST_SYS_status.tab_fifo_error[7] = GpioDataRegs.GPBDAT.bit.GPIO40;
RST_SYS_status.tab_fifo_error[8] = GpioDataRegs.GPBDAT.bit.GPIO49;
RST_SYS_status.tab_fifo_error[9] = GpioDataRegs.GPBDAT.bit.GPIO50;
RST_SYS_status.tab_fifo_error[10] = GpioDataRegs.GPBDAT.bit.GPIO51;
AdcdRegs.ADCSOCFRC1.bit.SOC6 = 1;
//wait for ADCD to complete, then acknowledge flag
while(AdcdRegs.ADCINTFLG.bit.ADCINT1 == 0);
AdcdRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
tz.temp = ADCD_getValue(6) * ADC_COEFF_FLOAT_D15_MUX_Y6;
// Acknowledge this interrupt to receive more interrupts from group 2
PieCtrlRegs.PIEACK.all = PIEACK_GROUP2;
}
I am reading RST_SYS_status.tab_fifo_error array values in my log file.