PDA

View Full Version : Crystal "calibration" - how to (a simple way)?



flotulopex
- 30th September 2007, 19:00
Hello,

I have a 16F690 I with a 4MHz crystal. As specified in it's datasheet, I use two 22pF caps (C1 + C2).

I'm building a time depend circuit (charger) where a +/- minute accuracy over 10 hours is not important.

Nevertheless, I'd like to know how to "calibrate" the crystal to make it more accurate.

I read this: http://ww1.microchip.com/downloads/en/AppNotes/00588b.pdf and still don't know if I'm going to pull the trigger :D

Then, I found this: http://ww1.microchip.com/downloads/en/DeviceDoc/70054b.pdf witch looks a little more understandable (comprehensible?) to me.

Finally I read this one: http://ww1.microchip.com/downloads/en/AppNotes/00826a.pdf.

I was looking for a "simple way" to check the crystal's accuracy.

Does anyone have this explanation for me?

I only have a cheap PC 20MHz oscilloscope so I don't expect to make lab measurements...

Archangel
- 30th September 2007, 23:37
Hi Roger,
A quick way to adjust the calibration might be to replace the fixed capicitors with variable ones and tweak them until your circuit runs at the expected time.
JS

flotulopex
- 1st October 2007, 07:32
This is one way of doing, thank you Joe S. But this can take a lot of time...

Isn't there another more "scientific" way to measure the correct oscillation frequency?

I found some information in previous posts (can't find it right now) about measuring the crystal but there was an issue with the capacitance of the probe making the result inaccurate.

If I make a short code toggeling a port and me measuring it with my (poor) oscillo, would the result be somehow reliable?

Archangel
- 1st October 2007, 08:07
This is one way of doing, thank you Joe S. But this can take a lot of time...

Isn't there another more "scientific" way to measure the correct oscillation frequency?

I found some information in previous posts (can't find it right now) about measuring the crystal but there was an issue with the capacitance of the probe making the result inaccurate.

If I make a short code toggeling a port and me measuring it with my (poor) oscillo, would the result be somehow reliable?
Sure there is, hook up a frequency counter, an accurate one, time your circuit's operation and log both entries, adjust as in above and time it again and compare OSC speed to circuit change, you then have a ratio to work from. OR use an RTC.
Oh yeah, I thought of one more way, if you have an accurate radio reciever, you can check for the oscillators harmonic frequencies at different dial settings, 5,10,40,80 mhz and so on up and down the dial. Or use scope to form Lissajous patterns. example link http://www.egr.msu.edu/classes/ece482/Teams/99spr/design2/web/resources/lissajous/lissajous.htm

Just curious Roger, why all the fuss for a battery charger?
HTH
JS

Acetronics2
- 1st October 2007, 10:14
Hi, Flotul

The best and easier way is to buy quality crystals ... ( from Farnell i.e...).

The second way is to use External DIP oscillators ...

The Third way is to buy a good Freq meter ....

I also think you can get precise 10 Mhz by radio ... ( see Radio ham ...)

You can also correct time every minute with a DCF module !!!


What I usually do is to play with the timer preload value ... fits most of time !!!


One of the electronician's main headache has always been to have home good references ... ( Volt, freq, temp,pressure ...humidity ( LOL ! ) )

Alain

flotulopex
- 1st October 2007, 11:16
Thanks Joe S,

Today I build a battery charger and tomorrow, what will it be? I just take the opportunity of this circuit to learn a little more about the accuracy my PIC can (or could) have.

Of course, there is absolutely no need to have a lab's chronograph to charge batteries... ;)

Merci Alain. What is your measuring point to evaluate your precision? Is it a port as I mentionned in post#3?

Acetronics2
- 1st October 2007, 12:36
Hi, Roger

With time, I have built or bought ( thanks to Trent !!! ... LOL ) all the references I need.

For Frequency ... I Bought ( God bless you, Trent ) a nice Discrete components meter 20 Years ago ... still accurate !!!


Most of time, I verify clocks accuracy ... letting them run for a week !!! ( DCF clock as a reference ...)

Seriously : ... after having made a "rough tuning" during an hour or a day ...

Alain

flotulopex
- 1st October 2007, 13:57
...rien de tel que la pratique!!!

Thank you Alain and have a nice day.

Acetronics2
- 1st October 2007, 14:28
Yes !

And that includes temp, Humidity and voltage variations along a "significant" period ...

Amitiés

Alain