Hello,
I have a design where I have an externally driven rising edge generate a GPIO interrupt on the LM4F120. In the ISR for this interrupt, the first (C) instruction is:
HWREG(WTIMER3_BASE + TIMER_O_CTL) = usTimerCtl;
which starts either one or both of the WTIMER3 timers in PWM output mode. The rest of the configuration for the timers in this mode has been setup prior to the interrupt.
I'm running the LM4F120 at 80MHz off the PLL, and the clock generating the rising edge is running at a much faster frequency.
When scoping the time from the incoming edge that causes the GPIO interrupt to the output on the PWM, I'm seeing a range of 50ns. In other words it appears there is a variability of 5 cycles in the interrupt latency here. I would expect basically a variability of essentially 2 cycles, since the asynchronous edge coming in could arrive just before or just after the 80MHz clock edge of the LM4F120. There should be no other interrupts occurring at this time. I've prioritized the GPIO interrupt at the highest level just in case.
I thought that the interrupt latency was deterministic on the LM4F120? So there must be something else occurring here. Any ideas?
(An interesting (perhaps related) question is how many cycles it should take for a timer to start when its enable bit is written?)
Thank you for any assistance you may be able to provide!