Part Number: TMS320F28069M
Tool/software: Code Composer Studio
Hello
I am using Example_2806xEqep_pos_speed to read the angle and speed of a motor. From what I understand the counter and interrupts are based on EPwm1, however I want to change it to EPwm4. How should I do it?
So far I have changed the Example_EpwmSetup.c file (EPwm1Regs to EPwm4Regs) and changed the following codes:
PieCtrlRegs.PIEIER3.bit.INTx4= 1;
__interrupt void prdTick(void) // EPWM1 Interrupts once every 4 QCLK counts (one period)
{
// Position and Speed measurement
qep_posspeed.calc(&qep_posspeed);
// Control loop code for position control & Speed contol
Interrupt_Count++;
// Acknowledge this interrupt to receive more interrupts from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
EPwm4Regs.ETCLR.bit.INT=1;
}
but it doesn't seem to work.