AVR crystal loading capacitors question

Hi all,

I'm putting together a small board that will be an FM radio (Atmega328p, Si470x FM chip and LCD display).

Currently the board has a 16 mhz SMT crystal on it rated at 8pF load capacitance and 100 ohm ESR (click picture to see the part).

I experimented with loading capacitors (18pF, NPO) types and got these (interesting) results (fuses set for full swing osc - Low Fuse = 0xF7):

Cap on XTAL1 only:
XTAL1 pin: Vp-p 1.5v
XTAL2 pin: Vp-p 3.0v

Cap on XTAL2 only:
XTAL1 pin: Vp-p 4.75v
XTAL2 pin: Vp-p 2.0v

Cap on both:
XTAL1 pin: Vp-p 1.5v
XTAL2 pin: Vp-p 1.5v

No cap on either:
XTAL1 pin: Vp-p 1.5v
XTAL2 pin: Vp-p 1.3v

It's interesting that with a cap on the XTAL2 pin only, the XTAL1 pin has virtually rail-to-rail crystal swing. This leads me to think that this is the best configuration (but the data sheet says that the caps should be EQUAL).

Any ideas why it's acting this way, and suggestions on how to actually do it properly?

Thanks!

i have seen similar on many mcu and osc circuits. like all cmos inverter ckts the ratio of caps determines voltage gain so those results are expected. frequency accuracy and temperature stability are compromised when deviating from mfg recommendations. however this is so slight as to be ignored in most cases. i prefer no caps at all for hobby use and even most commercial applications depending on the client. for top notch stability and accuracy i use tco.

taboocoffe2cents.jpg

ps. i forgot to mention startup time which is also impacted. accuracy, stability, startup, etc are all tradeoffs and the 2 equal cap standard is a safe compromise. quality of modern crystals, even cheap chinese, so good though imo none of these factors are that important. there will always be special cases but rare.

pps. crystal performance has always been special interest for me and while lots of experiments never bothered to document. your data is one for the hd, thanks.

ppps. note that voltage on the clock output pin, not the input, is most important when driving other devices. that might be a deciding factor for those situations.

john1993:
i have seen similar on many mcu and osc circuits. like all cmos inverter ckts the ratio of caps determines voltage gain so those results are expected. frequency accuracy and temperature stability are compromised when deviating from mfg recommendations. however this is so slight as to be ignored in most cases. i prefer no caps at all for hobby use and even most commercial applications depending on the client. for top notch stability and accuracy i use tco.

Interesting. Well, Atmel says to use the same cap values for both, but like you I usually use no caps at all and it works just fine. I was just surprised at the results (since this was the first time that I thought of checking what the caps would do AND had a "board-in-progess" available to do it).

The crystal also has a limitation as to how much drive it can take (200 uW max), but I don't know how to calculate how much drive the crystal is getting. Do you measure the volts RMS across the crystal VS the esr and get a current, then calculate the power? It's probably bad to overdrive the crystal......?

How on earth can you possibly measure RF voltages on an oscillator circuit with picofarad loading values?

you can spend half grand on a precision active scope probe, or like me, use a $1 electrometer grade transistor. femptofarad loading will have little effect on the readings. waving your hand a foot away maybe more of a concern.

however in most cases even typical 10pf 100megaohm regular probe will not throw things off by much either. maybe with 32khz watch crystals so sensitive that blowing on it can stop the clock.

the only case where max power is an issue probably with transmitter or other high power oscillator. running cheapo chinese ook 433mhz modules at 12v is technically within spec but i swear you could fry an egg on that saw crystal. specially if antenna is missing or not quite right. i cant imagine avr clock heating up enough to detect or effect frequency significantly no matter what.

Paul__B:
How on earth can you possibly measure RF voltages on an oscillator circuit with picofarad loading values?

Well, I've got this very expensive and very cool thing that has probes on it and when I touch the probe to something, wiggly lines appear on the screen.

The thing has all kinds of knobs and buttons and even a USB port... someday maybe I'll figure out what all those buttons do.

When I put the probe on the crystal, I get an almost perfect looking sine wave and the screen says "Freq(1)=16.000 Mhz" and "Vp-p(1)=3.125V"

I'm still trying to figure out what all those buttons do though......

Here's a picture of it:

:slight_smile:

Paul__B:
How on earth can you possibly measure RF voltages on an oscillator circuit with picofarad loading values?

+1

LarryD:
+1

Want me to post a screenshot from the scope?

The point is your scope has input capacitance to ground so the act of measuring changes the circuit.

I have found the capacitance on either side of the xtal provides stablitity and aids in oscillator start up.

.

LarryD:
The point is your scope has input capacitance to ground so the act of measuring changes the circuit.

I have found the capacitance on either side of the xtal provides stablitity and aids in oscillator start up.

.

Very true... but what's the point relative to the original post? I observed something that I didn't quite expect and asked for input / opinions on what I saw.

I know the scope probe has capacitance. So does the PC board and the traces.

As far as oscillator start up, I assume it starts OK since the board works. Whether it starts "slowly" or "quickly" I really don't know (or care) as long as it boots up eventually.

:slight_smile:

Your testing is interesting.
Have you considered doing some testing after feeding the oscillator output through a CMOS buffer, then look at the o/p of the buffer.
Not sure what the results might be.
May be interesting to monitor the o/p for startup/temperature/powersupply changes, change loading capacitors then rerun the same test.
.

Krupski:
Very true... but what's the point relative to the original post? I observed something that I didn't quite expect and asked for input / opinions on what I saw.

The point is that the capacitance of the probe is equal to or greater than the loading capacitors you are using.

as hinted in my previous post a scope, unless really old/poor-performer like in k's joke pic, has less effect on the signal than you might think. i say this having compared the same signal on high end tek with regular probe and with purpose-designed active probe. probably same for a good rigol. another way to look at it is adding 5-10pf to already 22pf of typical avr circuit? same difference.

i suspect most critics have not taken time to actually investigate.

LarryD:
Your testing is interesting.
Have you considered doing some testing after feeding the oscillator output through a CMOS buffer, then look at the o/p of the buffer.
Not sure what the results might be.
May be interesting to monitor the o/p for startup/temperature/powersupply changes, change loading capacitors then rerun the same test.
.

Well, if I did that I don't know what the output would mean. The CMOS buffer would probably switch rail-to-rail unless it was one of those "single stage unbuffered" types. Even then, I don't know if they are linear (meaning would the output be proportional to the input and show me amplitude differences?).

Paul__B:
The point is that the capacitance of the probe is equal to or greater than the loading capacitors you are using.

The document you sent me in fact shows how little all this matters... a 5.000 volt signal becomes 4.9995 with a 10 meg probe... and the capacitance affects a perfect square wave rise time by 8.5 nanoseconds.

I can't argue with FACTS, but I can argue with facts that are irrelevant to the topic being discussed.

Sure, if I had a 30 mhz L/C oscillator and touched the scope probe to it, the frequency would change by kilohertz or more.

If I had a poor digital design that suffered from a nanosecond length glitch, putting the scope probe on it might cause the glitch to go away (this actually happened to me years ago... but I digress).

But, a strong low output impedance CMOS inverter string being used as a low frequency (16 MHz) oscillator doesn't even feel the scope probe. I could probably connect clip leads to the crystal, then put the other ends on my tongue and the thing would still oscillate! (well probably not but you get the point).....

Krupski:
But, a strong low output impedance CMOS inverter string being used as a low frequency (16 MHz) oscillator doesn't even feel the scope probe.

I thought you were measuring the XTAL1 pin as well as the XTAL2.

If the capacitance across XTAL2 does not affect things, why do we put a loading capacitor across it in the first place?

There's a good question for you. :grinning:

according to post #1 xtl2 cap has major effect on output voltage.

anyway why do people use ANY caps at all? mostly out of sense of tradition and ritual i think. "because thats just the way its done"

accuracy, stability, startup, etc are all tradeoffs and the 2 equal cap standard is a safe compromise. quality of modern crystals, even cheap chinese, so good though imo none of these factors are that important.