Atmel AVR

From Wikipedia, the free encyclopedia

The AVR®s are a family of RISC microcontrollers from Atmel.

Contents

The AVR basic architecture was conceived by two students at the Norwegian Institute of Technology (NTH) Alf-Egil Bogen and Vegard Wollan.[1]

The internal architecture was further developed by Alf and Vergard at Atmel Norway, a subsidiary of Atmel founded by the two architects.

The acronym AVR has been reported to stand for Advanced Virtual RISC, but it has also been rumoured to stand for the initials chip's designers: Alf and Vegard [RISC].

Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR Microcontrollers.

The AVR is a Harvard architecture machine with programs and data stored separately. Typical Harvard type machines store their programs in permanent or semi-permanent memory and data in volatile memory. Hence, they are ideal for embedded systems in the field, since the program memory is protected from voltage spikes and other harsh environmental factors that might corrupt the program.

AVRs are generally classified into three broad groups:

  • tinyAVRs
    • 1-8 kB program memory
    • 8-20-pin package
    • Limited peripheral set
  • megaAVRs
    • 4-256 kB program memory
    • 28-100-pin package
    • Extended instruction set (Multiply instructions and instructions for handling larger program memories)
    • Extensive peripheral set
  • Application specific AVRs
    • megaAVRs with special features not found on the other members of the AVR family, such as LCD controller, USB controller, advanced PWM etc.

Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the need for external memory (though still available on some devices).

Program instructions are stored in non-volatile Flash memory. Although they are 8-bit MCUs, each instruction takes 16 bits with an 8-bit opcode followed by 8 bits of data or an address to be modified by the previous intruction. So the flash memory is actually addressed in a 16-bit fashion.

The size of the program memory is occasionally indicated in the naming of the device itself (e.g., the ATmega64x line has 64 kB bytes of Flash).

The data address space consists of the register file, I/O registers, and SRAM. The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.

The working registers are mapped in as the first 32 memory addresses (000016-001F16) followed by the 64 I/O registers (002016-005F16).

Actual SRAM starts after the register sections (address 006016). (Note that the I/O register space may be larger on some more extensive devices, in which case the memory mapped I/O registers will occupy a portion of the SRAM address space.)

Even though there are separate addressing schemes and optimized opcodes for register file and I/O register access, all can still be addressed and manipulated as if they were in SRAM.

Some AVR microcontrollers have internal Electrically Erasable Programmable Read Only Memory (EEPROM) for semi-permanent data storage (as versus FLASH for semi-permanent program storage). Like Flash memory, EEPROM can maintain its contents when electrical power is removed.

This internal EEPROM memory is not mapped into the MCU's addressable memory space. It can only be accessed the same way an external peripheral device is, using special pointer registers and read/write instructions which makes EEPROM access much slower than other internal RAM.

Since the number of writes to EEPROM is not unlimited, Atmel specifies 100,000 write cycles in their datasheets. A well designed EEPROM write routine should compare the contents of an EEPROM address with desired contents and only perform an actual write if contents need to be changed.

Atmel's AVRs have a single level pipeline design. This means the next machine instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast among the eight-bit microcontrollers.

The AVR family of processors were designed with the efficient execution of compiled C code in mind and has several built-in pointers for the task.

The AVR instruction set is more orthogonal than most eight-bit microcontrollers, however, it is not completely regular:

  • Pointer registers X, Y, and Z have addressing capabilities that are different from each other.
  • Register locations R0 to R15 have different addressing capabilities than register locations R16 to R31.
  • I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to 63.
  • CLR affects flags, while SER does not, even though they are complementary instructions. CLR set all bits to zero and SER sets them to one. (Note that CLR is pseudo-op for EOR R, R; and SER is short for LDI R,$FF. Math operations such as EOR modify flags while moves/loads/stores/branches such as LDI do not.)

The AVR line can normally support clock speeds from 0-16 MHz, with some devices reaching 20 MHz. Lower powered operation usually requires a reduced clock speed. All AVRs feature an on-chip oscillator, removing the need for external clocks or resonator circuitry.

Since many operations on the AVR are single cycle, the AVR can achieve up to 1MIPS per MHz.

AVRs have a large following due to the free and inexpensive development tools available, including reasonably priced development boards and free development software. The AVRs are sold under various names that share the same basic core but with different peripheral and memory combinations. Compatibility amongst chips is fairly good.

See external links for sites relating to AVR development.

Current AVRs offer a wide range of features:

  • Multifunction, Bi-directional General Purpose I/O ports with configurable, built-in pull-up resistors
  • Multiple Internal Oscillators
  • Internal, Self-Programmable Instruction Flash Memory up to 256 K
    • In-System Programmable using ISP, JTAG, or High Voltage methods
    • Optional Boot Code Section with Independent Lock Bits for Protection
  • On chip debugging (OCD) support through JTAG or debugWIRE on most devices
  • Internal Data EEPROM up to 4 kB
  • Internal SRAM up to 8 K
  • 8-Bit and 16-Bit Timers
    • PWM output (Dead time generator on some devices)
    • Input capture
  • Analog Comparators
  • 10-Bit A/D Converters, with multiplex of up to 16 channels
  • A variety of serial interfaces, including
    • I²C Compatible Two-Wire Interface (TWI)
    • Synchronous/Asynchronous Serial Peripherals (UART/USART) (used with RS-232, RS-485, and more)
    • Serial Peripheral Interface Bus (SPI)
    • Universal Serial Interface (USI) for Two or Three-Wire Synchronous Data Transfer
  • Brownout Detection
  • Watchdog Timer (WDT)
  • Multiple Power-Saving Sleep Modes
  • Lighting and motor control (PWM Specific) Controller models
  • CAN Controller Support
  • USB Controller Support
    • Proper High-speed hardware & Hub controller with embedded AVR.
    • Also freely available low-speed (HID) software emulation
  • Ethernet Controller Support
  • LCD Controller Support
  • Low-voltage Devices Operating Down to 1.8v
  • picoPower Devices

Official Atmel AVR development tools and evaluation kits consists of a small number of starter kits and debugging tools with support for most AVR device:

The STK500 starter kit and development system features ISP and high voltage programming (HVP) for all AVR devices, either directly or through extension boards. The board is fitted with DIP sockets for all AVRs available in DIP packages.

STK500 Expansion Modules: Several expansion modules are available for the STK500 board:

  • STK501 - Adds support for microcontrollers in 64-pin TQFP packages.
  • STK502 - Adds support for LCD AVRs in 64-pin TQFP packages.
  • STK503 - Adds support for microcontrollers in 100-pin TQFP packages.
  • STK504 - Adds support for LCD AVRs in 100-pin TQFP packages.
  • STK505 - Adds support for 14 and 20-pin AVRs.
  • STK520 - Adds support for 14 and 20-pin microcontrollers from the AT90PWM family.
  • STK525 - Adds support for the AT90USB family of microcontrollers.

New USB support. A stripped-down STK500 development board. It is a quick response to the growing problem of PC systems without serial ports. Limited supply at the moment.

The Joint Test Action Group, In Circuit Emulator (JTAGICE) debugging tool supports on-chip debugging (OCD) of AVRs with a JTAG boundary-scan interface. The original JTAGICE is no longer in production, however it has been replaced by the JTAGICE mkII.

The JTAGICE mkII debugging tool supports on-chip debugging (OCD) of AVRs with JTAG or debugWIRE interface. The debugWire interface enables debugging using only one pin (the Reset pin), allowing debugging of applications running on low pin-count microcontrollers.

The very popular AVR Butterfly demonstration board is a self-contained, battery-powered computer running the Atmel AVR ATmega169V microcontroller. It was built to show-off the AVR family especially a new built-in LCD interface. The board includes the LCD screen, joystick, speaker, serial port, real time clock (RTC), flash memory chip, temperature, light and voltage sensors. The small board has a shirt pin on its back so it can be worn as a name badge.

The AVR Butterfly comes preloaded with software to demonstrate the capabilities of the microcontroller. Factory firmware can scroll your name, display the sensor readings, and show the time. The AVR Butterfly also has a piezo speaker that can be used to reproduce sounds and music.

The AVR Butterfly demonstrates LCD driving by running a 14-segment, six alpha-numeric character display. However, the LCD interface consumes many of the I/O pins.

The Butterfly's ATmega169 CPU is capable of speeds up to 8 MHz, however it is factory set by software to 2 MHz to preserve the button battery life. A pre-installed bootloader program allows the board to be re-programmed via a standard RS-232 serial plug with new programs that users can write with the free Atmel IDE tools.

Although not as robust in an industrial environment as some other microcontrollers like PICs, the AVRs are more flexible and far easier to write programs for especially if one wants to program in C.

AVRs have been use in various automotive applications such as security, safety, powertrain and entertainment systems. Atmel has recently launched a new publication "Atmel Automotive Compilation" to help developers with automotive applications. Some current usages are in BMW, Daimler-Chrysler and TRW.

USB-based AVRs have been used in the Microsoft Xbox hand contollers. The link between the controllers and Xbox is a USB.

Lego has recently released the firmware source code files for 8-bits AVRs to aid in the development of open-source alternatives to its very popular robotics NXT "brick" operating system.

Atmel has recently released a line of 32-bit RISC microcontrollers AVR32 that feature special SIMD and DSP instructions, along with other audio and video processing features.

This 32-bit family of devices is intended to compete with the ARM based processors.

  1. ^ Since 1996, NTH has become part of the Norwegian University of Science and Technology (NTNU)

Wikibooks
Wikibooks has more about this subject:

v  d  e
8-bit Microcontroller Families
PIC · AVR · COP8 · MCS-48 · MCS-51 · Z8 · eZ80 · HC08 · HC11· H8
v  d  e
RISC
Power Architecture · ARM architecture · DEC Alpha · Atmel AVR · MIPS architecture · PA-RISC · Parallax Propeller · PIC microcontroller · SPARC · SuperH · XAP processor · I960 · Motorola 88000
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.