ATmega328p crystal load cap edit:general atmega standalone ?'s

I'm looking for a crystal to run my ATmega328p by itself. What load cap should it be? I'm not needing it to be terribly accurate since it will have a RTC attached to it to handle time. But I would still like to know the optimal numbers for doing this.

thanks

Capacitors in the range of 12pF to 22pF are recommended by the datasheet (Table 8-3).

--
The Arduino Drum Machine: MIDI development system with 14-track MIDI drum machine sequencer / groove-box software

thanks. Is the load cap defined by any if the info in this title here, or should i find somewhere else to get this?:
"16.000 MHz 16 MHz Crystal HC-49/S Low Profile"
http://www.taydaelectronics.com/servlet/the-257/16.000-MHz-16-MHz/Detail

its hard to find stuff that actually in stock/doesnt have a two week wait time on mouser. Where else should I be looking for this stuff?

They are not giving you enough information; they should specify the crystal's load capacitance. It could very well be this Citizen part:

http://www.citizencrystal.com/images/pdf/m-hc49us.pdf

Notice in the "Standard Specifications" part of the datasheet it says CL (Load capacitance) is 18pF. The two capacitors you are adding combine in series so should be about twice this number --> 36pF. But, there is also capacitance at each input pin of the ATmega328 microcontroller (Atmel does not say how much) and capacitance in the PCB wiring too.

For an 18pF CL crystal I would err on the high side and start off with 22pF load caps (11pF in series) and count on there being some extra 7pF of capacitance in the AVR pins and PCB traces. As you said, you do not have high accuracy requirements so it's probably not critical...you could just go with 18pF load caps (in the middle of the 12pF-22pF range).

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

You can find the 16MHz crystal and 22pF caps at dipmicro.com, very inexpensive, and just $2.50 for shipping. Pick up some other parts to play with at the same time.

I being using the AtMega328 often with this capacitors

Paired with this crystal

Hope this works for you

Im looking at this tutorial:

I'm looking for 2 10 uF capacitors, but this thing isnt very descriptive.... What does the voltage rating need to be? I figured just 5v, but is that it, or is it not just as simple as that?

The capacitor's voltage rating is an absolute maximum, and these ratings are only available in standard values - pick the next one greater than 5V for the range (typically 6.3V / 10V / 16V). It doesn't matter if the voltage rating is a lot higher, but if its too small its bad news. For these decoupling caps you can pick a higher value too such as 22uF - its not at all crucial.

One thing that is important is the 0.1uF or 0.22uF ceramic decoupling capacitor - this does the high-frequency decoupling and should be close to the chip.

And for the crystal load capacitors - getting the value spot n is only important if you want high accuracy of frequency. People use 22pF pretty much by default for clock crystals.

Okay, thanks
Could you explain the decoupling caps a little more? I only ever see that mentioned but never really explained.

stoopkid:
Okay, thanks
Could you explain the decoupling caps a little more? I only ever see that mentioned but never really explained.

Capacitors have the property of being able to pass AC voltages but block DC voltages. So if a so called 'bypass' capacitor is wired from a +5vdc power voltage input point right as it enters a chip like a micro, it will help route any small 'noise' to ground. Noise is in fact is some small amount of AC voltage riding on the +5vdc power trace. This does not effect the The DC voltage in any other way. The caps is in effect 'bypassing' the ac noise voltage to ground rather then letting it continue to ride on the +5vdc line into the chip.

Lefty

Okay. Is that in addition to the 10uf capacitors in that tutorial?

stoopkid:
Okay. Is that in addition to the 10uf capacitors in that tutorial?

Yes. There is frequently a larger cap, such as 10uf acting like a bypass cap where the voltage enters a PCB or a breadboard. But it's also a good practice to wire .1ufd caps physically close to any IC device between it's Vcc and ground connection pins as close to the package as possible with the shortest cap leads possible.

A mega 328 can utilize two bypass caps as there are two voltage input pins, Vcc and Avcc pins. Also a .1ufd bypass at the Aref pin to ground can help the A/D converter work a little more noise free, I have seen improvements by doing that on one of my arduino boards, the other didn't seem to help or hurt.

Lefty

The primary function of decoupling capacitors is to prevent the supply voltage fluctuating as the circuit switches current - logic circuits switch very fast, an Arduino output pin can switch at millions of amps per second (even if only briefly as the current changes by 10's of mA). The power supply can't react this quickly (on timescale of 10ns so the voltage at chip's supply pins will droop sharply unless there are decoupling capacitors to provide this sudden change in current. At longer timescales the power supply will react and recharge the decoupling capacitors.

So the decoupling capacitors can't prevent voltage fluctuations at the supply but can reduce them substantially (from volts to fractions of a volt). With logic circuits you only need enough decoupling to prevent false switching - 200mV of noise would be fine but 1.5V would not.

With analog circuits you want much cleaner supply rails (but seldom have to deal with such high speed switching - except where digital and analog meet as here).

Another way of looking at is that the decoupling capacitors store charge for when there is sudden demand for more. There can be a hierarchy of decoupling capacitors, the small fast capacitors are the first line of defence, then larger slower capacitors to keep them happy, eventually the power supply circuit reacts. In fact VLSI logic chips have a significant proportion of their silicon area devoted to on-chip decoupling capacitors.

Okay, so just be be clear... A 10uf cap connecting the power and ground, both before and after the voltage regulator. And a .22uf and .1uf capacitor in series between the power out of the regulator and in the atmega?

And a .22uf and .1uf capacitor in series between the power out of the regulator and in the atmega?

No series connection, all bypass/decoupling caps wire from a Vcc voltage to ground.

And you want the 0.1uF or .22uF right next to the Vcc & AVcc pins.