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.

F28069 RTOS External Interrupt

I am trying to integrate an external interrupt into my RTOS project. I wanted to know if I am initializing the GPIO XINT1 correctly? See the picture and code below.

// GPIO0 is an input
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0; // GPIO
GpioCtrlRegs.GPADIR.bit.GPIO0 = 0; // input
EDIS;

// GPIO0 is XINT1
EALLOW;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0; // XINT1 is GPIO0
EDIS;

// Configure XINT1
XIntruptRegs.XINT1CR.bit.POLARITY = 0; // Falling/Rising edge interrupt

// Enable XINT1
XIntruptRegs.XINT1CR.bit.ENABLE = 1; // Enable XINT1

  • Andrew,
    The setup is correct in general, but wanted to point out a few specifics that may impact(or not) your system.
    1)Polarity: A value of 0 in the polarity in the control will give falling edge detection only. This does not agree with the comments. A value of 1 will give rising edge and a value of 3 will give rising/falling. I assume you can change this from the GUI by sending a 1 or 3 instead of a 0 in the arg field.
    2)Since all XINT pass through the GPIO input mux they are also subject to the logic in the path prior. As such the default setting for all input signals is to have them SYNC'd to the CPU clock. If you know that the GPIO0 signal for XINT will have a hold time that ensures it gets latched then you are done. If this may not be true you will need to change to ASYNC mode so this won't come into the path. Conversely if you are concerned with noise on this signal you can activate Qualification on this signal(like all GPIOs) to give some noise immunity. These controls are in the GPACtrl regs.

    Best,
    Matthew