PDA

View Full Version : Need help calculating OSC cap values



Kamikaze47
- 26th June 2008, 16:54
I'm building a low power, low speed circuit using a 32.768kHz crystal but i'm not sure what cap values to use with the oscillator.

Does anyone know how to work out what values to use?

PIC: 18LF1320

CRYSTAL:
Frequency: 32.768kHz
Frequency tolerance: ±20ppm (@25°C)
Operating temperature:-10°C to 60°C
Shunt capacitance:2pf max.
Load capacitance:12.5pf
Insulation resistance:500MOhm @ 100VDC
Drive level:1µW max.
ESR (Equivalent series resistance):35KOhm

*edit*: I'm using a 32.768kHz crystal to facilitate accurate clock timing over longer periods, so that's why I ask about the caps because I have read that the wrong value will put the frequency out.

skimask
- 26th June 2008, 17:30
18F1320 datasheet, DS39605F-page 12, says typical values are 33pf, and it also says that the values used are for design guidance only. And as it further states below that,

Different capacitor values may be required to produce
acceptable oscillator operation. The user should test
the performance of the oscillator over the expected
VDD and temperature range for the application

So, in short, it'll really depend on everything you do...how you mount everything, temperature range, actual voltage range of the PIC, phase of the moon :)
Testing is about the only way to verify anything.

Kamikaze47
- 26th June 2008, 17:35
Yeah... I guess using a variable cap for one of them is a good idea?

skimask
- 26th June 2008, 17:38
Yeah... I guess using a variable cap for one of them is a good idea?

I don't think so, but that's just me.
I would think a variable cap would have more +/- over a temperature/voltage/sun angle range ( :) ) range than a standard cap.

And don't forget...when you're trying out those 'standard caps' and you're looking for accuracy, a lot of caps have tolerances as wide as something like +80%/-20%. You can get ones that are tight, but they'll cost you.

Kamikaze47
- 26th June 2008, 17:41
The problem is, if its going to be trial-and-error to work out the right value, i'm going to need a lot of caps.

skimask
- 26th June 2008, 17:43
The problem is, if its going to be trial-and-error to work out the right value, i'm going to need a lot of caps.
That's a fact.
But you've also got a completely configurable PIC that you can program in a bunch of correction values into.
(i.e. crystal is off 1%, program in 1% compensation).
So, as I see it, you only need 2 capacitors and a bit of math.

falingtrea
- 26th June 2008, 19:58
Microchip also has a couple of app notes on the osc circuitry that you might want to check out

Darrel Taylor
- 26th June 2008, 21:27
I don't think the Value matters as much as the 2 capacitors being the same.

Another quote from the datasheet...

Higher capacitance increases the stability
of the oscillator, but also increases the
start-up time.

If you have different value caps then it will change the frequency.

I've been using some 12pf caps that came with the 32768 crystals I bought. And it keeps real good time.

DT