Frequency Measuring - best practice?


hi,

i working little project, supposed measure frame refresh signal video camera , synchronize stuff (led lighting, motors etc). using cheap hdmi-vga adapter , tried measuring vsync, since getting erratic readings, moved solving problem away , switched using reference port (1khz / 2v) signal hantek 6022be usb dso.

i using circuit suggested in post make arduino digital in pulse signal:
http://forum.arduino.cc/index.php?topic=312346.msg2164921#msg2164921
and seems work fine.

before circuit


after circuit



then followed these examples make sketch:
http://arduino.datamaster2003.com/f-measurements.htm modified simplify output on serial, following results:

code: [select]
1.02khz 98740 ms
1.01khz 100732 ms
1.01khz 99736 ms
1.01khz 99736 ms
1.01khz 100736 ms
1.03khz 99736 ms
1.03khz 99736 ms
1.02khz 99732 ms
1.00khz 100736 ms
1.03khz 99736 ms
1.01khz 99736 ms
1.02khz 100732 ms
1.03khz 98740 ms
1.04khz 100732 ms
1.01khz 100732 ms
1.01khz 98740 ms
1.00khz 100732 ms
1.02khz 100736 ms
1.02khz 98736 ms
1.01khz 100732 ms
1.01khz 99736 ms
1.05khz 99740 ms
1.02khz 100732 ms
1.02khz 99732 ms
1.02khz 99736 ms
1.02khz 99736 ms
1.04khz 99736 ms
1.03khz 100736 ms
1.03khz 99736 ms
1.02khz 99732 ms
1.04khz 99736 ms
1.01khz 100732 ms
1.01khz 99740 ms
1.03khz 99732 ms
1.03khz 100736 ms
1.04khz 98736 ms


i tried running sketch both on tinker.it duemilanove , sainsmart uno, same results.

i find output quite inaccurate though , wonder if:
- thats normal deviation not have implications project?
- doing wrong?
- reference signal dso inaccurate?
- have more accurate timer readings millis() can provide?

i appreciate feedback of people know more this.

thanks,t.

just wondering, why need measure frequency sync it? important in own right, or sufficient sync? because easier.


Arduino Forum > Using Arduino > Programming Questions > Frequency Measuring - best practice?


arduino

Comments