Part Number: TM4C129DNCPDT
I am trying to use PD7 as an NMI input on a TM4C129DNCPDT.
Requirement:
- PD7 should be idle low.
- When PD7 transitions from low to high (rising edge), the MCU should enter the NMI handler.
- Inside the NMI handler, I want to execute some application code such as incrementing a counter and driving an output pin.
I followed the NMI configuration discussed here:
My PD7 initialization is:
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= GPIO_PIN_7;
GPIOPinConfigure(GPIO_PD7_NMI);
GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_7,
GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD_WPD);
GPIODirModeSet(GPIO_PORTD_BASE,
GPIO_PIN_7,
GPIO_DIR_MODE_HW);
My NMI handler is:
static void nmiHandler(UArg arg)
{
SysCtlNMIClear(SysCtlNMIStatus());
SysCtlDelay(5);
putsUserNull("\nNMI Detected");
counnt++;
GPIOPinWrite(GPIO_PORTM_BASE,
GPIO_PIN_3,
GPIO_PIN_3);
}
However, the NMI handler is never entered when PD7 transitions from low to high.
My questions are:
- Does the TM4C1294 NMI input support rising-edge detection, or is it level-sensitive only?
- Is additional NMI configuration required beyond assigning PD7 to
GPIO_PD7_NMI? - Does the NMI handler need to be registered in the vector table differently from a normal interrupt?
- Is
SysCtlNMIClear()sufficient, or are there additional status bits that must be cleared? - Is the weak pull-down configuration (
GPIO_PIN_TYPE_STD_WPD) appropriate for an idle-low NMI input?
Any example showing a working PD7-to-NMI configuration would be appreciated.


