Measure phase between 2 signals (5kHz)

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

Measure phase between 2 signals (5kHz)

890 Views
computersrl
Contributor I

Hi all,

I am trying to do a simple job: Use a FRDM-KL46Z board to measure time (phase)  between 2 digital oscillations: first signal is 5kHz @50% duty, 3.3V amplitude generated onboard via PWM,  the second signal is shifted (delayed) from the first.

This is an investigation on how to demodulate signals from a LVDT, first signal is the 5KHz fed into the primary coil, the second signal is form the secondary winding, the displacement is proportional with phase shift of the secondary from the primary signal...

Using a logic analyzer I can see the signals, the phase of the second seems to follow the LVDT displacement, I only have to measure it somehow with the FRDM KL46Z board.

I am not sure how to do this with the counters/timers available in FRDM-KL46Z board? I managed to generate the PWM for the primary, just need to feed both in some digital inputs and measure phase between these 2 signals...

Any suggestion is welcome

Cristian

0 Kudos
Reply
2 Replies

760 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

The Input Capture Mode of Timer/PWM Module (TPM) can be used.

31.4.4 Input Capture Mode.png
For example:
calculate it by the frequency of TPMx_CNT, the value of TPMx_C0V and TPMx_C1V.

capture.png

Best Regards,

Robin

 

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

760 Views
mjbcswitzerland
Specialist V

Hi Christian

See the two methods in chapter 7 and 8 of  http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF

I would use the first (port DMA triggering) so that you have high resolution time stamps of a number of edges of the two input signals so that you can then determine frequency, mark-space-ratio (if needed) and accurate phase shift between the two.

Regards

Mark