Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHASE SHIFT CALCULATION

Status
Not open for further replies.

January Mahlalela

Electrical
Nov 18, 2016
7
HELLO FELLOWS

Could you please help me with methodologies that can be used to calculate the phase shift between two square waves using an arduino uno micro-controller.
 
Replies continue below

Recommended for you

I haven't played with the Arduino itself, but the most likely strategy would involve time-stamping like edges of both square waves. Time between these edges for one waveform is the period, and time between these edges for the two different waveforms is the shift. The ratio provides the fractional shift, which could be expressed as percentage or "degrees".
 
I would look at the timer/counter section for the micro controller. If you AND phase A with NOT phase B and use that as a gate for a timer/counter. That provides the delay between phase A and phase B. I would use another counter/timer to count the period of the square wave. The trick is to learn how to use the counter timer because they usually count or time at the frequency of the micro controller.

Peter Nachtwey
Delta Computer Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor