Other Parts Discussed in Thread: TM4C1294NCPDT, ENERGIA
Hello,
I have a code that uses an interrupt on an input pin to make some calculations.
Currently it works just fine when I use ports M, D, A or B (I've tested them all).
The problem is I need to make it work specifically on port L pin 3, but when I do it the interrupt gets called everytime and the program gets stuck.
I even tried to make the timer1 interrupt (which I'm also using) to work on priority C0 and the GPIO to work on priority E0 but stil not even the Timer interrupt gets called because the program is stuck on port L interrupt.
I enable all of the GPIOs I used to test the code:
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
I set the Pin Type to Input: (Here I'm only showing it for the Port L, when I tested the other ones I just changed this line to the port to be tested).
GPIOPinTypeGPIOInput(GPIO_PORTL_BASE, GPIO_PIN_3);
I set up the interrupts:
GPIOIntRegister(GPIO_PORTL_BASE, TacHandler); GPIOIntTypeSet(GPIO_PORTL_BASE, GPIO_PIN_3, GPIO_FALLING_EDGE); GPIOIntEnable(GPIO_PORTL_BASE, GPIO_INT_PIN_3);
And on the interrupt handler "TacHandler" I clear the interrupt:
void TacHandler(void){
GPIOIntClear(GPIO_PORTL_BASE, GPIO_PIN_3);
freqCalc();
}
inline void freqCalc(void){
pulseCounter++;
}
But as I said the GPIO interrupt keeps getting called and the software gets stuck. When I try on the other pins I get the result I want just fine.
I didn't initialize anything other than GPIO and TIMER1, therefore I'm not using Analog Comparator, USB or Quadrature Encoder (I did see they can be set to work on pin PL3).
I'm using the Launchpad board.
Is it not possible to use the PL3 for this?
Thank you.