A Guide to AVR Microcontroller [PDF]

Published: 27 December 2021 | Last Updated: 27 December 20216895
AVR microcontroller is an enhanced RISC (Reduced Instruction Set CPU) high-speed 8-bit microcontroller with built-in Flash developed by ATMEL in 1997.
This video explains the basics of the AVR Microcontroller.

Introduction to AVR Microcontroller


Catalog

Ⅰ Introduction

Ⅱ Features

Ⅲ Background

Ⅳ Advantages

Ⅴ Part number identification

Ⅵ AVR microcontroller selection

Ⅶ Use of applications

Ⅷ AVR microcontroller programming book PDF

 

Ⅰ Introduction

The AVR microcontroller is a RISC microcontroller introduced by Atmel in 1997. RISC does not simply reduce the number of instructions but increases the speed of computing by making the structure of the computer simpler and more rational.

In 1997, Mr. A and Mr. V of ATMEL's Norwegian Design Center developed a high-speed 8-bit microcontroller with RISC streamlined instruction set, or AVR for short, using ATMEL's new Flash technology.

Atmel AVR source simple Wikipedia.jpg

Atmel AVR (source: simple Wikipedia)

Ⅱ Features

RISC gives priority to simple instructions that are used frequently and avoids complex instructions. It also fixes the instruction width and reduces the variety of instruction formats and addressing methods, thus shortening the instruction cycle and increasing the operating speed. Because AVR adopts this structure of RISC, all AVR series microcontrollers have a high-speed processing capability of 1MIPS/MHz (million instructions per second/ megahertz).

High reliability, high functionality, high speed, low power consumption, and low price are the important indicators to measure the performance of microcontrollers, and also the necessary conditions for microcontrollers to occupy the market and survive.

Ⅲ Background

Mainly due to the process and design level, power consumption, and anti-interference performance, the early microcontroller took a conservative program: that is, the use of a higher frequency division factor on the clock division, making the instruction cycle long and slow execution speed. Although later CMOS microcontrollers use measures such as increasing the clock frequency and reducing the crossover coefficient, this state has not been completely changed (51 as well as 51 compatible). In the meantime, although there are some streamlined instruction set microcontrollers (RISC), they still follow the practice of clock division.

The introduction of the AVR microcontroller, completely break this old design pattern and abandoned the complex instruction computer (CISC). It adopts a streamlined instruction set, using a word as the instruction length unit, and arranges the content-rich operands and opcodes in a word (most of the single-cycle instructions in the instruction set are like this). The short fetch cycle and the ability to pre-fetch instructions enable high-speed execution of instructions. Of course, this leap in speed is backed by high reliability.

Ⅳ Advantages

(1) The AVR microcontroller hardware structure adopts a compromise strategy between 8-bit and 16-bit machines, i.e., a local register storage heap (32 register files) and a single high-speed input/output scheme, i.e., input capture registers, output comparison matching registers, and corresponding control logic. It increases the instruction execution speed (1Mips/MHz) and enhances the functionality. At the same time, it reduces the overhead of peripheral management, relatively simplifies the hardware structure, and reduces the cost. Therefore, the AVR microcontroller is a cost-effective microcontroller with an optimized balance of software/hardware overhead, speed, performance, and cost.

AVR microcontroller development board.jpg

AVR microcontroller development board

(2) Enhanced high-speed asynchronous/synchronous serial port with hardware generation of parity codes, hardware detection, and parity error detection, two-stage receive buffer, automatic baud rate adjustment positioning (when receiving), masked data frames, etc... It improves the reliability of communication, facilitates program writing, makes it easier to form distributed networks, and realizes complex applications of multi-computer communication systems. The serial port function greatly exceeds that of MCS-51/96 microcontrollers, coupled with the AVR microcontroller's high-speed and short interrupt service time, so it can achieve high baud rate communication.

(3) Embedded high-quality Flash program memory, easy to erase and write, support ISP and IAP. The embedded long-life EEProm can save key data for a long time to avoid power loss. The on-chip large-capacity RAM not only meets the use of general occasions, but also more effectively supports the development of system programs using high-level languages, and can be extended with external RAM like the MCS-51 microcontroller.

(4) Byte-oriented high-speed hardware serial interface TWI, SPI. TWI is compatible with the I2C interface, with ACK signal hardware transmission and identification, address identification, bus arbitration, and other functions. It can realize the master/slave to send/receive all four combinations of multi-computer communication. SPI supports master/slave and the other four combinations of multi-computer communication.

(5) Automatic power-on reset circuit, independent watchdog circuit, low-voltage detection circuit BOD, multiple reset sources (automatic power-on/off reset, external reset, watchdog reset, BOD reset), settable post-start delay runtime program, enhancing the reliability of the embedded system.

(6) I/O lines all with settable pull-up resistors, can be individually set as input/output, settable (initial) high-resistance input, strong drive capability (can eliminate the power driver parts), and other features so that the I/O port resources are flexible, powerful and can be fully utilized.

(7) On-chip with a variety of independent clock dividers, respectively, for the use of UCAT, I2C, SPI. Among them, with an 8/16-bit timer with up to 10-bit prescaler, can be set by software to provide a wide range of timing time.

(8) Unique "Timer/Counter (single) bi-directional counting to form a triangular waveform. It works with the "output comparison register" to generate pulse width modulation output PWM design method, i.e., variable air ratio, variable frequency, and variable phase square wave.

(9) It has a variety of power-saving sleep modes and can operate with wide voltage (5-2.7V). It has a strong anti-interference capability, which can reduce the software anti-interference design workload and hardware usage in general 8-bit machines.

Ⅴ Part number identification

1. The letter following the model number indicates the voltage working range. With "V": 1.8-5.5V; if default, without "V": 2.7-5.5V.

Example: ATmega48-20AU, without "V" means the working voltage is 2.7-5.5V.

2. The numeric part of the suffix indicates it supports a very high system clock.

Example: ATmega48-20AU, "20" means it can support a very high system clock of 20MHZ.

3. The first (second) letter of Suffix, indicating the package. "P": DIP package, "A": TQFP package, "M": MLF package.

Example: ATmega48-20AU, "A" means TQFP package.

4. The last letter after the suffix indicates the application level. "C": commercial grade, "I": industrial grade (leaded), "U" industrial-grade (lead-free).

Example: ATmega48-20AU, "U" means lead-free industrial grade, ATmega48-20AI, "I" means leaded industrial grade.

Ⅵ AVR microcontroller selection

The AVR microcontroller series is complete and can be applied to the requirements of various different occasions.

AVR microcontrollers are available in 3 grades.

  • Low-grade Tiny series: mainly Tiny11/12/13/15/26/28 etc;

  • Mid-range AT90S series: mainly AT90S1200/2313/8515/8535, etc.; (being phased out or transformed into Mega)

  • High-grade ATmega: mainly ATmega8/16/32/64/128 (storage capacity of 8/16/32/64/128KB) and ATmega8515/8535, etc.

AVR device pins from 8 to 64 pins, and a variety of different packages to choose from.

Recommended AVR microcontrollers for beginners

ATTiny1616 product detail.jpg

The latest and most cost-effective AVR chip, retailing for less than $0.50, with 16K of built-in Flash, integrated PTC touch controller, an 5-bit DAC. In addition to traditional serial peripherals, it can meet a wide range of applications from consumer, industrial, and even automotive levels. The ATtiny1616's ultra-low power design allows it to run touch applications with an average power consumption of less than 20uA.

ATMEGA4809 product detail.jpg

A powerful advanced microcontroller with up to 20Mhz, 48K on-chip Flash, 6K SRAM, and 256Bytes of on-chip EEPROM, multiple integrated serial interfaces, up to 16 ADC inputs, and the same outstanding low-power design. 4809 is available in a large 48-pin package, either in a two-row inline package or in a four-sided flat package for trial use. The 4809 is available in a large 48-pin package, either in a two-row inline package or in a four-sided flat package for experimental use, or in a flat, pinless package for use in compact layouts.

ATmega16 product detail.jpg

1. One of the most cost-effective AVR chips, and is in good supply. The retail price is only $20 and can be reduced to $14 for lots of 100 pieces or more.

2. 16K FLASH, to meet the vast majority of experimental needs.

3. Rich and powerful built-in functions. Almost all the functions of the AVR chip.

4. Support JTAG emulation, do not need to buy a more expensive emulator.

5. There is a straight plug package, convenient for experimental soldering.

LGT8F0XA series

LGT8F0XA was mentioned and released on 2012-4-6 as an extremely low-cost 8-bit general-purpose microcontroller, based on RISC (Reduced Instruction Set), whose instruction set and bus structure are similar to AVR microcontrollers.

3-stage pipeline design, 131 instructions, most instructions executed in a single clock cycle, 32 8-bit general-purpose working registers, performance up to 16 MIPS when operating at 16MHz, single-cycle hardware multiplier (8×8).

Ⅶ Use of applications

1. Market perspective

(1) Price/performance ratio: Most of the AVR models have a high price/performance ratio. The models with outstanding price/performance ratio are: atmega48, atmega8, atmega16, atmega169P.

(2) Supply: The supply of general-purpose models of AVR is more stable, and the samples and supply of non-conventional models of AVR still have problems.

(3) Market share: The market share of AVR is still not as good as PIC and 51, but the advantages of AVR make the market share of AVR has been expanding, and the annual usage of AVR has been rising.

2. Applications

Based on the excellent performance of the AVR microcontroller and the above characteristics, it can be seen that the AVR microcontroller can be applied to most of the embedded application scenarios at present. At the same time, due to the various packaging forms of AVR microcontroller, it can be used in teaching, for example, using a double inline microcontroller can let students design and solder a microcontroller minimum system by themselves and learn the software and hardware technology.

Ⅷ AVR microcontroller programming book PDF

the AVR microcontroller and embedded

UTMEL

We are the professional distributor of electronic components, providing a large variety of products to save you a lot of time, effort, and cost with our efficient self-customized service. careful order preparation fast delivery service

Frequently Asked Questions

1. What is AVR microcontroller used for?

It contain on chip central processing unit (CPU), Read only memory (ROM), Random access memory (RAM), input/output unit, interrupts controller etc. Therefore a microcontroller is used for high speed signal processing operation inside an embedded system.

2. Is AVR microcontroller or microprocessor?

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.
Related Articles

  • Getting Started with Arduino: What is Arduino and How to Use Arduino Boards
    Getting Started with Arduino: What is Arduino and How to Use Arduino Boards
    UTMEL28 September 20233980

    Arduino is an open-source electronics platform that includes software and programmable circuit boards, allowing beginners to build electronic projects by writing simple code. The article provides an overview of Arduino, including different board types, basic components, how to use the boards, and project ideas like an automated plant watering system.

    Read More
  • Arduino vs. Raspberry Pi: A Detailed Comparison
    Arduino vs. Raspberry Pi: A Detailed Comparison
    UTMEL24 April 20252963

    Hello everyone, welcome to the new post today.This guide is going to talk in detail about Arduino vs. Raspberry Pi to clarify their differences and help you pick the right board based on your needs.

    Read More
  • Electronic Components in the Smart Home System
    Electronic Components in the Smart Home System
    UTMEL24 April 2025924

    Electronic parts are the heart of every smart home system. These parts help devices talk, do tasks, and save energy. For instance, sensors notice motion or temperature changes. Microcontrollers use this data to do things like dim lights or turn on alarms.

    Read More
  • Software Tools for NXP Microcontroller Development
    Software Tools for NXP Microcontroller Development
    UTMEL06 June 2025491

    Discover how NXP microcontroller tools like MCUXpresso IDE, SDK, and Config Tools streamline coding, debugging, and hardware setup for embedded systems.

    Read More
  • VFD Driving Guide: What to Do When Your MCU Runs Out of Pins?
    VFD Driving Guide: What to Do When Your MCU Runs Out of Pins?
    UTMEL22 July 2025479

    This comprehensive guide addresses a common challenge faced by electronics enthusiasts: driving Vacuum Fluorescent Displays (VFDs) when microcontrollers have insufficient pins. Sparked by a Reddit user's question about controlling a VFD with more segments than available MCU pins, the article explores the elegant solution of multiplexing technology.

    Read More