AVR basic hardware circuit design and analysis

Publisher:逍遥游侠Latest update time:2013-01-14 Source: 21IC Keywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The basic AVR hardware circuit includes the following parts:

1. Reset circuit

2. Crystal oscillator circuit

3. AD conversion filter circuit

4. ISP download interface

5. JTAG emulation interface

6. Power supply

The following is an analysis of the above basic circuit using the AVR entry-level chip ATmega16L-8AI recommended by this website. (-8AI means 8M frequency TQFP chip package, industrial grade, for more detailed model meaning information, please refer to: AVR chip entry knowledge)

Reset circuit design

Mega16 has built-in power-on reset design. And in the fuse position, you can control the extra time when resetting, so the reset circuit outside the AVR can be designed very simply when powered on: just pull a 10K resistor to VCC (R0). For reliability, add a 0.1uF capacitor (C0) to eliminate interference and clutter.

D3 (1N4148) has two functions: one is to clamp the maximum voltage of the reset input to around Vcc+0.5V, and the other is to short-circuit the R0 (10K) resistor when the system is powered off, allowing C0 to discharge quickly, so that an effective reset can be generated when the next call comes.

When the AVR is working, when the S0 switch is pressed, the reset pin becomes a low level, triggering the AVR chip to reset.

Important note: In actual application, if you do not need a reset button, the reset pin can be disconnected from any components, and the AVR chip can still work stably. That is, this part does not require any peripheral components.

Design of crystal oscillator circuit

Mega16 has built-in RC oscillator circuit, which can generate oscillation frequency of 1M, 2M, 4M, 8M. However, the built-in RC oscillator is after all, so in some occasions with higher requirements, such as when communicating with RS232 and a more accurate baud rate is required, it is recommended to use an external crystal oscillator circuit.

In the early 90S series, both ends of the crystal oscillator need to be connected to capacitors of about 22pF. In actual use of the Mega series, these two small capacitors can also work normally. However, for the standardization of the circuit, we still recommend connecting them.

Important note: In actual application, if you do not need a very high frequency accuracy, you can use the internal RC oscillation, which means that this part does not require any peripheral components.

Design of AD conversion filter circuit

To reduce the power supply interference of AD conversion, Mega16 chip has independent AD power supply. The official document recommends connecting a 10uH inductor (L1) in series with VCC, and then connecting a 0.1uF capacitor to ground (C3). [page]

Mega16 has a built-in 2.56V standard reference voltage. You can also input a reference voltage from outside, such as using a TL431 reference voltage source. However, for general applications, the internal reference voltage is sufficient. It is customary to connect a 0.1uF capacitor to ground (C4) at the AREF pin. [page]

Important note: In actual application, if you want to simplify the circuit, you can connect AVCC directly to VCC and leave AREF floating. That is, this part does not require any peripheral components.

ISP download interface design

The ISP download interface does not require any peripheral parts. It uses a double-row 2*5 socket. Since there are no peripheral parts, PB5 (MOSI), PB6 (MISO), PB7 (SCK), and reset pins can still be used normally without being interfered by ISP.

Important note: In actual application, if you want to simplify the parts, you can not solder the 2*5 socket. But it is best to keep this space in PCB design so that the software in the AVR can be upgraded later.

JTAG simulation interface design

The simulation interface also uses a double-row 2*5 socket, and requires four 10K pull-up resistors.

Important note: In actual applications, if you do not want to use JTAG simulation and do not want to be affected by the four 10K pull-up resistors, you can disconnect JP1-JP4.

Power Design

The most commonly used voltages for AVR microcontrollers are 5V and 3.3V. This circuit uses a switch to switch between the two voltages and indicates them with a two-color diode (green light at 5V and red light at 3.3V).

Diode D1 prevents the user from plugging in the wrong polarity of the power supply. D2 allows the user to reverse the voltage into this circuit without damaging the 1117-ADJ.

The characteristic of 1117-ADJ is that there will be a 50uA current output at pin 1 and a 1.25V voltage at pins 1-2. Using this characteristic, the output voltage can be calculated:

When the SW switch is turned to the left, the current on R6 is 1.25/0.33 = 3.78ma. The current on R8 is 1117-ADJ 1 pin current plus the current on R6, that is, 0.05+3.78=3.83ma. It can be calculated that the voltage on R8 is 3.84V. So VCC=1.25+3.83=5.08V. The error is within 2%.

When the SW switch is turned to the right, the current on R6 is 1.25/0.62 = 2.02ma. The current on R8 is 1117-ADJ 1 pin current plus the current on R6, that is, 0.05+2.02=2.07ma. It can be calculated that the voltage on R8 is 2.07V. So VCC=1.25+2.07=3.32V. The error is within 1%.

Using 1% precision resistors, the overall output voltage error can be controlled within 3%.

Important note: In actual application, depending on the brand of 1117-ADJ used, the input voltage can be as low as 7V or even lower. (You can also use a low voltage drop diode instead of 1N4007).

Keywords:AVR Reference address:AVR basic hardware circuit design and analysis

Previous article:AVR MCU Reset Introduction
Next article:How to use and set AVR fuses

Recommended ReadingLatest update time:2024-11-16 15:36

Microchip releases a variety of PIC® and AVR® microcontroller products for today's mainstream embedded designs
Microchip releases a variety of PIC® and AVR® microcontroller products for today's mainstream embedded designs Microchip Expands 8-bit PIC® and AVR® Microcontrollers with Five New Product Families and More Than 60 New Devices Product Lineup In 2022, as smartphones
[Embedded]
Microchip releases a variety of PIC® and AVR® microcontroller products for today's mainstream embedded designs
How to solve the problem of power-on reset confusion in AVR microcontrollers
In the application of single-chip microcomputer, it is often necessary to save the running data when the power is off (including manual shutdown and accidental external power failure). At present, the common method is to add a larger capacitor (generally more than 2000 μf, and some are in the farad level) to the singl
[Microcontroller]
How to solve the problem of power-on reset confusion in AVR microcontrollers
Application Design of AVR Single Chip Microcomputer in Perpetual Calendar
0 Introduction With the development of information technology and the improvement of living standards, electronic perpetual calendars are gradually entering the lives of the general public. They have long life, small errors, and can intuitively display rich contents such as year, month, day, hour, minute, second
[Microcontroller]
Application Design of AVR Single Chip Microcomputer in Perpetual Calendar
Classic experience of using AVR microcontroller
AVR has the characteristics of quick learning and simple development. However, to fully appreciate and utilize the advantages of AVR, application engineers also need to continuously learn and improve their hardware and software design and development capabilities through practice. Compared with traditional types of si
[Microcontroller]
Classic experience of using AVR microcontroller
Some suggestions on using AVR microcontroller for AD conversion
Here are some suggestions based on my own development experience: The AD conversion time should be greater than 64us (determined by pre-scaling). If the sampling hold time is short, the acquisition result may be inaccurate. The sampling voltage source should be kept as stable as possible; (that is, the sampling an
[Microcontroller]
AVR MCU 4-digit digital tube counting C program
The 4-digit digital tube of the AVR microcontroller counts and cycles from 0000 to 5000. The bit select terminal is connected to the lower 4 bits of the PC, and the segment select terminal is connected to the PA port. The program is as follows: #include iom16v.h //header file #include macros.h //header file #defin
[Microcontroller]
AVR MCU fuse and unlock
The fuse configuration of AVR microcontrollers is a place where AVR microcontroller beginners can easily make mistakes. In fact, as long as you pay attention to some matters, you can try to avoid the microcontroller from being locked. Even if the microcontroller is locked, you can use some methods to unlock it. This a
[Microcontroller]
AVR MCU fuse and unlock
Design of refrigerator control system based on AVR single chip microcomputer
For many years, refrigerators have been used as storage and preservation space in the domestic market, and people's demand for refrigerators is also the most basic functions of freezing and freezing. In recent years, with the popularization of household refrigerators and the rapid rise of the mainstream consumer gro
[Microcontroller]
Design of refrigerator control system based on AVR single chip microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号