Hi, I am designing a PCB and want to put a capacitor between the VCC and GND, as physically close as possible to an ATmega328. My question would be, which would be the optimum value of that capacitor?
By looking around, I have found a lot of references to a 0.1 uF capacitor. I was wondering, if there would be a negative effect, if instead of a 0.1 uF capacitor, I would add a 100 uF (or any other capacitor with a value higher than 0.1 uF) one instead.
Use 0.1uF ceramic - that's a given, and that's for every Vcc pin and the AVcc pin (surface
mount packages have more supply pins, each shoul have its own decoupling capacitor).
MLCC ceramic is essential for a low inductance (high self-resonant frequency) device.
Any capacitor is better than nothing, if its small and close to the chip, but the recommended
ceramic values will definitely work. Logic decoupling has to operate in the microwave region,
which is why tight layout is important - no long component leads!
Every circuit board also need bulk decoupling on the output of the voltage regulator, to bolster
up the regulator at medium/high frequencies, especially if you are switching current loads
(bunches of LEDs for instance). Go with the recommended output cap value for the regulator
in the first instance, consider increasing if lots of load (definitely if its amps).
If you ever get to look at what an oscilloscope shows you on a circuit without decoupling you'll
appreciate how messy supply rails can be if not decoupled.
The thing to understand with the OP question about simply using a larger capacitor is that real world capacitors do not behave like an "ideal" capacitor. Turns out the larger ones, while working well with lower frequencies (supply ripple filter etc.) don't behave at the mhz or higher frequencies as expected and don't bypass those as you would expect. That leads to the real world configuration you will often see where a 100ufd cap is in parallel with a 0.1ufd ceramic cap. The ceramic one handles the high frequencies and the bigger one handles the low frequencies. In an ideal world, the larger one would handle everything, but that is not the case in the real world - the big one has more inductance and impedance at the high frequencies.
Thanks for the tips and the very helpful resources. Judging on the requirements of my board and the available space, I guess I will be sticking to just two 0.1uF capacitors (one for VCC and one for AVCC).
Note that if you have a regulator on the board, it will require it's own capacitors - don't forget that. See the datasheet for the specifics - regulators are often picky about the type of caps they use.