Part Number: TM4C129ENCPDT
Hi,
Can someone point me out where I am mistaking in my code.
I have two pins configured for interrupt. The pin on Port M is triggering the corresponding Int-Handler however the Pin on Port N is not triggering its Int-Handler.
Following is the code for PM3 pin which is getting fired.
#define ADC_CTRL_PORT GPIO_PORTM_BASE
void PM3_interrupt_enable(void)
{
//Enable Interrupt on ADC_BUSY Pin
IntMasterDisable();
GPIOPinTypeGPIOInput(ADC_CTRL_PORT, ADC_BUSY);
GPIOPadConfigSet(ADC_CTRL_PORT, ADC_BUSY, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOIntDisable(ADC_CTRL_PORT, ADC_BUSY);
GPIOIntClear(ADC_CTRL_PORT, ADC_BUSY);
GPIOIntRegister(ADC_CTRL_PORT, PORTM_Common_IntHandler);
GPIOIntTypeSet(ADC_CTRL_PORT, ADC_BUSY, GPIO_FALLING_EDGE);
GPIOIntEnable(ADC_CTRL_PORT, ADC_BUSY);
IntMasterEnable();
}
void PORTM_Common_IntHandler(void)
{
// Clear the interrupt
uint32_t status;
SysCtlDelay(10);
status = GPIOIntStatus(ADC_CTRL_PORT, true);
if(status & ADC_BUSY)
{
//Do Something
}
GPIOIntClear(ADC_CTRL_PORT, status);
}
Following is the code for PN0 pin which is NOT getting fired.
#define DCHRG_CMD_PORT GPIO_PORTN_BASE
void Enable_DischargePulse_Interrupt(void)
{
//Enable Discharge Pulse input pin interrupt on ADC_BUSY Pin
IntMasterDisable();
GPIOPinTypeGPIOInput(DCHRG_CMD_PORT, DCHRG_CMD_PIN);
SysCtlDelay(40);
GPIOPadConfigSet(DCHRG_CMD_PORT, DCHRG_CMD_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPD);
GPIOIntDisable(DCHRG_CMD_PORT, DCHRG_CMD_PIN);
GPIOIntClear(DCHRG_CMD_PORT, DCHRG_CMD_PIN);
GPIOIntRegister(DCHRG_CMD_PORT, PORTN_Common_IntHandler);
GPIOIntTypeSet(DCHRG_CMD_PORT, DCHRG_CMD_PIN, GPIO_RISING_EDGE);
GPIOIntEnable(DCHRG_CMD_PORT, DCHRG_CMD_PIN);
IntMasterEnable();
}
void PORTN_Common_IntHandler(void)
{
//Clear the interrupt
uint32_t status;
SysCtlDelay(10);
status = GPIOIntStatus(DCHRG_CMD_PORT, true);
if(status & DCHRG_CMD_PIN)
{
//Do Something
}
GPIOIntClear(DCHRG_CMD_PORT, status);
}
Thanks for your time and help.