Electronic – ATmega328 external crystal capacitor requirements

atmegacapacitorcrystaloscillator

I am reading this guide and it states that, in order to use an external 16 MHz crystal for an ATmega328, I need two 22 pF capacitors.
I found this bundle of two 20 pF capacitors and the crystal (sold specifically for this purpose).

I'm wondering if there's any difference between using the 22 pF and the 20 pF capacitors provided with the bundle.

Best Answer

Pedantically, the difference is 2 pF.

Practically, these kind of crystals (parallel resonant) are "cut" for a specific series capacitance. In the 16 MHz range, typical series capacitances are 18 pF to 30 pF or thereabouts.

In this case, you would hope that the crystal is cut for 20 pF, and hence they are providing you with 20 pF caps. In actuality, due to stray capacitance from the board, the caps should actually be a little less than the value that the crystal is cut for.

However, for this frequency of crystal and level of performance (it's an Arduino, frequency accuracy and stability is not terribly crucial), 20 vs 22 pF is no problem.


Finally, remember that if you can deal with really horrible frequency accuracy (10% tolerance IIRC) and a slower clock, the ATmega328 has an internal 8 MHz oscillator, which eliminates the need for the crystal and its associated caps. For minimal Arduino-like clones, it's a great way to minimize component count. However, this is only feasible when you don't need any timing critical functionality, such as the UART.


Edit: You're in luck! The crystal in the Adafruit bundle has a datasheet. Per the datasheet, the nominal load capacitance is 18 pF. Now, 20 pF will likely work fine, but it's not how you're "supposed to do it". Typically, you would assume 3 pF or so for stray capacitance (if you're working on a breadboard, it's probably much higher), and then size the capacitors as \$C = C_L - C_S\$ where \$C_S\$ is the stray capacitance. Ideally, you'd be using maybe 15 pF caps, but again, it's not too crucial in this situation and 20 pF is fine.