clock that should work in very Precisely

Thread Starter

micropad

Joined Dec 24, 2011
106
Dear All
Please Let me know that using pic16f877a's timer1, can we build a clock that should work in very Precisely
 

hexreader

Joined Apr 16, 2011
581
Your clock will be as accurate as the crystal that you use for timing, or less accurate if your code is poor.

What is "very Precisely" ? one minute per day, or one PicoSecond in 10,000 years?
 

Thread Starter

micropad

Joined Dec 24, 2011
106
Thanks hexreader for reply
I mean at least one second for one year and I sow lot of web site says that it is impossible that is why reason RTC existing
please help
 

t06afre

Joined May 11, 2009
5,934
Timer one is well suited for such task. You can use a 32.768KHz crystal as an external oscillator. Timer1 with external oscillator at 32.768KHz generates overflow interrupt every two seconds. If we set timer1 to start at 0x8000 (32768), the TMR1 will overflow every one second. It is some programming tricks involved to start timer1 at 0x8000. But I leave it to you to crack down that code
 

hexreader

Joined Apr 16, 2011
581
One second per year is about 1 part in 30 million, if my maths is correct.

You might just manage that with a very expensive crystal oscillator (where the crystal is contained within an oven), but no ordinary crystal will even come close. 10PPM is typical for a standard crystal.

What about synchronising to a radio clock signal?

Not sure that RTC will help much. They are designed for better stability, but still rely on a crystal.
 

kubeek

Joined Sep 20, 2005
5,795
Maybe using the 50/60hz mains frequency it is not completely stable, but the power companies are supposed to correct it so that the number of pulses in each day is constant?
 

t06afre

Joined May 11, 2009
5,934
I agree. One second pr year. Is much harder to get. The week link here is not the PIC. But the crystal. The best crystals I have seen has has a accuracy around 5 PPM. But errors due to temperature drift is not accounted for in this number
 

John P

Joined Oct 14, 2008
2,026
I think if you use the 32.768KHz crystal, you'd have something as accurate as a digital watch, which is normally considered pretty good, but not as good as a second per year. You can use a GPS receiver for super-accurate time though, and they're available in modular form. Would that be useful?

GPSDO, I'm not familiar with that, but it ought to work about the same.
 

ErnieM

Joined Apr 24, 2011
8,377
Maxim IC makes a few real time clock chips with a built in crystal. They are a little pricy (near 10 bucks for 1 in distribution) but the best accuracy I've seen without crystals in temperature controlled ovens. Since these chips have the crystal built in they can measure their own temperature and perform corrections. They are rated 2 ppm, which is larger then your 1 sec/yr.

Google DS3231 or DS3232.
 
Top