Left Coast, USA
Offline
Sr. Member
Karma: 4
Posts: 499
Sometimes I just can't help myself.
|
 |
« Reply #2 on: September 18, 2010, 04:00:32 pm » |
From the crystal's point of view, the two 22 pF capacitors look like they are in series, so they present a total parallel load of 11 pF. There are a few pF more (typically 5-10 pF), due to stray "wiring" capacitance and due to the input pin capacitance on the CPU.
Bottom line: If the crystal is rated for a 20 pF load, and you have 22 pF caps, the actual frequency will (probably) be a little high. In my experience, this will be a few tens of parts per million; maybe as much as a hundred or so parts per million. If you require 50 parts per million or better, then you will probably require some "padding" (small values of capacitors in parallel with the 22 pF caps) to bring the frequency down. Note that the crystals themselves are rated with certain error tolerances that may be on the order of 50 ppm. Note also that the crystal frequency will vary with temperature, so if you confirm its calibration at 20C, it might be somewhat different at 35 C or 5C.
For many (most?) applications, a few hundred parts per million won't create any practical problems. If you want to use an ATmega timer to create a time-of-day clock that remains accurate for many days note that an error of one second per day turns out to be something like 11.5 parts per million.
Bottom line: Just to get the thing up and running, you can use just about anything from 10 pF to 50 pF. If you require extreme accuracy, you will probably have to experiment. You will also need some test equipment that is at least as accurate (probably several times as accurate) as whatever it is that you are testing.
Regards,
Dave
Footnote: Sixteen MHz crystals are commonly available (off-the shelf) with parallel resonance specifications anywhere from 7 pF through 32 pF. They are also available ground for series resonance (designed to work in a circuit that is not the same as the ATmega's crystal oscillator circuitry). Any of these will "work" with an ATMega chip (yes, even the series-ground one), but the actual frequency may be a little different than what is marked on the device.
If you really require something in the neighborhood of 10 ppm accuracy, the easiest way would be to buy an oscillator and not a crystal. The fuse settings for oscillator use are different than for crystals for the ATmega chips, so your modus operandi might be a little different than the "Pure Arduino Way." (Different bootloader settings for example. Or use the ICSP connection with some external programmer to upload sketches rather than the bootloader going through the ATmega UART. Stuff like that.)
|