Innovation for Every Engineer.

What is An AVR Microcontroller? Basics of AVR Microcontrollers



In this article, you will learn what is AVR microcontroller, what are its features, how to choose a suitable AVR microcontroller, and how to program AVR microcontroller in software and so on.



Catalog

I. What is a AVR Microcontroller?

II. AVR Microcontroller Features

III. Selection of AVR Series Single-chip Microcomputer

IV. AVR Microcontroller Application Field

V. Introduction to the experimental tools and equipment used in AVR

VI. AVR Microcontroller Programming Software

FAQ



I. What is AVR Microcontroller?


AVR microcontroller is an enhanced 8-bit and built-in Flash RISC order set developed by ATMEL. Compared with CISC, RISC is not just to reduce the command simply, but make the structure of the computer more simple and reasonable to improve the speed of the operation. The design absorbs the advantages of the 8051 and PIC microcontroller and has the ability to execute one instruction in a single clock cycle. The speed can reach 1Mips/MHz. AVR microcontrollers are widely used in the outside devices of the computers, industrial real-time control, instrumentation, communication equipment, home appliances, and other fields.

This vedio shows you how to build your own AVR development board and how to use it in your projects.

The hardware structure of AVR adopts a compromise strategy of 8-bit and 16-bit computer, that is, the local register memory stack (32 register files) and the single high-speed input/output scheme (i.e. input capture register, the output compares matching registers and corresponding control logic) are adopted, improving the execution speed of instruction, overcoming the bottleneck phenomenon, and enhancing the function. At the same time, it reduces the cost of external equipment management, simplifies the hardware structure, and reduces the cost. Therefore, the AVR microcontroller is a high-performance-price single-chip microcomputer, which has achieved an optimized balance in hardware/software development, speed, performance, and cost.


The introduction of the AVR microcontroller breaks this old design pattern completely, abolishes the machine cycle, and gives up the complex instruction computer (CISC) to pursue the instruction complete method; Reducing instruction set, taking words as the unit of instruction length, arranging the rich operands and opcodes in one word (the majority of single-cycle instructions in the order set are the same), and the reference period is short and the instruction can be prefetched, realizing flow operation, so you can execute instructions at high speed. Of course, high reliability must be required.


AVR Microcontroller


II. AVR Microcontroller Features


1. High-quality embedded Flash program memory, can be repeatedly written and erased, supporting ISP and IAP, which is easy to have product debugging, development, production, update. Long service-life EEPROM, can save key data for a long time and avoid power loss. High-capacity RAM in chips supports the development of system programs in high-level languages.


2. High speed, low power consumption, with SLEEP (power saving when sleeping) function. Each instruction can be executed at 50ns/ 20MHz, while power consumption is between l~2.5mA (typical power consumption, when WDT turned off, is 100nA), AVR (with prefetching instruction function) based on Harvard structure concept. That is, there are different memories and buses for program storage and data, when an instruction is executed, the next instruction is pre-removed from the program memory. This allows instructions to be executed within each clock cycle. The AVR microcontroller can operate at a wide voltage (2.7V~5V), has the strong anti-jamming ability, and reduces the general 8-bit computer software anti-interference design and hardware usage.


3. All the I/O lines of the AVR single-chip computer have an adjustable pull-up resistor. The input and output characteristics of parallel I/O port are similar to those of PIC's HI/LOW output and three-state high impedance H1-Z input, also be set similar to the 8051 series of internal high resistance as input function. It can be set as an input/output or can be set as high resistance input initially. So that I/O resources are flexible, powerful, and fully utilized. AVR's I/ O can accurately reflect the input/output of I/O.


4. AVR microcontroller has a variety of independent clock dividers for URAT, IIC, SPI. The Prescaler with up to 10 bits when matching with the 8 / 16-bit timer, can set the frequency division coefficient through software to provide a variety of timing times. The timer/counter (single) in the AVR microcontroller can be counted bidirectionally to form a triangle wave, then matched with the output comparison matching register, the output PWM of pulse width modulation with variable duty cycle, variable frequency, and variable phase square wave is generated.


5. For industrial products, with high current (irrigation current) lO=20mA~40mA (single output), can directly drive SSR or the relay. The built-in watchdog timer (WDT) is used to avoid the faulty program and improve the anti-interference ability of the product.


6. Superfunctional streamlined instruction. There are 32 general working registers (equivalent to 32 accumulators in 8051 single-chip computers), which overcomes the data processing problems caused by the single accumulator.


7. AVR microcontroller has analog comparator, I/O port can be used for A/D conversion, can form cheap A/D converter.


8. Byte-oriented high-speed hardware serial interface TWI and SPI. TWI is compatible with the I2C interface, with ACK signal hardware transmission and recognition, address recognition, bus arbitration, and other functions, It can realize all four kinds of multi-machine communication from one to another. SPI has the same function. It also looks like the 8051, AVR has multiple fixed interrupt vector entry addresses, so it can respond to interrupts quickly, and it will interrupt like PIC at the same vector address.


9. AVR microcontroller has an automatic power-up reset circuit, an independent watchdog circuit, low voltage detection circuit BOD, multiple reset sources (automatic up and down reset, external reset, watchdog reset, BOD reset). It can set up a delay operation program after running the system, enhancing the reliability of the system. And meanwhile, the AVR microcomputer has many power-saving sleep modes, wide voltage operation(2.7V-5V), strong anti-interference ability. So it is used widely in the electrical industry due to its advantages.


10. Enhanced high-speed synchronous/asynchronous serial port has the functions of generating checking code based on hardware, hardware detecting and debugging, two-stage receiving buffering, baud rate automatically adjusting position (when receiving), shielding data frame, and so on. They improve the reliability of communication and help write the program easily. It also makes up the distributed network and to realize the complex application of multi-computer communication system. 


The function of the serial port is much more than the serial port of the MCS-51/96 microcontroller. In addition, the AVR single-chip microcomputer has a high-speed operation, and the interrupt service time is short, therefore, high baud rate communication can be realized. Serial asynchronous communication UART does not occupy timer and SPI transmission function, because of its high speed, it can work in a standard integer frequency, while baud rate can reach 576Ko11, with multi-channel 10-bit AID converter and real-time clock RTC.


III. Selection of AVR Series Single-chip Microcomputer


AVR microcontroller technology embodies a variety of devices (including FLASH program memory, watchdog, EEPROM, synchronous/asynchronous serial port, TWI/ SPI/ AID/ A/D converter, timer, counter, etc.) and various functions (enhanced reliability of reset system, reduced power-consumption and anti-interference sleep mode, various interrupt systems, timer/counter with input capture and match output, replaceable I/O port. It fully reflects the modern single-chip technology develops into the "on-chip" SoC system.


AVR series microcontroller is complete, can be applied to different occasions. In order to make good use of it, it is necessary to know its classification based on different standards and functions. And here are introducing three grades and their models as examples.


AVR microcontroller has three grades:


Low-grade Tiny series: this type of microcontroller has Less memory, small in size, apt only for simpler applications, the applying model like Tiny11/12/13/15/26/28, etc.;


Midrange-grade AT90S series: this microcontroller is used commercially for compound applications, it requires large program memory and also high speed, such as AT90S1200/2313/8515/8535, etc.;


High-grade ATmega:  this type of microcontroller is the most popular one which has a good amount of memory up to 256KB, higher built-in peripherals, and fit for modest to difficult applications, the applying model like the ATmega8/16/32/64/128 (storage capacity is 8/16/32/64/128KB) and ATmega8515/8535.


AVR device pins range from 8 to 64, with a variety of packages available.


microcontroller's types form


IV. AVR Microcontroller Application Field


  • Air conditioning control panel

  • Printer control board(PRCB)

  • Intelligent meter

  • Intelligent flashlight

  • LED control screen

  • Medical equipment

  • GPS 


V. Experimental tools and equipment used in AVR


  • IC-CAVR6.31AC Language Compiler

  • Integrated Development Environment(ATMEL AVR Studio)

  • PonyProg2000 Download Software

  • AVR Microcontroller Integrated Test Board

  • AVR-JTAG Simulator

  • Parallel Port Loader

  • High Stability Power Supply

  • Multifunctional TOP2004 USB Programmer

  • PC


VI. AVR Microcontroller Programming Software


ICCAVR6.31AC Language Compiler

ICCAVR6.31A is a C programming language compiler developed by ImageCraft for AVR MCU. It is a pure 32-bit with an integrated development environment, also consists of an editor and project manager.


ICCAVR has been widely used because of its powerful function, simple operation, good technical support, and reasonable price. The following figure is the working interface of ICCAVR.


the working interface of ICCAVR


AVRStudio Integrated Development Environment

AVRStudio is an integrated development environment that integrates project management, program assembly, program debugging, program download, JTAG simulation, and so on. However, AVRStudio does not support the C programming language. Therefore, when we develop an AVR microcontroller with the C programming language, we should first compile the C programming language with ICCAVR, then open the compiled code file with AVRStudio to debug the program. The following figure is the workspace of SVRAStudio.

 the workspace of SVRAStudio


PonyProg2000 software 

It is mainly used for AVR MCU and PIC MCU program download, can be used in Windows95/98/ME/NT/20001XP operating systems. The following figure is the working interface of PonyProg2000.

the working interface of PonyProg2000


Attention

Write with PORTx, read with PINx

During the experiment, try not to connect the pin directly to the GND/VCC. When it is not set properly, the I/O port will output/fill the high current of 80mA (Vcc=5V), resulting in device damage.


As Input

1.The suspension (high resistance state) will be susceptible to interference if the internal pull-up resistor is usually allowed(generally, it seems that 51 has a strong anti-interference ability because 51 always has internal resistance to pull up).

2.Try not to let input suspended or analog input level close to VCC/2, because it will consume too much current, especially in low power applications of CMOS circuits.

3.The pin level provided by the reading software usually requires a clock cycle interval between the assignment instruction “out” and the read instruction “in”, such as the nop order.

4.The input of the functional module (interrupt, timer) can be triggered by a low level, also it can be the rising edge trigger or the falling edge trigger.

5.For high-resistance analog signal input, remember not to allow internal pull-up resistor to affect accuracy, such as ADC digital-analog converter input, analog comparator input, and so on.


As Output

Taking the necessary current limiting measures, for example, drive the LED to serialize the current-limiting resistor.


Reset

The internal pull-up resistor will be disabled when to reset. If strict level control is required in an application, such as motor control, it is necessary to use an external resistor to fix the level.


Dormant

As output, it is still in the same state

Input is generally invalid, but the input function is valid if the second function is interrupted. For example, the wake-up function of an external interrupt



FAQ


1. What is meant by AVR microcontroller?

AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. These are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.


2. How does AVR microcontroller work?

AVR is an 8-bit microcontroller belonging to the family of Reduced Instruction Set Computer (RISC). In RISC architecture the instruction set of the computer are not only fewer in number but also simpler and faster in operation. ... The input/output registers available are of 8-bits.


3. What does AVR stand for in electronics?

An automatic voltage regulator (AVR) is an electronic device that maintains a constant voltage level to electrical equipment on the same load.


4. What are the types of AVR?

In general, there are two types of an Automatic Voltage Regulator. One is the Relay Type and the other is the Servo Motor type. A Relay type AVR makes use of electronic circuitry like relays and semi-conductors to regulate the voltage.


5. Is Arduino AVR or ARM?

Arduino uses AVR- or ARM-based microcontrollers, depending on board. PIC is the oldest of the lot. There's no such thing as an “Arduino microcontroller”.


6. What is full form of AVR?

The Full form of AVR is Aortic Valve Replacement. An AVR is a type of open heart surgery used to treat problems with the heart's aortic valve.


7. What happens if AVR fails?

When AVR fails a protection called Field Failure protection will come into picture and trip the generator. ... If Failure of field is associated with under voltage which might happen due to severe fault near the generator and AVR might trip not able to maintain the voltage, the generator is tripped instantaneously.


8. What is AVR and ARM?

ARM is a microprocessor or CPU architecture while AVR is a microcontroller. ARM can be used similar to a microcontroller when combined with ROM, RAM and other peripherals to a single chip like LPC2148. ... Microcontroller has build in RAM, ROM and other peripherals in a single chip. While microprocessor has only the CPU.


9. What are the applications of AVR and ARM?

AVR and ARM comes under the family of micro-controller. But ARM can be used as both Microcontroller or as Microprocessor. ARM micro-controller and AVR micro-controller differs from each other in terms of different architecture and different sets of instruction, speed, cast, Memory, Power Consumption, Bus Width etc.


10. What is AVR microcontroller architecture?

AVR is a 8-bit RISC architecture (Reduced Instruction Set Computing) microcontroller in market since 1996 which is having on-chip programmable flash memory, SRAM, IO data space & EEPROM. AVR is the first MCU in market which has on-chip flash storage.


You May Also Like

A Complete Guide to Solid State Drive (SSD)

Brief introduction to the Application of some IC chips in Maxim Integrated

Product Recommendation

KY32-AT49BV162AT(T)

KY32-K9T1G08U0M-YIBO

KY32-CY7C131E-55NXI