I am using a 16MHz crystal with an atmega328. I added two capacitors to the crystal as usual. Everytime the capacitors are attached, avrdudee does not recognize the atmega. Once I remove the capacitors it's recognized. I've tried using different capacitor values from 22pf to 47uf and the results are the same. How come avrdudee fails to recognize the microcontroller when the capacitors are attached to the crystal?

  • 4
    \$\begingroup\$ Can you add a schematic for your circuit? \$\endgroup\$ – SolveEtCoagula07 May 22 '18 at 15:49
  • 2
    \$\begingroup\$ And if you could show the layout as well that would be great. \$\endgroup\$ – Ignacio Vazquez-Abrams May 22 '18 at 15:54

Which oscillator option are you using?

12-22pF is the limit for total capacitance C1 + C2 for low power oscillator.

The limit for each capacitor (C1, C2) for full swing is 12-22pF.

So one would expect it to work with the full swing oscillator (C1=C2=22pF) but perhaps not with the low power oscillator.

  • \$\begingroup\$ I was using a full swing oscillator. It worked though, i used 18pF caps. anything above 18pF didnt work. Thanks for helping out. \$\endgroup\$ – Noble Jun 5 '18 at 8:32

22pF is too much already, the ATmega328 datasheet, Section 13.3/13.4 specifies 12pF to 22pF on both XTAL1 and XTAL2 for both the 16MHz full swing and the low power oscillator options, and your layout may already provide a few pF.

If you use a breadboard, it has about 15pF between adjacent clamps.

  • \$\begingroup\$ Breadboard capacitance is much less than that. A few pF. \$\endgroup\$ – Spehro Pefhany May 22 '18 at 17:27
  • 2
    \$\begingroup\$ The last time I measured mine it hit the 15pF. Maybe due to debris. \$\endgroup\$ – Janka May 22 '18 at 17:30
  • \$\begingroup\$ I was using a vero board. 18pF worked. \$\endgroup\$ – Noble Jun 5 '18 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.