Other Parts Discussed in Thread: CONTROLSUITE
The target I want to achieve is to setup GPIO91 as XINT1. The relevant code is shown below:
EALLOW;
PieVectTable.XINT1_INT = &xint1_isr;
EDIS;
PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
PieCtrlRegs.PIEIER1.bit.INTx4 = 1; // Enable PIE Gropu 1 INT4
IER |= M_INT1; // Enable CPU INT1
EINT;
EALLOW;
GpioCtrlRegs.GPCMUX2.bit.GPIO91 = 0; // GPIO
GpioCtrlRegs.GPCDIR.bit.GPIO91 = 0; // input
GpioCtrlRegs.GPCQSEL2.bit.GPIO91 = 0; // XINT1 Synch to SYSCLKOUT only
EDIS
GPIO_SetupXINT1Gpio(91);
XintRegs.XINT1CR.bit.POLARITY = 0; // Falling edge interrupt
XintRegs.XINT1CR.bit.ENABLE = 1; // Enable XINT1
When I toggle the GPIO91 level through external circuit, the register value of "GpioDataRegs.GPCDAT.bit.GPIO91" in CCS expression window toggles accordingly.
But the program doesn't enter the interrupt service routine "xint1_isr". However, if I forcedly set the register "PieCtrlRegs.PIEIFR1.bit.INTx4" to 1, it will enter "xint1_isr".
I also checked the register "InputXbarRegs.INPUT4SELECT", it is set with 91. So I think the problem may be that the GPIO91 doesn't trigger the PIE1.4 correctly. But why? Is there any wrong with my program?