This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interrupts from GPIO

I am using an F28335, and I'm trying to create three interrupts from GPIO switches. I'm currently using XINT3, XINT4, and XINT5 from the DefaultIsr.c as me shells. I have code in those to check a certain GPIO pin, but it doesn't seem to be working. Here is my initialization of the interrupts:

/////////////////////////////////////////////////////////

InitPieVectTable();

EALLOW;

PieVectTable.XINT3= &XINT3_ISR;

PieVectTable.XINT4= &XINT4_ISR;

PieVectTable.XINT5= &XINT5_ISR;

EDIS;

 

PieCtrlRegs.PIECTRL.bit.ENPIE = 1;

PieCtrlRegs.PIEIER12.bit.INTx1 = 1;

PieCtrlRegs.PIEIER12.bit.INTx2 = 1;

PieCtrlRegs.PIEIER12.bit.INTx3 = 1;

IER=0x800;

EINT;

///////////////////////////////////////////////////////////////

I have similar code using Mcbspb interrupts, and those interrupts fire. These do not ever get caught. Any ideas?

  • Christopher,

    just to make sure:  Have you also initialized registers GPIOXINT3SEL.bit.GPIOSEL = 32? (example GPIO32  as XINT3 source).  Also, register XINT3CR, bit ENABLE must be set to 1 and bit POLARITY to 0 (falling) or 1 (rising edge).  Both registers are EALLOW - protected.

    Regards

     

     

  • I did not have those registers set, and after doing so things are looking much better. My problem now is that  when I use my switch on one pin, it seems to cycle through the interrupts. It also doesn't seem to  matter what pin I'm changing either. On a semi-related note, the interrupts are supposed to light corresponding leds, but the pins the are connected to are acting strange. I'm thinking the problem has something to do with the internal pull ups, but I'm not sure.