Hello.
I am working with the TIva TM4C123G with ccs5.4.
I am having a problem with enabling the QEI1 index interrupt.
I know that the index works since when working with index reset the QEI resets every time I pass the index location.
But when I try to work with the index interrupt things don't work any more.
Can anyone find any problem with the code?
/// the interrupt routine ///
void QEI1IntHandler(void) {
unsigned long status1;
status1 = QEIIntStatus(QEI1_BASE, false);
if ((status1 & QEI_INTINDEX) == QEI_INTINDEX)
{
_IndexPosition = QEIPositionGet(QEI1_BASE) % 10000;
QEIIntClear(QEI1_BASE, QEI_INTINDEX);
}
}
/////////// Main Configuration ////////
SysCtlPeripheralEnable(SYSCTL_PERIPH_QEI1);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
//
// Enable port PC5 for QEI1 PHA1
//
GPIOPinConfigure(GPIO_PC5_PHA1);
GPIOPinTypeQEI(GPIO_PORTC_BASE, GPIO_PIN_5);
//
// Enable port PC6 for QEI1 PHB1
//
GPIOPinConfigure(GPIO_PC6_PHB1);
GPIOPinTypeQEI(GPIO_PORTC_BASE, GPIO_PIN_6);
//
// Enable port PC4 for QEI1 IDX1
//
GPIOPinConfigure(GPIO_PC4_IDX1);
GPIOPinTypeQEI(GPIO_PORTC_BASE, GPIO_PIN_4);
// Enable processor interrupts.
//
IntMasterEnable();
QEIConfigure(QEI1_BASE,
(QEI_CONFIG_CAPTURE_A_B | QEI_CONFIG_RESET_IDX
| QEI_CONFIG_QUADRATURE | QEI_CONFIG_NO_SWAP), 2000000);
QEIEnable(QEI1_BASE);
QEIPositionSet(QEI1_BASE, 100000);
IntEnable(INT_QEI1);
QEIIntEnable(QEI1_BASE, QEI_INTINDEX);
Thanks
Asi.