I am working on a CC2650 application to measure pulse widths in the range of 1us. I found that setting up an edge-triggered interrupt and reading SysTick in the interrupting resulted in highly inaccurate measurements (as well as missed edges) because of the varying delay between the edge and the actual ISR execution.
I read in the tech reference that you can use GPTimers to capture the time that an edge occurred and trigger an interrupt. It looks to me like I need to do the following:
1) Use IOCFGx register to set the GPIO pin for edge detection (both edges) and set PORT EVENT x to be triggered when this happens
2) Set up two GPTimers for edge capture - one set for rising edge, one for falling.
Where I am confused, is in the how to map EVENT x to the GPTimer edge trigger. It looks like the MCU event fabric is the place to do this, but I can't make sense of the mapping.
I'm also wondering if can configure TWO timers to track edge events for the SAME input signal, one capturing rising edges, the other capturing falling edges.
Any help here, or example code, would be helpful.