AVR Board
Atmel AVR Board
AVR  arduino  atmel  board  code  core  data  design  development  device  features  flash  memory  USB  registers  microcontroller  power  program  programming  software 

AVR Microcontrollers

Here we present Atmel AVR microcontrollers, their features and different families of AVR in more details.


A brief history of the AVR microcontroller

The basic architecture of AVR was designed by two students of Norwegian Institute of Technology (NTH), Alf-Egil Bogen and Vegard Wollan, and then was bought and developed by Atmel in 1996. You may ask what AVR stands for; AVR can have different meanings for different people! Atmel says that it is nothing more than a product name, but it might stand for Advanced Virtual RISC, or Alf and Vegard RISC (the names of the AVR designers).

There are many kinds of AVR microcontroller with different properties. Except for AVR32, which is a 32-bit microcontroller, AVRs are all 8-bit microprocessors, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. One of the problems with the AVR microcontrollers is that they are not all 100% compatible in terms of software when going from one family to another family. To run programs written for the ATtiny25 on a ATmega64, we must recompile the program and possibly change some register locations before loading it into the ATmega64. AVRs are generally classified into four broad groups: Mega, Tiny, Special purpose, and Classic. On this website we cover the Mega family because these microcontrollers are widely used. Also, we will focus on ATmega32 since it is powerful, widely available, and comes in DIP packages, which makes it ideal for educational purposes. For those who have mastered the Mega family, understanding the other families is very easy and straightforward. The following is a brief description of the AVR microcontroller.

AVR Features

The AVR is an 8-bit RISC single-chip microcontroller with Harvard architecture that comes with some standard features such as on-chip program (code) ROM, data RAM, data EEPROM, timers and I/O ports. Most AVRs have some additional features like ADC, PWM, and different kinds of serial interface such as USART, SPI, I2C (TWI), CAN, USB, and so on. The details of the RAM/ROM memory and I/O features of the Mega are given elsewhere on this website.

AVR Microcontroller Program ROM

In microcontrollers, the ROM is used to store programs and for that reason it is called program or code ROM. Although the AVR has 8M (megabytes) of program (code) ROM space, not all family members come with that much ROM installed. The program ROM size can vary from 1K to 256K at the time of this writing, depending on the family member. The AVR was one of the first microcontrollers to use on-chip Flash memory for program storage. The Flash memory is ideal for fast development because Flash memory can be erased in seconds compared to the 20 minutes or more needed for the UV-EPROM.

AVR Mricrocontroller Data RAM and EEPROM

While ROM is used to store program (code), the RAM space is for data storage, The AVR has a maximum of 64K bytes of data RAM space. Not all of the family members come with that much RAM. The data RAM space has three components: general-purpose registers, I/O memory, and internal SRAM, There are 32 general-purpose registers in all of the AVRs, but the SRAM’s size and the I/O memory’s size varies from chip to chip. On the Atmel website, whenever the size of RAM is mentioned the internal SRAM size is meant. The internal SRAM space is used for a read/write scratch pad. In AVR, we also have a small amount of EEPROM to store critical data that does not need to be changed very oiten.

AVR Microcontroller l/O pins

The AVR can have from 3 to 86 pins for I/O. The number of I/O pins depends on the number of pins in the package itself The number of pins for the AVR package goes from 8 to 100 at this time, In the case of the 3-pin AT90S2323, we have 3 pins for I/O, while in the case of the l00-pin ATmega1280, we can use up to 86 pins for I/O.

AVR Microcontroller Peripherals

Most of the AVRs come with ADC (analog-to-digital converter), timers, and USART (Universal Synchronous Asynchronous Receiver Transmitter) as standard peripherals. The ADC is 10-bit and the number of ADC channels in AVR chips varies and can be up to 16, depending on the number of pins in the package. The AVR can have up to 6 timers besides the watchdog timer. The USART peripheral allows us to connect the AVR-based system to serial ports such as the COM port of the x86 IBM PC. Most of the AVR family members come with the I2C and SPI buses and some of them have USB or CAN bus as well.

AVR family overview

AVR can be classified into four groups: Classic, Mega, Tiny, and special purpose.

Classic AVR (AT90Sxxxx)

This is the original AVR chip, which has been replaced by newer AVR chips.

Mega AVR (ATmegaxxxx)

These are powerful microcontrollers with more than 120 instructions and lots of different peripheral capabilities, which can be used in different designs. Some of their characteristics are as follows:
  • Program memory: 4K to 256K bytes
  • Package: 28 to 100 pins
  • Extensive peripheral set
  • Extended instruction set; They have rich instruction sets.

Tiny AVR (ATtinyxxxx)

As its name indicates, the microcontrollers in this group have less instructions and smaller packages in comparison to mega family. You can design systems with low costs and power consumptions using the Tiny AVRs. Some of their characteristics are as follows:
  • Program memory: 1Kto SK bytes
  • Package: 8 to 23 pins
  • Limited peripheral set
  • Limited instruction set: The instruction sets are limited. For example, some of them do not have the multiply instruction.

Special Purpose AVR

The ICs of this group can be considered as a subset of other groups, but their special capabilities are made for designing specific applications. Some of the special capabilities are: USB controller, CAN controller, LCD controller, Zigbee, Ethernet controller, FPGA, and advanced PWM.

AVR Product Number Scheme

All of the product numbers start with AT, which stands for Atmel. Now, look at the number located at the end of the product number, from left to right, and find the biggest number that is a power of 2. This number most probably shows the amount of the Microcontroller’s ROM. For example, in ATmega1280 the biggest power of 2 that we can find is 128; so it has 128K bytes of ROM. In ATtiny44, the amount of memory is 4-K, and so on. Although this rule has a few exceptions such as AT90PWM216, which has 16K of ROM instead of 2K, it works in most of the cases.

Other Microcontrollers

There are many other popular 8-bit microcontrollers besides the AVR chip. Among them are the 8051, HCS08, PIC, and Z8. The AVR is made by Atmel Corp. Microchip produces the PIC family. Freescale (formerly Motorola) makes the HCS08 and many of its variations. Zilog produces the Z8 microcontroller. The 8051 family is made by Intel and a number of other companies.


There are many AVR development kits available. You need to learn only one tool chain to work with any AVR microcontroller. Some people compare PIC with AVR microcontrollers. There are some differences but be assured that both work well and it is only up to your taste to choose your favorite microcontroller. AVR microcontrollers are very popular and have a great community. Give them a try!