Measuring netfrequency: Difference between revisions

From NURDspace
(Created page with "* arduino, on pin 3 a 1kHz clock signal ** the 1kHz clock signal is derived from a 10MHz OXCO via a PIC12F675 which divides it by 10k (see http://www.leapsecond.com/pic/src/pd...")
 
Line 8: Line 8:
* when an interrupt comes in via pin 3, a uS timestamp is taken ('t0')
* when an interrupt comes in via pin 3, a uS timestamp is taken ('t0')
* everytime the sign of the signal changes (via A0), then a timestamp is taken and the timestamp t0 is subtracted
* everytime the sign of the signal changes (via A0), then a timestamp is taken and the timestamp t0 is subtracted
* also pin 8 is inverted (output pin)


==== result ====
==== result ====


* it works somewhat but there's an enormous lapse
* it works somewhat but there's an enormous lapse
[[File:50hztest001.png|640px]]
* yellow is incoming 50Hz signal
* blue is the toggle-pin (pin 8)

Revision as of 15:07, 7 October 2022

  • arduino, on pin 3 a 1kHz clock signal
  • the signal to measure is connected to pin A0 of the arduino


first attempt

  • when an interrupt comes in via pin 3, a uS timestamp is taken ('t0')
  • everytime the sign of the signal changes (via A0), then a timestamp is taken and the timestamp t0 is subtracted
  • also pin 8 is inverted (output pin)

result

  • it works somewhat but there's an enormous lapse

50hztest001.png

  • yellow is incoming 50Hz signal
  • blue is the toggle-pin (pin 8)