Electronic – Decoupling a Microcontroller/Development Board Design

decoupling-capacitorlow passmicrocontroller

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:
enter image description here

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:
enter image description here

Microcontroller (C16 value not determined):
enter image description here

Dual n-channel mosfet:
enter image description here

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

Best Answer

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!