Hi
I want to configure GPIO52 as external interrupt. I have written the program for it but it is going to the isr. Can anyone help me what is wrong with the program.
interrupt void xint4_isr(void);
volatile Uint32 Xint4Count;
Uint32 LoopCount=0;
Uint32 j=0,i=0;;
void main(void)
{
InitSysCtrl();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
/
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.XINT4 = &xint4_isr;
EDIS; // This is needed to disable write to EALLOW protected registers
Xint4Count = 0;
LoopCount = 0;
PieCtrlRegs.PIEIER12.bit.INTx2 = 1; // Enable PIE Gropu 1 INT4
IER |= M_INT4; // Enable CPU int1
EINT;
EALLOW;
GpioCtrlRegs.GPBMUX2.bit.GPIO52 = 0; // GPIO
GpioCtrlRegs.GPBDIR.bit.GPIO52 = 0; // input
GpioCtrlRegs.GPBQSEL2.bit.GPIO52 = 0;
EDIS;
EALLOW;
GpioIntRegs.GPIOXINT4SEL.bit.GPIOSEL = 0x00000014;
EDIS;
XIntruptRegs.XINT4CR.bit.POLARITY = 0; // Falling edge interrupt
XIntruptRegs.XINT4CR.bit.ENABLE = 1; // Enable Xint4
for(;;)
{
LoopCount++;
}
}
interrupt void xint4_isr(void)
{
Xint4Count++;
i++;
// Acknowledge this interrupt to get more from group 12
PieCtrlRegs.PIEACK.all = PIEACK_GROUP12;
}
In this program LoopCount is being incremented but the main program is not being interrupted and thus i is not being incremented. Program is not giving any error when it is compiled.
Please help me with the program.
Thanks.