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!
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.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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
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:
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------