# Decoupling a Microcontroller/Development Board Design

Im trying to design a broad purpose microcontroller board (developement board?) to send off to a fab house to then use in future projects. The micro being used is an ATtiny861A.

Referring to the datasheet:

Indicates I should wire the AVCC pin to VCC through a low pass filter. Using an RLC filter with R=10R, L=10uH, C=0.1uF gives a cutoff freq of ~159kHz. Its hard to know what frequencies to expect as this is a general purpose board however the clock will always be 1-16MHz

1. Are there any other frequencies I need to take into account for AVCC?
2. If not, the bode plot gives a gain of roughly -30dB at 1MHz, is this considered decent reduction or should I aim for better? I feel like the answer to this question will be "it depends on you application" and if this is the case, what kind of applications would this setup limit me to?

The resistor is also rated to 3W so in the absolute worst case where every pin on Port A sources/sinks its max of 40mA (not that i would deliberately drive a pin anywhere near its max!) The resistor should be able to handle it; $$P_r=I^2R = (8*0.04)^2(10) = 1.024W$$

After reading many posts regarding decoupling capacitors my current understanding is this:

• Place a ceramic capacitor as close to the the GND and VCC pins of the micro as possible. Use wide traces/planes (and avoid vias if possible?) to connect the cap to the micro and supply. this capacitor should be placed between the supply and micro and is to deal with high frequency noise, value of 100nF. Is it worth including another capacitor near the micro of a value other than 100nF and 10uF?
• Place a 22uF tantalum cap across VCC and GND, does not need to be close to the micro because it is used to deal with lower frequencies which are not effected by the inductance of the traces. The voltage regulator states using at least a 10uF tantalum between OUTPUT and GND (larger values will improve stability further) so only one will be included for both regulator and micro and be placed near the regulator.
• The regulator datasheet also suggests a 10uF tantalum cap between INPUT and GND, "suitable for almost all applications". I've read about tantalum capacitors being very vulnerable to even brief voltage spikes above their rated max. The input voltage will be either 4xAA batteries giving ~6V or the external ISP programmer giving 5V, what are likely sources of voltage spikes? initial powerup? The 10uF tantalum caps are rated to 16V, is this likely to be enough of a buffer?
• Included on the board are 2x dual n-channel mosfets driving 4 LEDs, the mosfets are there just to serve as a high impedance buffer (i think thats the correct term) incase any of the 4 I/O pins are also used to transmit data. Reading this post: Does my circuit need decoupling caps? The suggestion was made to also decouple the transistor and LED. Can and should the same principle be applied to a mosfet? The LED's are fairly low current, being driven at 2mA each so would a 22nF over the LED, series Resistor and mosfet D-S be sufficient?

Voltage Regulator:

Microcontroller (C16 value not determined):

Dual n-channel mosfet:

This will be my second time using a fab house and first time with something more complex than an NE555 so I would be happy for any feedback that goes along with my many questions! Thanks

AVDD should be filtered as much as possible, e.g. it should provide as clean as possible voltage in all circumstances, no matter how dirty the input/digital power is. Maybe use 10uF or 100uF instead of the 0.1uF you've calculated. A good option would be to use a separate linear regulator for the AVDD.

One option would be to connect AVDD through two pins and a jumper in between so you can break the connection. If it should happen that you need a cleaner AVDD in the future, you could remove that jumper and add external clean AVDD power for the application. You can't think of everything aforehand. Give yourself some options such as this to change things in the future.

Add extra pins for measuring and debugging the board and especially extra GND and VDD pins for connecting external equipment, pull-ups, pull-downs etc, as well as oscilloscope probe ground. It wouldn't hurt to design in an extra pin header connector with 8 data bits and ground for connecting a cheap logic analyzer. And for the regulators, just follow the advice and example shcematics in the regulator data sheets. Good luck!

• I chose the 0.1uF value because its what i had available, simulating the frequecy response for 10 and 100uF however makes these look much more appealing. Getting a ceramic cap (either SMD or Thru-hole) with a value this high seems to increase the price of them quite a bit (and electrolytic become inductive at high frequencies so theyre a no go). Is it normal to pay a fair bit extra for these higher value ceramics or am i missing something? Your other suggestions regarding general board design are good ones and i will use them :) – Jordan Cartwright Apr 25 '16 at 2:47
• @Jordan, I wouldn't think of it as a decoupling capacitor.. anyway, I think you should use two or three different capacitors in parallel; a large electrolytic to take away the large voltage drops and a ceramic or two to eat the high frequency noise. But I'm more of a digital design guy than analog. – PkP Apr 25 '16 at 19:52

I've seen plenty of development boards where a 20 ohm resistor feeding a couple of uF has provided reasonable filtering for AVCC, the amount of filtering needed has more to do with how noisy your supply rails are. If you've got enough filtering on your supply rails to keep any ripple to a few mV you may even be able to get away with having VCC and AVCC tied together. As for decoupling the micro, VCC feeds an internal regulator anyway (most micros have core voltages of 1.8V or less) so the VCC caps just need to be able to handle any short bursts that are too fast for the internal regulator (really anything over 100kHz or so). If you want to play it safe, a 100nF in parallel with 2.2uF or so should be fine. After all, an AtTiny is not exactly a power hungry monster so you don't need much bulk capacitance.

• 100nF parallel with 2.2uF seems doable :) is it common to still use ceramics for values as high as 2.2uF? i know i should stay away from electrolytic for decoupling, what about solid aluminium? – Jordan Cartwright Apr 25 '16 at 2:53
• Solid aluminum or Polymer caps are very good when you need sheer bulk capacitance, but are probably overkill here, the motherboard in my pc has 8 little polymer caps and it's sometimes feeding 80A+ (at a volt) to the cpu. But it's totally fine to use ceramics up to 2uF, they're starting to appear more and more in everything due to their really really low ESR/ESL, small size and low cost. Taiyo Yuden has a 470uF 2.5 volt ceramic capacitor in an 1812 package for US\$6.65 from Digikey. – Sam Apr 25 '16 at 6:47