Author Topic: GPS clock reference for avr  (Read 265 times)

0 Members and 1 Guest are viewing this topic.

Offline SlashBuster

  • Contributor
  • Posts: 5
GPS clock reference for avr
« on: August 04, 2019, 12:18:04 pm »
Hi there,

currently I'm trying to make a gps accurate watch with an avr.

But I'm not sure how to calibrate the internal clock of it.

The setup is a org4400 gps module which is controlled by an attiny817.
Is there a "best practice" way to do that?

The Attiny817 has a internal Clock and 32kHz tuning fork.

Thank you in advance
Best regards
 

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: au
Re: GPS clock reference for avr
« Reply #1 on: August 04, 2019, 08:58:07 pm »
currently I'm trying to make a gps accurate watch with an avr.
But I'm not sure how to calibrate the internal clock of it.
The setup is a org4400 gps module which is controlled by an attiny817.
Is there a "best practice" way to do that?
The Attiny817 has a internal Clock and 32kHz tuning fork.
Do you want this to work with no GPS, or is the GPS always connected and always on ?

If the GPS is always there, I think you can simply ask the GPS the time...
If the GPS is only sometime there, that needs more finesse.

Internal Clocks are very poor, 32kHz tuning forks are better, but still have parabolic error curves, which are not great.
You could calibrate 32kHz at room temperature, and hope the temperature does not change much.

Capture of 1pps at 32kHz gives you ~31ppm in 1 second, and ~3ppm in 10 seconds, and  61 seconds of capture will give you 0.5ppm
32.768k*61 = 0x001E8000, so you can simply read the lower 16 bits captured every 61 seconds, via the 1pps signal
32.768k*(1+100u)*61 = 0x001E80C7  is the result for a 100ppm error in Crystal.


Better may be to run the AVR from a TCXO and calibrate that, as that allows longer no-GPS times.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf