I am attempting to measure the period between two events on different GPIO pins. I am assuming that to do this I use GPIO interrupts and GPT timer and concern on resolution down to 10 ns detection. Note that I am doing this in the user space? Is this correct path or is there a better method? What overhead will the software bring?
Hi shannon,
if you need to measure this in your application the approach you described is OK. The only thing that you need to consider is that the drivers are handled by the Operating System and it may cause some latency when measuring the time.
Other way can be in bare metal code, but we no longer provide the bare metal sdk for iMX.
And other approach could be to write to the registers directly in the initialization script that configures DDR memory. Here you can add instructions to toggle GPIOs and measure time with oscilloscope. This would be the most exact measuring.
Best regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------