I am using CCS5.4 on a TM4C123BEPZ. I am trying to initialize the watchdog timer. My initialization code is:
void WDOG_Init(void) {
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
WATCHDOG_TIMEOUT = SysCtlClockGet()/10;
if(ROM_WatchdogLockState(WATCHDOG0_BASE) == true)
{
ROM_WatchdogUnlock(WATCHDOG0_BASE);
}
ROM_WatchdogStallEnable(WATCHDOG0_BASE);
ROM_WatchdogIntClear(WATCHDOG0_BASE);
ROM_WatchdogReloadSet(WATCHDOG0_BASE, WATCHDOG_TIMEOUT);
ROM_IntEnable (INT_WATCHDOG);
ROM_WatchdogEnable(WATCHDOG0_BASE);
}
I cannot get to the ROM_WatchdogEnable call. As soon as I IntEnable, I end up in the watchdog ISR.
The code above is consistent with several StellarisWare examples. There is not any applicable errata. I have tried shuffling the order of the above code, to no avail.
Why am a getting an immediate interrupt when I enable the interrupt?