AVR Hardware Design Considerations
AVR Hardware Design Considerations
Features
Description
This application note has been written to provide answers to some of the questions
® ®
and problems faced when starting designs involving Atmel AVR
microcontrollers. The application note treats topics that are known to cause
problems. The scope is to provide an introduction to potential design problems
rather than being an exhaustive walk-through of how to design applications using
the AVR microcontrollers. This document is thus a collection of information from
existing Atmel AVR documents, combined with information that is not previously
documented.
It is highly recommended to read the application note AVR040 - “EMC Design
Considerations” – before initiating a new design, especially if the aim of the design
is a commercial application that needs to meet the requirements of the EMC
directive (or similar directives in countries outside Europe). The application note is
available from the AVR section of the official Atmel website http://www.atmel.com.
Atmel-2521N-AVR-Hardware-Design-Considerations_ApplicationNote_062015
Ta bl e of Conte nts
Features 1
Description 1
Table of Contents ............................................................................................................... 2
1 Power Supply............................................................................................................... 3
1.1 Digital Supply ........................................................................................................................................ 3
1.2 Analog Supply ....................................................................................................................................... 4
1.3 Noise Implications ................................................................................................................................. 4
Figure 1-1 shows an example of insufficient decoupling. The capacitor is placed too far away from the
microcontroller, creating a large high current loop. The power and ground planes here are parts of the high
current loop. As a result of this, noise is spread more easily to other devices on the board, and radiated emission
from the board is increased even further. The whole ground plane will act as an antenna for the noise, instead of
only the high current loop. This will be the case if the power and ground pins are connected directly to the planes
(typical for hole-mounted components) and the decoupling capacitor is connected the same way. The same is
often seen for boards with surface-mount components if the integrated circuits are placed on one side of the
board and the decoupling capacitors are placed on the other.
Figure 1-2 shows a better placement of the capacitor. The lines that are part of the high current loop are not part
of the power or ground planes. This is important, as the power and ground planes otherwise will spread a lot of
noise. Further, the figure shows another improvement of the decoupling. A series ferrite bead is inserted to
reduce the switching noise on the power plane. The series resistance of the ferrite bead must of course be low
enough to ensure that there will be no significant DC voltage drop.
Generally, the Atmel AVR devices where power and ground lines are placed close together (like the Atmel
ATmega8535) will get better decoupling than devices with industry standard pin-out (like the Atmel
ATmega8515), where the power and ground pins are placed in opposite corners of the DIP package. This
disadvantage can be overcome by using for example a TQFP package, which allows decoupling capacitors to be
placed very close to the die. For devices with multiple pairs of power and ground pins, it is essential that every
pair of pins get its own decoupling capacitor.
The main supply should also have a tantalum or ceramic capacitor of some µF to stabilize it.
Some ISP programmers are powered by the target power supply. In this way they easily adapt to the correct
voltage level of the target board. Other ISP programmers, like Atmel STK500, can alternatively power the target
board via the VTG line. In that case it is important that the power supply on the target is not switched on. Read the
user guide for your ISP programmer for details on its capabilities and physical interface.
Multiple Atmel AVR in a single application can share the same ISP interface to allow for programming of all the
devices through a minimal interface. However, the AVR devices will all respond to the ISP instructions if special
design considerations are not made.
Figure 3-3. Standard JTAG Connector Used on e.g. AVR JTAGICE mkll and AVR ONE!
Protection resistors, as shown in Figure 3-2, are necessary if the JTAG lines are also used for other purposes.
For example, if they are used for analog input to the Atmel AVR, there are often analog filters on the lines. If such
filters are present on the JTAG lines, it may be required to eliminate the filter capacitor during programming to
ensure that the load is mainly resistive. Figure 3-5 illustrates how this can be done.
Figure 3-6. Standard PDI Connector Used on e.g. Atmel STK600 and AVR JTAGICE mkll
The RESET pin can be reconfigured as an I/O pin by programming the RSTDISBL fuse of the device. This
disables the reset functionality, and requires +12V to be applied to RESET for programming to work. Not all
programming tools are capable of generating this voltage.
The parallel resonator is intended used in circuits, which contains reactive components, usual capacitors. Such
circuits depend on the combination of the reactive components and the resonator to accomplish the phase shift
necessary to start and maintain the oscillation at a given frequency. Basic oscillator circuits used for parallel
resonators are illustrated in Figure 4-1. The part of the circuit above the dashed line, represent the oscillator
circuit internally in the AVR.
Figure 4-1. Basic Inverter Circuits Equivalent to the Oscillator Circuits in AVRs
Rf Rf
Clo
XTAL1 XTAL2
CL1 CL2
Rb
CL1 Xtal CL2
XTAL1/ XTAL2/
TOSC1 TOSC2
Xtal
(A) (B)
Oscillator circuit for crystals and ceramic resonators faster than 400kHz.
2. Circuit for low frequency crystals (32.768kHz) (not on all Atmel AVR).
Simplifying the description of the Atmel AVR built-in oscillator circuits they can be understood as the inverter
based oscillator circuits illustrated in Figure 4-1. The circuit used with resonators of frequencies above 400kHz is
depicted in (A). When using this circuit, capacitive load must be applied externally. The oscillator circuit seen in
Where C L1 and C L2 refer to the external capacitors seen in Figure 4-1 and C L1S and C L2S are stray capacitances
at the XTAL pins of the AVR. Assuming symmetric layout, so that C L1 = C L2 = C and C L1S = C L2S = C S , then the
external capacitors can be determined by Error! Reference source not found. (C S can be estimated to be 5pF
- 10pF):
Equation 4-2.
C = 2 ⋅ CL − CS
5 Example Layout
Figure 5-1 (A-C) shows a schematic and PCB layout using a crystal oscillator for Atmel ATxmega32A4; this
example assumes a multilayer design with supply and ground plane on separate layers. Decoupling of all digital
supply pairs from VCC and isolating AVCC from VCC is seen. Note the short distance between the
crystal/capacitors and the ATxmega32A4, the ground plane surrounding the crystal and how close the vias that
connect to the planes are to the ATxmega32A4 pins in the layout.
(A)
Atmel®, Atmel logo and combinations thereof, AVR®, AVR Studio®, Enabling Unlimited Possibilities®, tinyAVR®, XMEGA®, and others are registered trademarks or
trademarks of Atmel Corporation in U.S. and other countries. Other terms and product names may be trademarks of others.
DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right
is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL
WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE
LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND
PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves
the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless
specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use
as components in applications intended to support or sustain life.
SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where
the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without an Atmel officer's specific written consent.
Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products
AVR Hardware Design Considerations [APPLICATION NOTE]
are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor 17
intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.
Atmel-2521N-AVR-Hardware-Design-Considerations_ApplicationNote_062015