Loading...
Pages: [1]   Go Down
Author Topic: GPS-based frequency counter library  (Read 332 times)
0 Members and 1 Guest are viewing this topic.
Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 43
Posts: 2505
"We're a proud service of the Lost Electricity Reclamation Agency"
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't own a frequency counter, but I was interested in checking accuracy of system clocks and also RTCs. I'd seen a couple frequency counter sketches around, but they used the system clock as their time base. I thought that by using the 1Hz signal from a GPS receiver I could achieve pretty good accuracy. This library seems to do the trick, but of course I have no way of verifying accuracy, so a certain amount of hope is involved. I recently calibrated several RTCs with it, so I'll let those run for a while and see how it goes.

Check it out at https://github.com/JChristensen/gpsFreq. Comments welcome as always.
Logged

Get the infamous "One Million Ohms" board at tINDIE.com: http://tinyurl.com/BuyMohms

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 3196
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you should disable timer0 in order to avoid spurious glitches.
Logged

Check out my experiments http://blog.blinkenlight.net

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 43
Posts: 2505
"We're a proud service of the Lost Electricity Reclamation Agency"
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you should disable timer0 in order to avoid spurious glitches.

I saw that in other frequency counter sketches and had it coded in at one point, but frankly I don't see much if any difference. I do see a very occasional reading that seems to be off by a few Hertz and I wondered if that wasn't the cause. Probably would have to make a couple long runs, one with and one without, log the data and compare. I should try that, thanks.
Logged

Get the infamous "One Million Ohms" board at tINDIE.com: http://tinyurl.com/BuyMohms

Pages: [1]   Go Up
Print
 
Jump to: