LightYearCS wrote:
> Generally speaking you ALWAYS need bypass capacitors. The AVR chips
> generate a lot of power supply spikes which the bypass capacitors
> "bypass" to ground.
[snip]
That's the old tricky point of view. In anyway the capacitors would solve
the problem, so...
It is much easier to "think" that "decoupling" capacitors will "bypass"
noise to ground.
The real definition is a little bit different.
If it is not a super-conductor, then any electric conductor offers some kind
of electric resistance, this can be measured, calculated, etc.
The battery or power supply have its own internal resistance, the power
supply connectors or solder offer more resistance. The wires connecting the
power supply to your board offer another resistance. Your board power
connector or solder, another. Then comes your board thin copper traces
feeding power to the uC, another resistance, solders to the socket, socket
resistance, etc. It is a bunch of small resistances that added will result
in LSR (Lump Sum of Resistance).
For a normal "STEADY" 5mA or 500mA power consume, the current will generate
a voltage drop over the LSR. Suppose the LSR is just 0.1 Ohm. A 5mA
current will develop 500uV voltage drop over LSR, 500mA will be 50mV.
That's ok, but it means your +5V power supply will be delivering only 4.95V
at the uC power pins. That is not a general problem, since the AVR can still
working around 3.3V or even less.
Suppose the AVR heavy processing, in a particular moment of internal data
transfer will suck a very fast peak of 3A. That is so fast that it sucks
electrons from the wires, battery or power supply will replenish the wires
electrons later, during its own feed capability. But how much voltage is
reduced at the AVR power pins at the exact moment of this very short 3A
current rush?
LSR x 3 = 300mV. But then you say, "well, if the AVR can work down to 3.3V,
now it has 4.7V and it should work ok". Yes and mostly NO. Yes that it is
only 300mV when thinking about basic Ohms Law. NO, when thinking that now
other factors are involved. Even the stranded wire from the power supply to
the board will offer a much higher "impedance" to the current than its
simply "DC Resistance". The twisted filaments into the wire, the VCC
circuit board traces not so straight, etc, offers an "impedance" to the
current.
Impedance and Resistance are almost the same, it is the same, but generally
"resistance" is used to indicate a fixed and known "current impedance" for a
specific current frequency. We use to say "resistance" as something known
for DC current.
For example, a wire resistor (or carbon coiled) can offer 100 Ohms when
measured with a multitester, but the same resistor can offer 100 kOhms when
in the path of a 50MHz current. It turns to be much more a "coil" than a
"resistor". If you apply a battery and a lamp, that 100 Ohms resistor will
be exactly like that, 100 Ohms, and the lamp will lit. If controlling the
current at 50MHz, 50% duty cycle, the lamp should lit with 50% intensity,
but due the resistor "coil impedance", the lamp will probably not even lit
dim.
So, the very fast current surge that the microcontroller demands will cause
the same effect. At the surge the power supply will not be able to supply
the necessary energy, and guess what? the Voltage at the uC power pins can
go almost to zero. This can leads the uC to resets, runs erratic, loses
data, etc.
A simple addition of a "temporary and close" energy storage will solve the
problem. In most cases a simple 100nF small capacitor close to the uC power
pins can feed such surge current, and keep the supplied voltage inside the
acceptable voltage levels.
That is one thing. Another thing is related to RFI (Radio Frequency
Interference) or EMI (Electro Magnetic Interference). Both can inject
electric noise over anything electric conductor, including wires, chips,
components in general. That is the noise generated by an electric motor,
hair dryer, drill, etc. That has everything related to the impedance
described above, but in the reverse sense. The Injected noise needs some
path to be eliminated, the 100nF capacitor can do it pretty quickly and does
it well. If not eliminated, this EMI or RFI will goes into your uC and
creates all sort of mess.
The 100nF close to the chips will get rid of the EMI/RFI and will store
enough power to be delivery to the chips at surge demands.
Why then, if every chip requires its own 100nF capacitor, it is not produced
already with the 100nF chip inside? For once is the manufacturer process,
then it comes to cost, size, etc. Sometimes just one capacitor can cover
several chips, sometimes not. It is better to leave the issue to the
decision of the circuit board designer.
Car's shock absorbers has the same effect to your comfort and driven
stability, as a capacitor has to the microcontroller. Always remember that.
Wagner.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004