Electronic – Decoupling caps with PICs

decouplingmicrocontrollerpicvoltage-regulator

I'm working on a project and read that decoupling caps should be connected across the VDD and VSS pins of PIC microcontrollers(or rather all microcontrollers?). I'm using a 9V battery with a 7805 voltage regulator as the source and have two decoupling capacitors connected with the regulator like so:

enter image description here

So do I really require the decoupling capacitors across the VDD and VSS pins or is it okay to not use them?

Best Answer

Why your regulator needs bypass capacitors

Those capacitors are usually there to provide stability to the output of the regulator itself. Linear regulators use a feedback loop to regulate under changing load conditions... the bypass capacitors helps stabilize the feedback loop to prevent oscillations.

Why bypass/decoupling capacitors are required

The general recommendation is to bypass at the point of load for all your ICs which, in this case, would be the Vdd pins on your microcontroller. A small ceramic cap, 0402 or 0603, close to each Vdd pin, with a short via to your ground plane (or to your ground track) of 0.1uF value should suffice nicely.

This is because the power draw from something like a microcontroller is pulsed... not steady. Think about it like this: your microcontroller is running a task very frequently... let's say a single task 20 times a second. If the regulator adjusts to deliver power when the microcontroller is idle, and then your task runs, the voltage is going to sag as the regulator tries to meet the current demand. The bypass capacitors are there to supply power when the regulator can't supply it fast enough. This is due simply to the fact they are capacitors and due to the fact they are placed physically close to the IC... closer than the voltage regulator is.

This is leaving out a lot of stuff, like the signal return path, but generally speaking, you're just trying to make sure that current demands can be met locally without tons of current having to travel all over the board. There's also the issue of reducing noise (I believe because you're reducing the di/dt traveling across your power traces by having current loops stay local to your bypass capacitors) but I don't want to try and explain that because my knowledge isn't that great in that area. :)