Hello Everyone,
I am trying to use the ic_pal module to trigger an interrupt when detecting a falling edge. To check my work, I am toggling an output pin in the ISR handling the interrupt and using a logic analyzer to visualize the captured event. This way I can estimate how accurately I can react to such event. Most of the time, this works sufficiently fast, but often there are delays that are significant for my application.
The minimum expected timespan between two falling edges is 4 microseconds. I can see consistent delay (averaging ~2.3 microseconds) when reacting to a falling edge after a long run of no edges. When edges are more frequent (and rather fixed) the delay is very small and stable (a few hundreds of nanoseconds). Attached are screenshots from the logical analyzer that illustrate both cases (purple is the digital input and blue is the output pin).
I would appreciate help understanding what could cause this behavior. I assumed there would be an overhead of the interrupt handler, but it seems small and insignificant some of the time. Could this be due to some other abstraction of the ic_pal? Could I use the eMIOS driver directly to trigger an interrupt on edge?
Platform is DEVKIT-MPC5748G
ic_pal is configured over eMIOS for falling edge detection.
Thanks and best regards, Chen