Author Topic: MCU - 100nf cap to GND before and/or after the inductor AVCC pin  (Read 1564 times)

0 Members and 1 Guest are viewing this topic.

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
I've had some AVR's blow up and I have a suspicion as to why.

Currently there's a 10uH inductor feeding VCC into the AVCC pin (VCC for ADC)

There's a 100nF cap to GND on the VCC side of the inductor but not on the MCU side. The inductor connects directly to the AVCC pin

Could this be resonating and created a high voltage spike on the AVCC pin at turn-on which is damaging the mcu?
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline daqq

  • Super Contributor
  • ***
  • Posts: 2302
  • Country: sk
    • My site
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #1 on: May 19, 2022, 06:28:19 am »
Makes sense, if nothing else this should give bad performance from the ADC. There's a cap there recommended AFTER the inductor in any case, see https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf , page 213.
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #2 on: May 19, 2022, 06:55:15 am »
yeah, i think I was just an idiot and forgot to add it.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #3 on: May 19, 2022, 07:19:55 am »
There should be a cap directly at the AVCC pin. The inductor is optional and may better be a ferrite "bead", so an inductor with damping. In some cases also a resistor (e.g. 10 ohm) instead of the inductor is good, especially if there is no significant load to the AVCC powered pins.
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6697
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #4 on: May 19, 2022, 07:29:42 am »
The purpose of decoupling capacitors is to counter the inductive PCB tracks and planes, which would reduce the energy available to the MCU at high switching frequencies.  Placing the inductor there is almost the opposite of what you want to do.

Now, an analog pin is likely to have less switching current on it, but it will probably still have some.  The correct solution is to use a Pi network of C-L-C components, with a small value cap right next to the MCU pins, fed by a series L or FB, with another cap to GND on the other side.  In some designs I've seen a resistor of 10-22 ohms in series as well: the current drawn by the pin is quite minimal, so this works to add further high-frequency filtering (using the 'R' and 'C' as a simple lowpass.)
« Last Edit: May 19, 2022, 07:31:29 am by tom66 »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #5 on: May 19, 2022, 12:22:29 pm »
And obviously the cap should have 10 ohms ESR, or be parallel connected with a somewhat larger (>0.3uF) cap of same ESR.

A ferrite bead is safer than 10uH, without the ESR, as its own inductance and ESR are fairly modest.  They do tend to ring at such low frequencies (i.e. underdamped; at low frequencies, a say 100R FB is typically around 1uH with a Q in the single digits), just not as bad.

Note that the same is true of hot-plugging transients, if all you have onboard is ceramic and the power leads are long (which, relative to the quite low ESR of ceramics, could be just some 10cm of lead length, really).  An electrolytic "bulk" cap is recommended.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8168
  • Country: fi
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #6 on: May 19, 2022, 12:52:01 pm »
For a safe and robust design, use an AC-lossy inductor (say, ferrite bead), or a non-lossy inductor with parallel resistor (maybe a few hundred ohms). After this inductor, use a tantalum like 2.2uF to 4.7uF, and in parallel with this tantalum, just at the IO pin, put that tiny 100nF MLCC in small package.

Said solution damps oscillations by providing AC loss in both the inductor, and the capacitor (the tantalum, with very well controlled ESR), and the 100nF capacitor provides minimum possible ESL right at the power pin.

Though, the analog performance of the AVR sucks anyway. Try first without any inductor. Just the 100nF at each power pin, and AVDD directly tied to VDD.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #7 on: May 19, 2022, 01:30:39 pm »
Though, the analog performance of the AVR sucks anyway. Try first without any inductor. Just the 100nF at each power pin, and AVDD directly tied to VDD.

Yep, real point is this.  The old MEGAs with 10 bit ADC, I mean they're so crunchy you can select bit-exact readings with a potentiometer and only a little patience.  Supply doesn't have to be anything special, a linear regulator will do.  Maybe you'd want a bit extra filtering from a switching regulator, that's easy enough to arrange -- and for the whole thing, not just the analog section.

Indeed, filtering just AVCC (and thus AREF, presumably) could be worse for some applications, like where you're reading a bunch of pots, thermistors, or other ratiometric sources.  These should all vary in concert with the source, and running them from VDD without filtering, or from VDD or an external VREF while using the internal VREF as AREF, gives poorer results than running them all together.  But again, out of 10 bits, it's not hard to achieve reliable results despite that.

Even on the nicer AVRs (XMEGA and AVR-DA both have 12-bit ADCs, with modest performance; the XMEGA's is pipelined up to 300kSps with additional nice features, while the DA's limited to 130k and is mostly one-and-done), stable bit readings are normal, i.e. the noise due to supply ripple and analog sources (thermal noise etc.) is still less than the quantization noise.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6352
  • Country: ca
  • Non-expert
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #8 on: May 19, 2022, 09:46:04 pm »
No one actually addressed OPs question.
Will the lack of a cap cause the MCU to blow? No I don't think so. But get out the oscilloscope and check if Vcc/AVcc is exceeding spec at any time.

What are the symptoms after its died: MCU will not be detected by programmer at all? Have any of the pins shorted to ground after that?
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #9 on: May 20, 2022, 12:16:16 pm »
I don't think AVCC draws transient current, but I haven't measured it so scoping it in operation would be a good idea (share your results!).

I did offer one somewhat common failure mode (hot plugging), but it's not clear from this small snippet if it's relevant or not.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: thm_w

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8168
  • Country: fi
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #10 on: May 20, 2022, 12:28:12 pm »
No one actually addressed OPs question.
Will the lack of a cap cause the MCU to blow?

It's possible. Inductive supply and no bypass capacitor sure is a good way to create voltage peaks. AVDD definitely has some switching going on, and maybe the distributed on-chip capacitance helps bypass it, but maybe not. Now whether these voltage peaks are energetic enough to actually break things... who knows. It's also possible such a spike would somehow cause latch-up and self-destruction.

Maybe not very probable, but completely possible. I tend to just swap parts whenever I make a mistake where I suspect non-zero probability of having a dead chip; I have seen weird things from partial damage and they can be PITA to debug.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #11 on: May 20, 2022, 02:25:51 pm »
Maybe not very probable, but completely possible. I tend to just swap parts whenever I make a mistake where I suspect non-zero probability of having a dead chip; I have seen weird things from partial damage and they can be PITA to debug.

In fact just the other day I seem to have zapped an AVR-DA, with the result that the ADC drawing quite significant current (~0.1mA) from whichever mux channel it's connected to at the time.  That is, current into the AINx pin, depending on MUXPOS/NEG selection.  Pin functions largely seem to be normal, CPU working 100% as normal.  Best guess at cause, ESD on one of my debug wires, in particular one from the analog IO bank, which happened to just slightly fail in this way.


I have an ATMEGA32 laying around I could poke at and measure AVDD current, though I don't really have the time to do so.  Or, hmm I think I have one with a program running the ADC even, though it's on a Olimex board I'd have to cut traces to get at AVDD alone I think, dang...

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 493
  • Country: us
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #12 on: May 20, 2022, 08:41:58 pm »
Ugg. "Should the cap go before or after...?" After what? I've seen articles in respected electronics trade magazines that expressed the issue like that.

The answers to all of these questions are nearly obvious if one pays attention to current (and current loops) instead of limiting their thinking to voltages. Any reader that doesn't understand what I mean -- or worse, disagrees -- should start training themselves to think in terms of current. It really is that simple. Learn to think in terms of current flow and questions like these will have obvious answers.
90% of quoted statistics are fictional
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6697
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #13 on: May 20, 2022, 09:31:09 pm »
I once nuked the AVR8 on my 3D printer by shorting the hotbed sensor to 24V.  The result was all the sensors read 1023, but no channel showed any short circuits.  A very "transparent" failure, that would only be obvious if you replaced the chip.
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #14 on: May 21, 2022, 02:49:46 am »
The failure of the latest chip (3rd) was AVCC pin shorted to GND and pulling down 5V rail through the AVCC inductor.
I was lucky and was powering it off a lab PSU with a 300mA current limit, so I could check with the FLIR and see where the current was going before the chip physically popped.
The series diode and AVCC inductor were getting hot, and there was a tiny area of the MCU package getting hot too.
In the previous 2 chip failures it popped/smoked instantly due to being on battery so I had no idea what happened.

That's what made me think about the AVCC pin and check the schematic to discover no cap to GND on the MCU side.

I assembled 2 more units this time with a bodged in 1uF cap form AVCC to GND and those didn't blow up.
That being said, i have a test board here without any cap bodge and it has been running totally fine for months.
So it maybe silicone lottery as to how sensitive the AVCC pin is to overvoltage/latch-up.

I have been meaning to put my scope on that original board to check whats happening at startup, but have not had time yet.
« Last Edit: May 21, 2022, 02:59:41 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: Someone, thm_w

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #15 on: May 21, 2022, 03:20:13 am »
OK, i did some tests,

Seems the issue isn't right at switch-on.
It's when the MCU timer generates 6khz signal to drive the power on piezo beep.

Looks like the 6khz current spikes from driving the piezo maybe causing the inductor to kickback.
I'm seeing up to 5.75V on the AVCC pin to GND, but all the other VCC to GND caps on MCU are fine so it's just an AVCC issue.
(I'm probing using the spring clip right on GND at the MCU).



« Last Edit: May 21, 2022, 03:35:50 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: thm_w

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #16 on: May 21, 2022, 03:31:42 am »
Yep, I just replaced the inductor with 22R resistor.  No more overvoltage.
Looks like I do have a separate issue with the piezo circuit, it should not be pulling down the 5V rail like that. But at least it proves the overvoltage part of the problem was the 10uH inductor.

So something to keep in mind. If you follow the datasheet recommendation of a 100nF cap to GND on AVCC and a 10uH inductor to VCC.  Then you run the risk of killing the MCU if your 100nF cap goes open circuit and you have any high frequency noise on the supply rail.
« Last Edit: May 21, 2022, 03:39:33 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: MCU - 100nf cap to GND before and/or after the inductor AVCC pin
« Reply #17 on: May 21, 2022, 04:55:59 am »
You didn't zoom on the negative spike / ripple? :-\

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf