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.

LM4F232 PORT F_PIN 0 as interrupt

Hi

I am trying to configure Pin 0 of PORT F as interrupt pin to generate interrupt on both edges. Accordingly updated vector table with my ISR function.

I am connected external switch/pulse generator to simulate interrupt, but my ISR never gets called. (Status registers are also not showing interrupt status).

But same initialization works if I try to configure for Pin 0 of PORT K (same ISR function used for PORT K).

Can you please guide me why it works for PORT K pin and doesn’t work for PORT F pin?

void InitializePORT_F_PIN_0(void)
{
   // enable peripheral
   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

   MAP_SysCtlDelay(2);

   // set the pin type as input as we will be receiving the pulses
   MAP_GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0);

   MAP_GPIOPinIntDisable(GPIO_PORTF_BASE, GPIO_PIN_0);

   // set the interrupt type as rising edge
   MAP_GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_BOTH_EDGES);

   MAP_SysCtlDelay(2);

   // enable interrupt in global interrupt module
   MAP_IntEnable(INT_GPIOF);
  
   // clear interrupt status flag
   MAP_GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_0);

   // enable interrupt                                                         
   MAP_GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_0);
}

  • Port F - Pin 0 is clearly defined in MCU Datasheet as NMI - requires special, unlocking and then reconfiguration to alter.

    These MCUs have "wealth" of GPIO - easiest for you to choose another pin...  (you may wish to avoid PD7 - as well)