Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

32Khz Crystal

Status
Not open for further replies.

VictorPS

Member
I have a RTC base on DS1302, problem is it have drift 1 min/week which is not acceptable.
I know I need a high accuracy crystal 32khz to solve this problem.

How I choose which crystal? There is a parameter +/-ppm on the freq accurate.
What does +/- ppm mean? If I only allow 1 seconds/week drift or better, what ppm I need?

Or is there any method I can keep the RTC run accurately?

Btw, the RTC DS1302 is link to a PIC and display on LCD, running on room temp 25~30degC.
 
32KHz crystals are generally very good, as they are specifically designed for time keeping use. You say it 'drifts', do you mean it's 30 secs slow one week, and then 30 seconds fast the next? - or does it simply lose (or gain) a minute per week - in which case you've not adjusted it accurately.
 
Are you sure you're using the right type of 32.768 KHz crystal? Here's an excerpt from the parts list at glitchbuster.com;

Code:
XT-32K-6  	32.768 kHz "Tuning Fork" Crystal, 6 pF load (xlnt for DS1302)  	     $0.30
XT-32K-12 	32.768 kHz "Tuning Fork" Crystal, 12 pF load (xlnt for PIC TIMER 1) 	$0.30

Happy Holidays... Regards, Mike
 
Hi Nigel,
It is 1 minute gain per week.

Mike,
The crystal I salvage from alarm clock, I do not know if it is for 6pf load.
After checking DS1302 datasheet, it require crystal having a specified load capacitance of 6pF.

Btw, what does +/-ppm mean? which I saw it on Farnell catalogue.
 
VictorPS said:
Hi Nigel,
It is 1 minute gain per week.

In that case you just need to adjust it, you should have a preset capacitor that sets it's exact frequency. As it's running fast, you need to increase the capacitance.

Btw, what does +/-ppm mean? which I saw it on Farnell catalogue.

ppm is 'Parts Per Million'.
 
it gives you accuracy (actually max error) of the xtall.
the smaller the number, the more accurate crystal...
if you see something like 200ppm it means that in one milion
of cycles (regardless of crystal frequency!) error will be no more than +/- 200 cycles.
 
answering one of your original question, 1 second per week is about 1.65 ppm (since there are 604800 seconds in a week)

but since you said you consistently gain 1 minute a week, that has nothing to do with the crystal drifting... if it's gaining the same amount of time each week, then the clock would have to be constantly running slightly faster than it was supposed to... which, as nigel said, is a matter of adjusting it to the right frequency in the first place.
 
Maybe a temperature issue? I made a clock with a ds1302 and a DS32kHz TCXO. It's drifted about 20 seconds over the past 18 months.
 
So i have 60s(1 minute) drift per week (99ppm) , it means the crystal I use may be is 100ppm or worst. :(
I manage to get a crystal which is +/-20ppm locally, it means worst case I have +/-12s per week.

I don't have freq counter, I may have problem adjusting the frequency

May be i need to consider DS32khz (+/-2ppm), but it is very costly.
 
VictorPS said:
So i have 60s(1 minute) drift per week (99ppm) , it means the crystal I use may be is 100ppm or worst. :(
I manage to get a crystal which is +/-20ppm locally, it means worst case I have +/-12s per week.

again, having a constant 1 minute per week is not a drift! drifting is a problem with STABILITY, where the frequency of the crystal actually shifts over time, often due to temperature changes. if it is gaining a minute a week consistently, then what is wrong is that the frequency of the crystal is not precisely 32.768Khz, and at a rate of only 1 minute out of each week, it would only have to be off by about 3 Hz, which is only about 0.009% error from its "ideal" value! that's why you would have to slightly tune the frequency to get it to just the right value. without a good frequency counter that could be difficult, but if the RTC datasheet has any info about tuning, perhaps you can find some formulas to estimate component values to tweak based on how far off you currently are.
 
Most 32.768 KHz xtals seem to have a 20 ppm rating, about +/- 1/5th min per week. 50 ppm and 100 ppm are other common tolerances.

The PIC could also do the math to accomodate freq error. Just record in EEPROM when the time was set, calc how many weeks since then, and subtract 1 min per week from the current time. Note this will help for freq error, but nothing for freq drift error.
 
Hey Oz'...

That "software trimmer capacitor" scheme actually works quite well... I tested it on a 20-MHz 50-ppm crystal which was oscillating at 20,000,400 Hz and ended up with an RTC accurate to within a half second over a ten day period (about 18 seconds/year, not including crystal aging and temperature drift)... I simply added one cycle (200-nsecs) to TMR2 each 800-usec interrupt cycle for the first 100 interrupt cycles every second (every 1,250 interrupt cycle period)...

Regards, Mike
 
VictorPS said:
So i have 60s(1 minute) drift per week (99ppm) , it means the crystal I use may be is 100ppm or worst. :(
I manage to get a crystal which is +/-20ppm locally, it means worst case I have +/-12s per week.

I don't have freq counter, I may have problem adjusting the frequency

May be i need to consider DS32khz (+/-2ppm), but it is very costly.

You don't need a frequency counter. Adjust it a bit, then check it against the radio time signals - 24 hours apart. Then adjust again. Keep a note of roughly how many degrees you turn the screw through and you should be able to home in on the right frequency within a few days.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top