The advanced version of a microprocessor is a microcontroller that includes a CPU, Interrupts controller, RAM, ROM, I/O unit, etc. A microcontroller is mainly used for the operation of high-speed signal processing in an embedded system. So it performs like a major component while designing an embedded system. There are different kinds of microcontrollers available which are used based on requirements like 8051, PIC, AVR, etc. So this article gives brief information on one of the types of microcontrollers namely the AVR microcontroller.
AVR microcontroller was manufactured by Atmel Corporation in 1996 and its architecture was developed by “Alf-Egil Bogen & Vegard Wollan. The name of this microcontroller was taken from its developers namely Alf-Egil Bogen & Vegard Wollan RISC microcontroller. The first microcontroller based on AVR architecture is AT90S8515 but the first commercial microcontroller was AT90S1200.
The Atmel’s AVR is one of the most popular microcontroller families today. The reason behind this huge popularity is the relative ease of use and the low cost level of the microcontrollers, which can be purchased in 8-pin packages that range from $1 to $10 dollars.
What is AVR Microcontroller?
An advanced version of a microcomputer that is integrated into a tiny chip is known as the AVR microcontroller. This microcontroller includes a processor, programmable I/O peripherals & memory. The AVR microcontroller provides digital control over any kind of electrical, automotive, or mechanical system, industrial plants, different devices, electronic gadgets, etc. These microcontrollers are available in 8, 16, and 32-bit ICs. So, the most commonly used AVR microcontrollers are; ATmega8, ATmega16, ATmega32 & ATmega328 microcontrollers.
AVR Microcontrollers are available in 3 categories like TinyAVR, MegaAVR & XmegaAVR.
- TinyAVR microcontrollers are available in small sizes, have less memory & opt for only simpler applications.
- MegaAVR microcontrollers are very famous because they have upto 256 KB of memory, include a maximum number of peripherals & used in moderate to complex-based applications.
- XmegaAVR is frequently used for complex applications where high speed & large program memory is required.
The AVR accepts a wide range of instruction set including ATmel’s original THUMB instruction set and also the regular ARM instruction set. Arduino boards use ATMEL ATmega series microcontrollers as their
Name of Series
|Number of Pins||Flash Memory|
|6 to 32||0.5 to 8KB||Tiny Size|
|28 to 100||4 to 256KB|
|XmegaAVR||44 to 100||16 to 384KB|
Included DMA and Event System.
AVR Microcontroller Features
The features of the AVR microcontroller include the following.
- Flash memory is 16KB. SRAM is 1KB.
- 10-bit •8-Channel ADC.
- EPROM is 512 Bytes.
- ISP or In-System Programmer.
- Serial USART.
- DIP package.
- 16-bit Timer or Counter -1.
- 8-bit Timers or Counters -2.
- Digital to Analog Comparator.
- Master or slave SPI serial interface.
- SPI Interface.
- It is available in 40-Pin.
- PWM Channels -4.
- Programmable serial USART.
- Programmable watchdog timer including separate on-chip oscillator.
- ARM CPU
Types of AVR Microcontroller
AVR microcontrollers are available in four types like ATmega8, ATmega16, ATmega32 & ATmega328 microcontrollers where each microcontroller and its function are discussed below.
Atmega8 AVR Microcontroller
This microcontroller is a 28-pin IC including Internal SRAM- 1KByte, flash memory-8kb, and two external interrupt support. This microcontroller is based on RISC architecture & it is designed by Microchip. This microcontroller is available in three packages PDIP, TQFP & MLF, wherever the first package includes 28 pins & the remaining two packages will be available with 32-pins on every module.
The Program memory or flash memory of this microcontroller is 8KB which is used for storing programming code & permanent settings. This microcontroller is used to make electrical and electronic projects.
Atmega16 AVR Microcontroller
This is a high-performance 8-bit microcontroller from the family of Atmel’s Mega AVR. This microcontroller includes 40 pins based on enhanced RISC architecture including 131 powerful instructions. So this is one of the most used & cheapest microcontrollers because it has several pins & features.
It has a programmable flash memory-16 KB, 1 KB of static RAM, and 512 Bytes of EEPROM. This type of microcontroller includes 32 general-purpose registers & an instruction set that are connected directly to the ALU & allowed 2- separate registers to be accessed within single instruction which is performed in a single CLK cycle.
The flash memory’s endurance cycle, as well as EEPROM, is about 10K & 100Krespectively. Most of the instructions in this microcontroller perform in a single machine cycle and it can work on 16MHz of maximum frequency.
The Atmega16 AVR microcontroller is used in commercial products, and small industrial machines, This microcontroller can also be used to measure the duty cycle and frequency of the external device..
Atmega32 AVR Microcontroller
The Atmega32 AVR microcontroller is a low-power, high-performance RISC-based microcontroller. This controller operates from 1.8 to 5.5 volts.
This microcontroller has different features like it combines 32 KB ISP flash memory with 1 KB-EEPROM, 2 KB-SRAM, read-while-write capabilities, general purpose Input/Output lines, general-purpose working registers-32, a JTAG interface for on-chip debugging or programming, 3- flexible timer/counters including compare modes, serial programmable USART, SPI serial port, internal & external interrupts, a USI (universal serial interface) with start condition detector, programmable watchdog timer including an internal oscillator, 10-bit 8-channel A/D converter, etc.
Atmega32 AVR microcontroller is used in motor control systems, DSP, peripheral Interface systems, temperature control systems, measuring analog signals, and different embedded systems like vending machines, coffee machines, etc
Atmega328 AVR Microcontroller
The Atmega328 AVR microcontroller is a high-performance and low-power 8-bit RISC-based microchip that simply combines 32 KB ISP Flash memory with read-while-write capabilities. The operating voltage of this AVR microcontroller ranges from 1.8 to 5.5 volts.
The main features of the Atmega328 AVR microcontroller mainly include EEPROM-1 KB, SRAM-2 KB, 32 general-purpose registers, 23-general purpose I/O lines, flexible timer or counters-3 including compare modes, serial programmable USART, internal & external interrupts, SPI serial port, a 2-wire serial interface, 10-bit 6-channel A/D converter, programmable watchdog timer including internal oscillator & five software selectable power saving modes.
The applications of the Atmega328 AVR microcontroller mainly include autonomous systems and different electronic projects where a low-powered, simple, low-cost microchip is required. This is the most popular AVR controller so it is used in Arduino development platforms like different ARDUINO boards like Arduino Uno, Arduino Nano & Arduino Pro Mini models.
AVR Microcontroller PinOut/PinDiagram
The AVR Atmega 32 microcontroller pin configuration is shown below. This microcontroller includes four ports port-A, port-B, port-C, and port-D. Port-A mainly includes pins from PA7to PA0, port-B includes PB7 to PB0, port-C includes from PC7 to PC0 and port-D includes from PD7 to PD0.
In the above AVR microcontroller, the pins in the Port-A mainly include PA7 to PA0 which works like an 8-bit bi-directional I/O port, and also the analog inputs to the analog to digital converter, if this A/D converter is not utilized. These pins provide internal pull-up resistors.
The output of Port A buffers mainly includes symmetrical drive characteristics including both high sink & source capacity. Once port A pins are used as inputs from PA0 to PA7 then they are externally pulled low, then they will provide current if the inside pull-up resistors are turned on. The pins in this port are tri-stated, once a reset state turns on even if the CLK is not running.
Port B (PB7-PB0) & Port D (PD7-PD0)
The pins in these two ports mainly include PB7 to PB0 and PD7-PD0. These ports are 8-bit bi-directional I/O ports including internal pull-up resistors. The output of these two port buffers mainly includes symmetrical drive characteristics including both high sink & source capability. Like inputs, the pins of this port that are pulled low externally will provide current if the resistors are activated. The pins in these two ports are tri-stated whenever a reset condition turns active, even if the CLK is not running.
Port C (PC7-PC0)
The pins in Port C mainly include from PC7 to PC0 and it is an 8-bit bidirectional I/O port. If the JTAG (Joint Test Action Group) interface is allowed, the pull-up resistors on pins like PC3 (TMS), PC2 (TCK) & PC5 (TDI) will be triggered even if a reset takes place.
The TD0 pin is tri-stated unless TAP states that shift-out data are entered. Port C also serves the functions of the JTAG interface and other special features of the ATmega32.
VCC: It is a digital voltage supply pin.
GND: It is a GND pin.
It is a RESET pin, used to set the ATmega32 microcontroller to its main value. Throughout the starting of an application, this pin is to be set high for two machine revolutions.
This is an input pin to the inverting oscillator amplifier & also to the internal CLK operating circuit.
This pin is output from the inverting oscillator amplifier.
This is the voltage supply pin for Port A as well as the A/D Converter. The connection of this pin must be done to VCC externally, even if the A/D converter is not utilized. If the A/D converter is utilized, then it must be connected to VCC with a low-pass filter.
This is the analog reference pin used for the analog to digital converter.
AVR Microcontroller Architecture
The architecture of AVR microcontrollers is based on the advanced RISC & it includes 32 x 8-bit general-purpose registers. In a single CLK cycle, this microcontroller can get inputs from two registers to connect them to ALU for the requested operation & move back the result to an arbitrary register. Here, the ALU performs arithmetic & logical operations on the inputs from the register.
AVR can execute single cycle execution which means this microcontroller can perform 1 million instructions for each second if the frequency of the cycle is 1MHz. If the operating frequency of the controller is higher, then its processing speed will be higher. So the power consumption needs to optimize with processing speed & thus need to choose the operating frequency accordingly.
The architecture of the AVR microcontroller includes different building blocks and each block is explained in the AVR microcontroller block diagram shown below.
AVR microcontroller includes four 8-bit input-output ports like PORT-A, PORT-B, PORT-C & PORT-D.
Internal Calibrated Oscillator
AVR microcontroller includes an internal oscillator used for driving its CLK. This microcontroller is set to work at a 1 MHz internal calibrated oscillator. So the maximum internal oscillator frequency is 8 MHz.
This microcontroller includes an 8-channel ADC with a 10-bits resolution. The main function of this ADC is to read the analog input.
The microcontroller includes two 8-bit & one 16-bit timer/counter. The main function of timers in this controller is to generate precision actions like time delays created in between two operations.
In this microcontroller, the watchdog timer is present with an internal oscillator. The main function of this is to monitor and reset the controller continuously if the code gets trapped while executing in a defined time interval.
This microcontroller includes 21 interrupts where 16 interrupts are internal and the remaining interrupts are external. Here internal interrupts support different peripherals like ADC, USART, Timers, etc.
The term USART stands for “Universal Synchronous and Asynchronous Receiver” & interface of the transmitter is obtainable to interface with an external device that is capable of communicating serially.
General Purpose Registers
This microcontroller has 32 general-purpose registers where these registers are connected with the ALU of the CPU directly.
The memory of this microcontroller includes three different sections
This type of memory is helpful in storing the program dumped by the user into the AVR microcontroller. This program can be simply removed electrically like a single unit. This memory is non-volatile which means if the power is gone then the program will not erase. This microcontroller includes 16KB of in-system programmable Flash EEPROM.
Byte Addressable EEPROM
Byte addressable EEPROM is a nonvolatile memory that is mainly used for data storage. This microcontroller includes EEPROM- 512 bytes, so this memory can be simply helpful in storing the lock code if we are designing an electronic door lock application.
SRAM stands for Static Random Access Memory which is the volatile memory of the AVR microcontroller so the data will be lost once power is deactivated. This microcontroller includes 1KB – of internal SRAM. A small part of SRAM is reserved for general purpose registers which are used by the CPU & also some other peripheral subsystems.
These microcontrollers include In-System Programmable Flash Memory or ISP that can be simply programmed without detaching the chip from the circuit; This allows for reprogramming of the microcontroller when it is within the application circuit.
The term SPI stands for Serial Peripheral Interface, which is mainly used for serial communication between two different devices on a common CLK source. The SPI data transmission speed is high as compared to USART.
TWI is a Two-Wire Interface that can be used to connect a network for devices, so several devices can be simply connected above this interface to form this network so that the transmission of data can be done simultaneously by devices with their own unique address.
The DAC or Digital to Analog Converter in the microcontroller is used to perform the reverse action of ADC. This converter is simply used whenever there is a requirement of changing a signal from digital to analog.
Advantages and Disadvantages
The advantages of the AVR microcontroller include the following.
- These microcontrollers have high speed, high performance & less power consumption.
- It cancels the machine cycle to perform the pipeline operation with both the CLK cycle & the instruction cycle.
- Very simple to use and less cost.
- Its performance is fast.
- Less weight.
- Easily available in the market.
- Easy to program and set up.
The disadvantages of the AVR microcontroller include the following.
- It has a single source so available only from Atmel.
- These microcontrollers have quite low power.
- Its maximum speed is near 20 MIPS.
- Processing power and memory are limited, so it is not required for every application.
The applications of the AVR microcontroller include the following.
- AVR microcontroller is mainly used in an embedded system for the operation of high-speed signal processing.
- These microcontrollers are used in touch screens, home automation, medical devices, defense, automobiles, etc.
- This microcontroller can be used in many types of projects like data acquisition, motion control, For signal sensing, interface GPS, GSM, motors, displays on LCD, unmanned aerial vehicles development, etc.
What kind of projects can I create with an AVR microcontroller?
Answer: You can make all kinds of things with an AVR microcontroller! Some examples include robots, lightsabers, doorbells and more!
What is AVR?
A: AVR stands for Atmel Virtual microcontroller. It is a microcontroller series developed by Atmel, which is a semiconductor company based in the United States. The company was founded in 1984 and has since grown to be one of the largest manufacturers of microcontrollers, with more than 100 million products sold per year. Their flagship product is the AVR line of microcontrollers, which are used in everything from household appliances to consumer electronics.
Why use AVR microcontrollers?
The main reason why AVR microcontrollers are used is because they are cheap and easy to use. They can be programmed using the C programming language, which makes them easy to use. Also, they are very small in size, making them very portable and light-weight.
How do you program an AVR microcontroller?
To program an AVR microcontroller you need to connect your PC or laptop to it using a USB cable or Bluetooth module so that you can download the code onto it from your computer. You then have to upload this code onto the microcontroller using your programming software like Atmel Studio or Arduino IDE.
What is the difference between AVR and Arduino?
Arduino is a microcontroller, while AVR is a microcontroller family. However, they are both based on the same ARM architecture and are compatible with each other.
Thus, this is all about brief information on AVR microcontroller – architecture, and working with applications. This microcontroller executes most of the instructions within one execution cycle. These microcontrollers are four times faster as compared to PIC microcontrollers because they consume low power & also operate in various power-saving modes. Here is a question for you, what are AVR stands for?