Other Parts Discussed in Thread: CONTROLSUITE
Hello
I am doing some sustaining work on some software I did not author that uses the eQEP peripheral of the 28030/35 to do motion control with an incremental encoder
The 28035 uses 3 interrupts the SPI the ADC and a timer
This code below is called from ADC ISR. The problem is with no NOISE on encoder the counter sPosFdbk.QuadratureError is constantly incrementing even though this interrupt is NOT enabled
This leads me to suspect the QFLG.bit.PHE is being set anyway and or the clearing of this bit is not working
I'm wondering
1)if the code clearing PHE flag is correct ?
2) Why is the interrupt flag being set when the interrupt was never enabled (The boot loader // Disable and clear all CPU interrupts
// Update position feedback quadrature error count
if ( EQep1Regs.QFLG.bit.PHE )
{
sPosFdbk.QuadratureError++;
EQep1Regs.QCLR.all = (0x0001 << 2)); // Clear quadrature error flag -- Use write instead of r-m-w
}
// clear the adc interrupt before leaving
PieCtrlRegs.PIEACK.all = M_INT1; // Issue PIE ACK
// set the interrupt flag for the StatusUpdateIsr()
PieCtrlRegs.PIEIFR7.bit.INTx1 = BOOL_TRUE;
// added on 7/12/13 for test
AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //Clear ADCINT1 flag reinitialize for next SOC