decoupling

Go To Last Post
63 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I usually power my AVR breadboard prototypes from a computer USB port. I know the PC power is quite clean, so I typically don't bother with decoupling capacitors. When testing picoboot at 3.3v, I encountered problems (occasional out instructions that didn't change pin state). Swapping the AVR didn't fix it, so then I tried adding a .1uf cap, and the problem went away. I was getting the 3.3v from a USBASP, which uses an AMS1117 regulator, but surprisingly doesn't have any cap on the regulated side.

So if your power source has caps on its output, you should not need any decouping caps for your AVR circuit. If you have them, it's probably a good habit to get into using at least one anyway.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If one wants reliable operation then micro's should always have decoupling caps, (By-Pass caps), across each V+ and Ground pin pair, and across the AVcc (analog V) and its Ground pin.

There have been several Threads discussing the need for these, and the optimal value selection, including sometimes the use of multiple by-pass caps on each of the above.

Additionally, if one is using the ADC then it is appropriate to have a cap on the ARef pin to ground, for most AVRs. One can also use an LC filter to provide a cleaner power supply to the AVcc pin, in needed.

0.1 uF caps are a good choice for most applications.

Regarding the regulators, one has to follow the data sheet for the specific regulator. The old 7805's were very tolerant of about any Cin and Cout values people used. The 3 V linear regulators are MUCH more picky, and can oscillate, over heat, and shut down. They can also have voltage overshoots when oscillating, which can be a bad thing for the rest of one's circuitry.

By-pass caps are cheap.

Use lots of them!

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I quite disagree with the idea that

Quote:
if your power source has caps on its output, you should not need any decouping caps for your AVR circuit
.

You should ALWAYS use bypass caps close to your MCU. Even if your power supply has an output cap, the wires to your board have inductance and you WILL have noise on your board because of the VERY fast current spikes drawn by the logic. Makes no difference if supplied by USB or a stand-alone supply. Use them.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pc power "clean"? My scope says it's rather noisy with 50+ mV of noise. Good enough for digital logic, but hardly clean. The suggestion of not needing bypass caps is ill informed at best.

I'd hate to see the emissions without decoupling caps.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh, words from the unwise. See I go by facts, not unsupported assertions.
With 30cm-long(12") 24-AWG wires for power and ground going to a reasonably clean supply with output caps, resistance will be ~50 milliOhms. That's nowhere near high enough to cause problems with a 8-16Mhz AVR drawing <10mA of power.

Based on the test results with 12-Ohms to ground, even 26 or 28AWG would be fine.
http://www.vagrearg.org/content/...

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want facts, you seem to ignore some pretty critical ones. Your 10mA is an average current, the peaks are significantly higher due to the need to charge and discharge capacitance. You might ask why the power consumption varies with frequency? Your length of wire has inductance and a resonant frequency. With no bypass caps that piece of wire will sing. Get yourself a rf spectrum analyser. I think we know what part of the spectrum you're on. If you're happy with your 'facts' then keep them to yourself. The reality is somewhat different and probably very scary for you.

There is a difference between facts and half baked assertions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

There is a difference between facts and half baked assertions.

Yes, the article I posted has hard facts showing scope traces. You've just spewed half-baked assertions, seeding your arguments with just enough truth (wires have resistance and inductance) that you might fool the naive.

I've described my own observations, I've provided posts to the lab tests, and I've done the math. I have no interest in a futile attempt at trying to get closed-minded people to see their mistakes, but I hope other readers of the thread will do their own research to determine when decoupling caps are needed and when they are not... or just use them so you don't have to figure it out.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

There have been several Threads discussing the need for these, and the optimal value selection, including sometimes the use of multiple by-pass caps on each of the above.
[...]
By-pass caps are cheap.

I agree 0.1uF caps are semi-cheap cheap (~1.5c for Yageo X7R 0603's qty 25@digi-key, even cheaper if you can use the microscopic 0402's), but 10uF are much more expensive (~10c for 0805 X5Rs), and I've seen a lot of self-declared "experts" say to always use 10uF and .1uF.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need two types of cap's, a slow and big (that can clean the input and behave like a small local batt. often in the ballpark of 10-100uF.
Then you need small but fast decouple caps 10-100nF to kill the noise you make your self ( primary from flipping output pins). (place one for each VCC pin)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Face reality, if digital circuits could be built without decoupling why wouldn't everyone be doing it? A typical piece of consumer electronics (console, digital TV decoder/recorder, DVD player) probably has about 50 or more decoupling tantalums/ceramincs in each unit. Now it's true they only cost the manufacturer about $0.02 each But say that manufacturer makes 5 million units and there's 50 in each unit that is a potential saving of $5m. So why don't they do that?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm confused.

The website the OP links to seems to advocate the use of decoupling.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could argue that the capacitor is THE critical part of the power supply. AVRs have a pretty wide voltage range and can work with a pretty large amount of ripple, but don't forget those tiny capacitors!

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Face reality, if digital circuits could be built without decoupling why wouldn't everyone be doing it? A typical piece of consumer electronics (console, digital TV decoder/recorder, DVD player) probably has about 50 or more decoupling tantalums/ceramincs in each unit. Now it's true they only cost the manufacturer about $0.02 each But say that manufacturer makes 5 million units and there's 50 in each unit that is a potential saving of $5m. So why don't they do that?

Straw man arugment.
Where did I say you don't need *any* decoupling caps?
What I said is you don't need any next to your AVR if the AVR is electrically close to the power supply caps. And if your supply/regulator doesn't have any output caps, I've said you likely do need a ~.1uF decoupling cap.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

is electrically close to the power supply caps.

How is that the case when powering an AVR circuit on the end of a length of USB cable?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Face reality, if digital circuits could be built without decoupling why wouldn't everyone be doing it?

And the other logical fallacy is arguing that if it could be done then people would already be doing it.
I heard the same argument from some people when I said I was intending to write a 64-byte bootloader. "If a bootloader could be written in 64-bytes, why is the smallest AVR bootloader 256 bytes?"

When I built my house I used 24" stud spacing to reduce material costs and decrease thermal bridging in the walls. I had a framing contractor drop by to check out the construction, and tell me I was going to fail my framing inspection because the studs need to be 16" on center. I pointed out that 24" centers are permitted in the building code, and he said, "If code allows it, then why isn't everyone doing it?"

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They could make cars a whole lot cheaper if they didn't fit ABS or even brakes - it could be a "fun" ride though ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a line at the bottom of the article you linked to, Ralphd, that you should probably read again.

Quote:
It is always a good idea to ask your friendly veteran designer neighbor. Most of the mistakes have been made and there should be no need to repeat them ad infinitum.

When you've been hanging around these forums a bit longer, you should get a feel for who the experienced posters are, and you may even learn to take their advice, regardless of what Albert Einstein said.

Four legs good, two legs bad, three legs stable.

Last Edited: Mon. Mar 3, 2014 - 04:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I've described my own observations, I've provided posts to the lab tests, and I've done the math.

I'm not a sparky. You yourself have run into a case where a decoupling cap helped. All I know is that my organization puts together many production AVR8 apps each year. The target is usually a low-volume app. So the design aim is "no surprises". Our board designer adds a decoupling cap on each pair--and we have no surprises.

Now, I'd think that Analog Devices might know a bit about the subject area, including "the math" and "lab tests". After your posts I did a bit of Googling and came up with this that I thought was informative:
http://www.analog.com/static/imp...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

is electrically close to the power supply caps.

How is that the case when powering an AVR circuit on the end of a length of USB cable?

From reading your other posts, I know you're smart enough to calculate the resistance of the power lines on a length of USB cable using 24AWG copper. Even cheap USB cables from reputable sources like monoprice use 24AWG for power (and 28AWG for data).

If you have 120 milliOhms of resistance to the power supply output caps, then you'll have only 1% of the ringing shown in the link I gave that used a 12Ohm resistor on the ground line.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
There is a line at the bottom of the article you linked to, Ralphd, that you should probably read again.

Quote:
It is always a good idea to ask your friendly veteran designer neighbor. Most of the mistakes have been made and there should be no need to repeat them ad infinitum.

When you've been hanging around these forums a bit longer, you should get a feel for who the experienced posters are, and you may even learn to take their advice, regardless of what Albert Einstein said.

No, I've learned that when the argument starts with, "I've been doing this for 20 years..." that they are usually just an old fart that's full of shit.

There are many examples throughout time of "experienced" people being terribly wrong, and usually because they don't bother with hard science.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A fun game for all the family: "Jenga circuit design". Pick some piece of consumer electronics in your house, open it up and try to see how many components you can each remove in turn while the thing apparently still seems to work...

:-) ;-) :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
John_A_Brown wrote:
There is a line at the bottom of the article you linked to, Ralphd, that you should probably read again.

Quote:
It is always a good idea to ask your friendly veteran designer neighbor. Most of the mistakes have been made and there should be no need to repeat them ad infinitum.

When you've been hanging around these forums a bit longer, you should get a feel for who the experienced posters are, and you may even learn to take their advice, regardless of what Albert Einstein said.

No, I've learned that when the argument starts with, "I've been doing this for 20 years..." that they are usually just an old fart that's full of [**censored**].

There are many examples throughout time of "experienced" people being terribly wrong, and usually because they don't bother with hard science.


How about when the "argument"(your term) begins with "I've been caught out before when 'not bothering'(your term again) with decoupling caps"?

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Quote:

I've described my own observations, I've provided posts to the lab tests, and I've done the math.

I'm not a sparky. You yourself have run into a case where a decoupling cap helped. All I know is that my organization puts together many production AVR8 apps each year. The target is usually a low-volume app. So the design aim is "no surprises". Our board designer adds a decoupling cap on each pair--and we have no surprises.

Now, I'd think that Analog Devices might know a bit about the subject area, including "the math" and "lab tests". After your posts I did a bit of Googling and came up with this that I thought was informative:
http://www.analog.com/static/imp...

For the nth, time, I agree decoupling caps are generally needed *somewhere* in your circuit. What I am saying, (and people seem to be ignoring, probably since they can't refute my argument), is that if you have caps at your power source (i.e. 0.1 & 4.7uF), and low resistance (<100 milliOhms) between your power source and your AVR, then probably don't need extra caps physically close to your AVR.

The Analog paper you posted is good, as long as you understand what it is saying instead of taking it literally. For example the statement:
"A large electrolytic capacitor (typically 10 μF – 100 μF) no more than 2 in. away from the chip."
Is false if taken literally. What matters is not physical closeness but electrical closeness. A 10uF cap connected by 4" long 40 mil power traces is electrically closer than one connected by 1" long 8 mil power traces.

And to be explicit, I think you can safely ignore inductance, assuming a typical 1.6mm thick FR4 double sided board. And same goes for prototyping on a breadboard - inductance from 24 or 26 AWG power lines such as in a USB cable is small enough to be ignored.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So these 24 AWG power lines, how effective do you suppose they are at 16MHz?

I don't know the answer, this is an honest question from someome who's been blindly following convention for 35 years.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
A fun game for all the family: "Jenga circuit design". Pick some piece of consumer electronics in your house, open it up and try to see how many components you can each remove in turn while the thing apparently still seems to work...

:-) ;-) :-)

For many electronic components, there are lots of unused parts, particularly when then dealing with a low-end model of something that has a higher-end model with extras. For example I bought a $20 d-link wifi router, which has a circuit board in it which has traces and passives for a USB port. There's just no USB connector soldered to the pads. I'm sure d-link has a $40 version that has the USB port populated.

I've taken apart ethernet switches where the 24-port and 48-port versions have exactly the same power supply. If the power supply has 2 x 100uF electrolytic caps on it's output side, I could probably remove one of them on the 24-port version.

I've taken apart hard drives that have an unused head - i.e. 2 platters/4 heads but the drive only uses 3 surfaces.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

is that if you have caps at your power source (i.e. 0.1 & 4.7uF), and low resistance (<100 milliOhms) between your power source and your AVR, then probably don't need extra caps physically close to your AVR.

I found another hit in my searching that touches on that topic. It wasn't quite as rigorous as the AD paper so I didn't think it would satisfy you. The summary is that the author found that about 1/2 of the power pins on a board needed decoupling to get good results, and that "shared" decoupling caps should be between pins that need it.

I don't quite understand why you are stirring this up. As you have mentioned, the caps aren't expensive, nor large. My outfit isn't going to start dropping them when designing an AVR8 app that might have a lifetime run of a few hundred boards: Putting them on makes for a solid design without extensive analysis, at design time, testing, or working on field problems.

I'm out.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to bring a little objectivity to this and back off from the extreme reactions on all sides.

Here is a simple fact: A modest AVR, such as a Mega168 generates a current spike on each edge of the clock. I measured it, which YOU can do with a 200+MHz scope and a current probe. The spikes are on the order of 100ma and have a width of a few nanoseconds (the width of the internal logic rise and fall times). You can also determine this by looking at the graph of the device current as a function of clock frequency.

Now, a 2-3 ns, 100ma, pulse will cause all sorts of "effects" when that flows through an inductor. A straight wire has an inductance of a few nanohenries per inch. But even wire resistance can come into play (Rhetorical question, how much of a voltage pulse would be generated by a 100ma current pulse and 10 ohms of resistance?)

Why don't you see all this mess when you look at an unbypassed power supply with YOUR scope? It likely does not have the bandwidth. What your scope MAY show is lower frequency ringing stimulated by the narrow pulses that you do not see.

It is simple. But, the electronic devices WILL respond.

Knowing this fact now should make it clear why you need a good (ie, high frequency) cap close to the supply (and ground) pins of the logic device. You need some way to supply those very narrow current demands. That something needs to have a minimum of inductance and resistance between it and the load. A good SMT ceramic cap, say 10-100nf, comes very close. And Atmel has made it easy with adjacent Vcc and Gnd pins, unlike the DIP 8051's with Vcc and ground at diagonally opposite corners.

When that current demand is supplied by those reservoir caps (we call them "bypass caps"), the high frequency voltage changes for the logic device are greatly reduced. And, those high frequency currents do not flow so extensively out into the circuit or the supply.

Please, everyone, use good bypass caps. They will save you from grief that always comes when you do not expect it. It helps to prevent undesired behavior (which have had several recent posts about).

You can find 10nf, 50V, leaded ceramic caps for under 0.20USD. SMT is substantially less. What is YOUR excuse for not doing it?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
So these 24 AWG power lines, how effective do you suppose they are at 16MHz?

I don't know the answer, this is an honest question from someome who's been blindly following convention for 35 years.

You just have to do the math. I'll use an ATtiny2313A-PU as an example. Given the distance between the Vcc and Gnd pins, you'll have at least 1cm from each of the pins if you put a cap as close as you can to the chip ( even underneath it ).
8 mil of 1oz copper has a resistance of 24 milliOhms, so 48 mOhm for 2cm.
That's the same as 60cm of 24AWG. So if you used a short 1.5' 24AWG USB cable to power your 2313A and had a short (<2cm) 40-mil power trace + ground plane, it would be electrically closer to the caps on the USB port than if you used a ceramic cap underneath the 2313A with 8 mil PCB traces.

Now if you used a 40-mil power trace, ground plane, and cap under the 2313A, it would be "better", but not necessary.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:

And to be explicit, I think you can safely ignore inductance, assuming a typical 1.6mm thick FR4 double sided board. And same goes for prototyping on a breadboard - inductance from 24 or 26 AWG power lines such as in a USB cable is small enough to be ignored.

Eek! At the multiple MHZ needed to make a nice edge in our processors, this inductance becomes pretty significant. Why do you thing the circuit started working when you added the cap?

Put the caps. Will save you lots of hair. But then, I'm not likely to convince you.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:

I don't quite understand why you are stirring this up.

I could say I don't quite understand why some people are saying you always need decoupling caps physically close to your MCU, but I'm pretty sure it has more to do with ego than science.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:
Why do you thing the circuit started working when you added the cap?

It had nothing to do with the inductance of the ~10cm of 24AWG wires going to my circuit. It was because there is no capacitor at the output of the AMS1117 regulator on the USBAsp.
I'll probably just tack solder a .1uF cap between the power out and ground on the USBAsp, then I won't need it on my breadboard when I'm protyping AVR circuits at 3.3V.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

???

Not populating parts of a PCB for a product designed with a vertical product lineup, ($20 model, $40 model, ...), has to do with manufacturing costs, design costs, inventory costs, certification costs, etc. This has nothing to do with "extraneous" by-pass caps.

Most of my projects are hobbyist in nature, with an occasional one-off prototype for someone.

I have the liberty of not worrying about $0.02 cost parts x million unit production volumes.

I expect my projects to work, flawlessly, for years. Hence they are often "over-designed".

There have been plenty of biomedical interfaces on the web without isolation or electrode clamps. Technically they work, but they aren't safe, and are "poorly" designed. The issue being the designer generally doesn't know its a "bad design" because they don't know enough about the underlying physics, electronics, and in this case physiology, to understand their oversight.

The old saying is "You don't know what you don't know".

Same thing with several of my emergency vehicle equipment boards. Tough environment, both electrically, and temperature/mechanically/etc.

Lot of "spare parts" on those boards! Tons more than one might expect, if one sat down to designed a simple circuit to do the task.

Mission critical, high reliability, and fault proof - fault tolerant designs are approached from a different mind set than low cost disposable devices, and minimalistic designs.

JC

Edit: Wow. A whole bunch more posts since I started writing this...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
John_A_Brown wrote:
So these 24 AWG power lines, how effective do you suppose they are at 16MHz?

I don't know the answer, this is an honest question from someome who's been blindly following convention for 35 years.

You just have to do the math. I'll use an ATtiny2313A-PU as an example. Given the distance between the Vcc and Gnd pins, you'll have at least 1cm from each of the pins if you put a cap as close as you can to the chip ( even underneath it ).
8 mil of 1oz copper has a resistance of 24 milliOhms, so 48 mOhm for 2cm.
That's the same as 60cm of 24AWG. So if you used a short 1.5' 24AWG USB cable to power your 2313A and had a short (<2cm) 40-mil power trace + ground plane, it would be electrically closer to the caps on the USB port than if you used a ceramic cap underneath the 2313A with 8 mil PCB traces.

Now if you used a 40-mil power trace, ground plane, and cap under the 2313A, it would be "better", but not necessary.


Sorry, you misunderstand me - I was referring to the skin effect.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
I would like to bring a little objectivity to this and back off from the extreme reactions on all sides.

Thank you. It was beginning to seem as futile as trying to have a rational discussion with my ex-wife.

ka7ehk wrote:

You need some way to supply those very narrow current demands. That something needs to have a minimum of inductance and resistance between it and the load. A good SMT ceramic cap, say 10-100nf, comes very close.

So for a 4ns, 100mA pulse, what is ideal? I went with 100nf since it was either that or 470pf which I had on hand at the time. If I have the fundamentals right, 1 uf can provide 1A for 1 us, so 10nf can provide 100mA for 100ns? The 100nf might be better since it has a larger capacity, but maybe the 10nf will be better with it's lower ESR...

I'm also interested in knowing what the difference is when running off the internal 8Mhz RC oscillator. A 4ns pulse of 50mA? 8ns of 25mA? Maybe even less current since the internal RC oscillator probably needs less power than an external crystal at the same speed?

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For a current pulse only a few ns wide, you CANNOT ignore inductance. A cap on the other end of wires several cm long is quite ineffective. 10cm wire, and it might as well be invisible.

You can do the math. A 2.5ns wide pulse has a fundamental Fourier frequency component of 1/(2*2.5ns) = 200MHz. The reactance of 5nH of inductance at 200MHz is about 15 ohms (give or take a bit). 100ma through 15 ohms makes 1.5V.

Granted, with a narrow pulse, the fundamental component is reduced below that in the "back of the envelope" estimate, above. The, point, however, is that you CANNOT ignore even a few cm of wire when the speeds are that high. Or, more correctly, you ignore it at your peril.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
???

Not populating parts of a PCB for a product designed with a vertical product lineup, ($20 model, $40 model, ...), has to do with manufacturing costs, design costs, inventory costs, certification costs, etc. This has nothing to do with "extraneous" by-pass caps.

How is that different than designs that put bypass caps of an arbitrary value (i.e. .1 or 1uf) next to every chip because that's the way it was done for the last product, rather than calculate where they are actually required and what the ideal capacity is?

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is no ideal capacity. This is engineering!
You choose common components.

Likewise, your motor car uses M8 or M10 bolts when M6.789 might have been suitable.

If you come from the Fourth World, you probably think in 1/64"

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
For a current pulse only a few ns wide, you CANNOT ignore inductance. A cap on the other end of wires several cm long is quite ineffective. 10cm wire, and it might as well be invisible.

You can do the math. A 2.5ns wide pulse has a fundamental Fourier frequency component of 1/(2*2.5ns) = 200MHz. The reactance of 5nH of inductance at 200MHz is about 15 ohms (give or take a bit). 100ma through 15 ohms makes 1.5V.

Granted, with a narrow pulse, the fundamental component is reduced below that in the "back of the envelope" estimate, above. The, point, however, is that you CANNOT ignore even a few cm of wire when the speeds are that high. Or, more correctly, you ignore it at your peril.

Jim

Now you're talking my language, so one can calculate the electrical distance between the power pins and decoupling caps.

You've given your measurements on the current spikes from an ATMega with a 16Mhz external crystal (or resonator), presumably at 5V. Without an expensive scope, how would I find it out for an ATtiny85 at 3.3V with the internal RC oscillator?

It could be that 22nf is best for the 16Mhz ATmega@5V, while 100nf might be best for the 8Mhz ATtiny@3.3V.

Looking around at formulas for inductance, reactance, etc, it seems a lot more complicated than V=IR. One thing that surprised me is the inductance of a wire does not vary linearly with it's length. Increasing length by 4x seems to increase inductance by ~5x...

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
There is no ideal capacity. This is engineering!
You choose common components.

10nf, 22nf, 47nf and 100nf are all common capacitors. If 22nf is better than 100nf, then that's what I'd prefer to use.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The best value for the decoupling capacitor is rather hard to calculate. In most cases there is no need to really find the best value - it's enough to find one that work. For the AVRs and much simple logic of similar speed the 100 nF value works well, 10 nF in many cases likely works too - sometimes better sometimes worse. The AVRs are not that fast and critical - the rule of thumb is still good enough.

Digital circuit are rather tolerant to hf "noise" on the supply, but HF noise on the supply also means more HF noise radiated. So the capacitors are needed for EMI reasons too.

The faster the circuit the more tricky it gets. With fast this is the speed of the transitions, not so much the clock frequency. So a AVR running at 1 MHz needs the same decoupling as one running at 20 MHz. A lower voltage can ease things as the transitions get slower and the current pulses get smaller (e.g. 100mA for 2,5 ns at 5 V versus 30 mA for 5ns at 3 V).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ralph, you're not winning friends with your troll like behaviour. Whatever respect you had here has evaporated due to your attitude. You've backed yourself into a corner - if you're right it will be a hollow victory and if you're wrong you'd lost anyhow. Net result is not anything positive for you. I was explaining to a friend's daughter recently that shoving your righteousnous down people's throat isn't going to win you friends.

For those of us who have had to do emissions testing, we know that there is a bit of black magic involved when it comes to component placement. With the cost of testing you want to get it a right as possible first up - thus a lot of conservatism. We apply known good practice that is backed up by physics. If you can't measure it, then you're guessing applies. Unfortunately you need expensive tools to measure the effects accurately. So just because you've gone against common wisdom at it worked for you doesn't make it a universal truth.

So find yourself someone with a good oscilloscope and spectrum analyser and make some measurements. Otherwise you'll just keep arguing and making an ass of yourself.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

At 3.3V, the spikes are close to the same width, but lower amplitude. That is logical, since the current is what is required to charge thousands of gate capacitances from near zero to near Vcc in the rise time. Since Vcc is lower, the required charge is lower and current spike is lower. I would expect it to be a nearly linear relationship.

As others have pointed out, there is no ideal cap size. Typically, larger ones have more internal inductance. You need to look at the self-resonant frequency of the capacitor; it needs to be several times higher than the clock frequency. That is actually more important than the capacitance.

It also does not matter, much whether it is new process or old process. With old, the gates are larger in area, so the capacitance is larger. That makes the internal rise/fall times longer, but the peak current could be either larger or smaller. To tell the difference, check the dynamic current (Icc vs Fclk).

It also makes no difference whether internal or external clock, nor the clock frequency. That is because the internal rise time does not change the clock. Its all about charging (and discharging) thousands of gate capacitances in the rise or fall time of the logic signals.

Thats all it is. But, the consequences are pretty significant. Use the bloody caps!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Ralph, you're not winning friends with your troll like behaviour. Whatever respect you had here has evaporated due to your attitude.
He doesn't care.

Quote:
See I go by facts,
Of course. So do we all. You simply don't have all of them. Neither do I. That's why I place my trust in the experience of others.
Quote:
not unsupported assertions.
And yet you make them.

It's worth returning to the OP:

ralphd wrote:
So if your power source has caps on its output, you should not need any decoupling caps for your AVR circuit.
It seems as though your facts amount to a single data point. Not much to go by.

Ralph, although you've amended your initial assertion with statements like:

Quote:
Where did I say you don't need *any* decoupling caps?
... your OP nevertheless is poor advice for anyone, especially the typical newbie/student who comes here seeking information on decoupling.

Quote:
If you have them, it's probably a good habit to get into using at least one anyway.
This is the only part of your OP I consider to be valid. I would only add that if you don't have them, get them.

Quote:
I've seen a lot of self-declared "experts" say to always use 10uF and .1uF.
There are good arguments for doing so, but it isn't a panacea. Cypress has a good appnote on the subject of decoupling, AN1032.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's going fast in this thread :)
I will just add this.

1:
I don't see the clk osc as the main problem, (alone) but since there is no reduced slope on the outputs, the hole chip make a big jump on a clk where outputs shift level.
2:
The caps kill a lot of RF that elsewhere would make a lot of noise on the power lines.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

with leaded parts, the consensus was for a 10uf aluminum electrolytic and a ceramic 0.1 to 0.01uf in parallel.

The reason for this is two-fold. The electrolytics have a large series inductance (and often a large effective series resistance). This results in a low self resonant frequency (often, under 1MHz). The ceramic is to reduce the high frequency impedance.

More recently, we have SMT 1uf to 10uf caps. The combination of short leads (low lead inductance), low ESR, low internal series inductance and high self resonant frequency makes them ideal for this application. Even though they cost more per unit, the net cost is lower because fewer parts are needed and less board area is needed.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think Ralph has enough curiosity and energy to do an experiment and data collection on 'The optimal number and size of decoupling caps as a function of voltage and current'. I propose this setup: tqfp avr soldered onto a header. Regulated lab grade power supply with a rheostat in series (adjustable source impedance). Test program performs a calc and flashes an led. Start out with no filter caps, no bypass caps. Start out at 5V, 0 ohms source impedance. Turn up the rheostat until program fails. Note source impedance. Add one .1uf bypass cap. Program runs? Keep increasing source impedance. Etc. Publish results. Someone that is making 100K gizmos a month with 20 caps can eliminate 10 of them and save 2 cents each, 20 cents per gizmo, saves $20K on the run. Everyone is happy. Ralph, the AVRfreaks, the manufacturer that uses his results. WinWinWin. QED.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

More recently, we have SMT 1uf to 10uf caps. The combination of short leads (low lead inductance), low ESR, low internal series inductance and high self resonant frequency makes them ideal for this application. Even though they cost more per unit, the net cost is lower because fewer parts are needed and less board area is needed.

The MLCCs are much cheaper now. A reel of 10,000 samsung 1.0uF 6.3v 0402 x5r goes for $43.30 at digi-key. For something more manageable for hand soldering, 1.0uF in a 0805 package start at $10 for 1,000.
Newark has Multicomp 4.7uF 16V Y5V 0805 ceramics on special for 1.1c; I picked up 100 on my last order with them.

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is where it gets interesting Ralph. It seems simple enough to specify a cap - 100nF 6V but things get very interesting with the dielectric. Depending on the dielectric and the operating voltage, you may not get the capacitance you expect! Careful reading of the datasheet is required. Manufacturers like AVX have whitepapers on this which are enlightning as well as surprising.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

watch out or Y5V dielectric.

At upper and lower temp limits, the capacitance can drop by more than 50%

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

X7r is voltage dependent

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:

10nf, 22nf, 47nf and 100nf are all common capacitors. If 22nf is better than 100nf, then that's what I'd prefer to use.

Which one do you choose when your calculated value is 68.5nF?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Pages