Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
All your PCB traces conducting current acts as antennaes picking up noise. So to avoid the noise affecting your IC supply pins, you place a capacitor very close to that pin, as the high frequency noise then will se a low impedance path to ground, choosing that path instead of going through your IC. Remember that all traces also have an inductance; the thinner and longer the trace the higher inductance. The same goes for capacitor leads. This inductance results in a higher impedance at high frequencies, thus reducing the effect of your bypass cap. So in noise critical applications, you would want to choose SMD capacitors (as they have no leads), with a short and thick trace to the supply pin.
In digital circits, its for switching noise.
If you have an output line switching away driving some load, every time it switches it puts a demmand on the suply. If its switching fast, the trace becomes an inductor with impedance and the supply line droops. These appear on the rail as noise spikes. Now imagine 16 lines clocking away like crazy and your in a right mess. A cap close to the supply pin of the micro filters these out.
Without them, the micro would most probably constantly brown out and reset.
Bypassing used when it is necessary to short some point into schematic to the ground only for AC currents but not for DC. Typical examples are Vcc and Vdd points, power supply output terminals. They must have as low impedance to groung as possible. Capacitor(s) on self-resonant frequency (SRF) usually used for this purpose because at SRF it has very low impedance. When it is necessary to bypass to ground AC currents with different frequencies corresponding caps should be connected in parallel. In this case the smaller should be installed as close to the bypassing point as possible.