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).
Previous article:AVR MCU Reset Introduction
Next article:How to use and set AVR fuses
Recommended ReadingLatest update time:2024-11-16 15:36
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Ask a question about the LM35CZ temperature sensor
- Functions of vent valve and drain valve of magnetic flap level gauge
- FatFs transplantation based on SPI for MSP430F5438A microcontroller
- Problem with STM32F767 timer overflow interrupt flag
- Comparison of the advantages of digital cameras and analog cameras in machine vision system design
- About the external interrupt of HAL library
- Playing with circuits (4) - UC3843 floating buck, 60W efficiency 93%
- Sinlinx A33 Development Board Linux Interrupt Programming 1--- Principle Description
- This week's highlights
- Xiaomi has eliminated China's copycat mobile phones in just 9 years since its founding. Do you agree?