How to measure period between GPIO events

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to measure period between GPIO events

423 Views
swanner
Contributor I

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?

Labels (1)
0 Kudos
1 Reply

335 Views
Carlos_Musich
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos