I'm hoping someone can help me understand this code and later apply it to a project using Arduino clocked with a 10MHz reference (would need serial comm).
https://gist.github.com/billroy/4032657When I insert a 1pps signal to the input, I get this data on the serial monitor:
timing...
0:4096437 0
1:15583074 0
2:409407 0
3:15583071 0
4:409408 0
5:15583070 0
6:409407 0
7:15583070 0
8:409407 0
9:15583072 0
10:409407 0
...
I suspect that the first line is not valid, but 15583074 might be the number of CPU cycles since the previous input edge. Not sure about the trailing 0?
I do not know what the even lines are?
Then I insert a 15kHz signal and see:
timing...
0:237 60043
1:799 60092
2:800 60141
3:799 60190
4:801 60239
5:798 60288
6:801 60337
7:799 60387
8:800 60435
9:799 60485
10:801 60535
...
If my above wag is correct, I would expect to see 1600 cycles, but I see half. There is a note in the code about rising/falling edge, so maybe I am seeing the cycles between these edges? Then the trailing number, it increments a somewhat consistent 50 counts for each line.
I'm going to try to make a GPSDO and use long averaging techniques to slowly steer a highly stable OCXO. I wanted serial so I could communicate with the PC. I have not worked it all out yet. I might also want to parse NMEA from the GPS and pass that to the PC as well. Serial won't work with the 10MHz reference, and I probably will not be able to use the Arduino IDE as is either, but I think it can be done. (I've already written some code to parse NMEA and may need to do something for TSIP as well, if I do not find all the hard work's already been done
)
Thanks for any help.