k64F precision pulse width measurement

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

k64F precision pulse width measurement

828 Views
davenadler
Senior Contributor I

Need to measure a short pulse.

Precision dictates this cannot be done using interrupts on pin transition; must use a hardware timer...

Using K64F timer hardware, what's the best way to measure an external pulse width?
Thanks!

Labels (1)
0 Kudos
3 Replies

548 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Dave,

Please refer the ftm dual_edge_capture demo in SDK_2.3.0_FRDM-K64F.
You can download the SDK_2.3.0_FRDM-K64F from MCUXpresso SDK Builder.

ftm dual_edge_capture SDK_2.3.0_FRDM-K64F.jpg

Pulse width measurement Dual Edge Capture mode.jpg

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

548 Views
davenadler
Senior Contributor I

Thanks Robin, I saw that. Dual-edge capture relies on the pulse width being within the timer duration (longer pulses will wrap to smaller values), and flex timer is only 16-bit resolution. How can I measure a wider range of pulse values and/or get higher resolution?
Thanks,
Best Regards, Dave

0 Kudos

548 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Maybe you can use the Timer Overflow Interrupt(TOF) to measure a wider range of pulse values.
Software count how many times the Timer Overflow Interrupt has happens.

For example:

pulse with.jpg

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos