Basic knowledge of AVR microcontrollers
Features of AVR microcontrollers:
Microcontrollers are currently classified into 4-bit, 8-bit, 16-bit, and 32-bit according to the processing power of the CPU. The higher the number of bits, the stronger the data processing capability and instruction system of the microcontroller. AVR, 51, and PIC are all 8-bit machines. 8-bit microcontrollers are also the most widely used microcontrollers at present, and they can be seen in various fields.
AVR microcontrollers are a new type of 8-bit microcontrollers developed by ATMEL in 1997. AVR microcontrollers are divided into the low-end ATtiny series, the mid-range AT90S series, and the high-end ATmega series. This site recommends that beginners choose to learn the chip model ATmega48/88/168 or ATmega16; the mid-range AT90S series is not recommended because they are relatively early products and they have been discontinued.
All models of AVR microcontrollers (except some old models) support ISP online programming (burning), and the chip can be repeatedly erased and written, which makes learning AVR very convenient. Designers can program and debug the chip directly on the target circuit board through the download line, without having to put the chip on a dedicated programmer or emulator for burning and debugging.
Some models of 51 microcontrollers also support ISP online programming, such as AT89S51, AT89S52, etc. PIC microcontrollers also partially support ISP, but many of its models are burned once by OPT, which really makes it difficult for beginners.
1. AVR runs the fastest under the same system clock;
2. The FLASH and EEPROM memories of all AVR microcontrollers can be repeatedly burned and written, and support ISP online programming (burning), and the entry cost is very low;
3. The chip integrates multiple frequency RC oscillators, power-on automatic reset, watchdog, startup delay and other functions, making circuit design very simple;
4. Each IO port can output strong high and low levels when used as output, and the IO port can be high impedance or with pull-up resistors when used as input;
5. The chip has rich and practical resources, such as AD analog-to-digital device, DA analog-to-digital device, rich interrupt sources, SPI, USART, TWI communication port, PWM, etc.;
6. The chip adopts advanced data encryption technology, which greatly increases the difficulty of cracking;
7. The on-chip FLASH space is large and there are many varieties. The pins are as few as 8 pins and as many as 64 pins.
8. The pins of some chips are compatible with the 51 series, which is easy to replace. For example, ATtiny2313 is compatible with AT89C2051, ATmega8515/162 is compatible with AT89S51, etc.
1: A download cable (burner/programmer), the common ones are "parallel port AVRISP download cable" and "AVRISP/STK500 download cable";
2: A set of download cable control software;
3: A set of development software for compiling program code (can use C language or assembly language);
4: A test board;
5: A computer.
The download cable is what we commonly call "burner" or "programmer". In the AVR field, it is generally called AVRISP download cable. Different download cables have different ways of connecting to computers. Generally, there are parallel ports, serial ports and USB interfaces.
The advantages of the parallel port AVRISP download cable are low price and simple structure. It contains a 74HC244 chip and several resistors and capacitors. The disadvantages are that it is large in size and needs to occupy a parallel port of a printer. The parallel port download cable itself does not need to be upgraded. The version of the control software is different, and the chips and functions it adapts to are also different. The control software generally uses the SL-ISP software of Ssangyong Electronics, which has a Chinese interface and is easy to operate.
The AVRISP download cable with serial and USB interfaces generally integrates an AVR microcontroller as the control chip. The most common chip is ATMEGA8535. By upgrading the program version of this chip and the program version of the control software, it can adapt to different models of AVR microcontrollers. The difference between the serial port and the USB port is that the USB interface download cable has an additional USB to serial port chip. There are many software that support serial and USB port download cables. General AVR compilation software supports them, such as CodeVisionAVR (referred to as CVAVR), AVR Studio, IAR, etc. Unfortunately, there is no easy-to-use Chinese interface software to support it so far.
Software
Introduction to
AVR Studio
AVR official ATMEL company's free software, assembly language, integrating software and hardware simulation, debugging, and downloading
WinAVR
GCC language, its advantages are free
ATmanAVR
GCC language, its advantages are Chinese interface, integrated AVR Studio soft simulator, engineering wizard, shared software
IAR
C language, shared software, very expensive!
ICCAVR
C language, shared software, I heard that the amount of code generated is slightly larger
FASTAVR
Basic syntax, shared software. Integrates more commonly used peripheral device operation functions, simple and easy to learn
BASCOM-AVR
Basic syntax, shared software. It integrates the operation functions of many commonly used peripheral devices, is simple and easy to learn, and integrates simulation, download and burn. It is worth mentioning that its help file integrates many examples.
CodeVisionAVR
is referred to as CVAVR
C language, shared software, an excellent AVR microcontroller C compiler, easy to get started It
integrates the operation functions of many commonly used peripheral devices, supports most AVR chips, supports bit variables, and is similar in style to Keil C51.
It integrates serial/parallel ports, AVRISP and other download and burn functions
It integrates a powerful code generation wizard recommended
Notes
For amateur electronics enthusiasts who are amateur programmers and have no MCU foundation, BASCOM-AVR is recommended as the entry-level software; for beginners who already have some MCU foundation or really want to learn AVR MCU, CVAVR is recommended as the entry-level software; whether it is CVAVR, IAR, AVRGCC, ICCAVR, etc., their syntax is similar, and their principle is to convert the source code into assembly code first, and then the AVR assembly compiler compiles it into the final machine code; but they have their own characteristics and differences, so it is a wise choice to choose the simple and easy-to-learn CVAVR as the entry-level software. The final machine code is generally a hex file or a binary bin file
Previous article:Development of digital controlled constant current source based on PWM function of AVR microcontroller
Next article:Design of electronic ballast based on AVR microcontroller
- Popular Resources
- Popular amplifiers
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
- COVID-19 and other challenges to LED design and coping strategies
- purchase
- Shocked! One person made a company popular
- [Evaluation of EC-01F-Kit, the NB-IoT development board of Anxinke] + Try to connect the serial port assistant to Alibaba Cloud
- A brief list of long and short distance wireless communication technologies
- A classic foreign book about semaphores
- If there is a hidden function on the right side, the reading area will be larger.
- Online ESP32 simulator is awesome! It takes more than ten minutes to help netizens light a lamp
- STLINK power supply has problems
- ANT Visualization