Part Number: TM4C129DNCPDT
Hi,
I have a question regarding the NMI pin.
Can the NMI pin be configured and used as a normal GPIO input pin? If yes, is it possible to configure it to generate a falling-edge interrupt?
Currently, I have:
- Unlocked the NMI pin.
- Configured it as an input.
- Configured the interrupt for falling-edge detection.
However, when I test it, the interrupt is triggered only on the rising edge and not on the falling edge.
Is there any limitation on the NMI pin that prevents falling-edge interrupts, or is there an additional configuration step required? The pin is PD7.
void initAcDetGPIOINTPin(void)
{
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= AC_DET_NMI_PIN;
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;
// GPIO input
MAP_GPIOPinTypeGPIOInput(AC_DET_NMI_PORT, AC_DET_NMI_PIN);
GPIOIntTypeSet(AC_DET_NMI_PORT, AC_DET_NMI_PIN, GPIO_FALLING_EDGE);
GPIOIntEnable(GPIO_PORTD_BASE, AC_DET_NMI_PIN);
return;
} in cfg file var nmiParams = new Hwi.Params();
nmiParams.instance.name = "AC_DET_Hwi";
nmiParams.priority = 0;
Program.global.AC_DET_Hwi = Hwi.create(19, "&acPowerFailure_HWISR", nmiParams); and I am using handler function acPowerFailure_HWISR