Atmel AVR The AVR ® s are a family of RISC microcontrollers from Atmel . Their internal architecture was conceived by two students : Alf-Egil Bogen and Vegard Wollan , at the Norwegian Institute of Technology ( NTH ) and further developed at Atmel Norway , a subsidiary founded by the two architects . Atmel recently released the Atmel AVR32 line of microcontrollers . These are 32-bit RISC devices featuring SIMD and DSP instructions , along with additional features for audio and video processing , intended to compete with ARM based processors . Note that the use of `` AVR '' in this article refers to the 8-bit RISC line of Atmel AVR Microcontrollers . The acronym AVR has been reported to stand for Advanced Virtual RISC. It 's also rumoured to stand for the chip 's designers : Alf and Vegard , who evade the question when it comes up . Device Overview 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 . Flash , EEPROM , and SRAM are all integrated onto a single die , removing the need for external memory ( though still available on some devices ) . AVRs are generally divided into three broad groups : tinyAVRs 1-8kB program memory 8-20 pin package Limited peripheral set megaAVRs 4-256kB 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 . Program Memory Program instructions are stored in non-volatile Flash memory . Each instruction is either 16 or 32 bits in length . The Flash memory is addressed using 16 bit word sizes . This may be surprising and somewhat confusing for some that an 8-bit MCU addresses it 's program memory 16-bits at-a-time and addressed RAM 8-bits at-a-time . The size of the program memory is indicated in the naming of the device itself . For instance , the ATmega64x line has 64Kbytes of Flash . Almost all AVR devices are self-programmable . Data Memory and Registers The data address space consists of the register file , I/O registers , and SRAM . The AVRs have thirty-two single-byte registers and are classified as 8-bit RISC devices . The working registers are mapped in as the first thirty-two memory addresses ( 0000 16 -001F 16 ) followed by the 64 I/O registers ( 0020 16 -005F 16 ) . The actual SRAM starts after these sections ( address 0060 16 ) . ( 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 . EEPROM 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 registers and read/write instructions which makes EEPROM access much slower than other internal RAM. Although the number of writes to EEPROM is practically unlimited , Atmel claims reliability only up to 100 , 000 writes . Program Execution Atmel 's AVRs have a single level pipeline design . 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 for the efficient execution of compiled C code . 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 though , that neither CLR nor SER are native instructions . Instead CLR is syntactic sugar for [ produces the same machine code as ] EOR R , R while SER is syntactic sugar for LDI R , $ FF. Math operations such as EOR modify flags while moves/loads/stores/branches such as LDI do not . ) Speed The AVR line can normally support clock speeds from 0-16MHz , with some devices reaching 20MHz . 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 . Because many operations on the AVR are single cycle , the AVR can achieve up to 1 MIPS per MHz . Development 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 marketed 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 . Features Current AVRs offer a wide range of features : RISC Core Running Many Single Cycle Instructions Multifunction , Bi-directional I/O Ports with Internal , Configurable Pull-up Resistors Multiple Internal Oscillators Internal , Self-Programmable Instruction Flash Memory up to 256K 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 4KB Internal SRAM up to 8K 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 Dedicated I²C Compatible Two-Wire Interface ( TWI ) Synchronous/Asynchronous Serial Peripherals ( UART/USART ) ( As 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 Development Tools and Evaluation Kits 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 : STK500 Starter Kit The STK500 starter kit and development system features ISP and high voltage programming 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 . These include : 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 . The Dragon New USB support . Limited supply at the moment . JTAG ( IEEE 1149 . 1 ) 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 . 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 . Butterfly Demo Board The AVR Butterfly is a self-contained , battery-powered demonstration board running the ATMEL AVR ATmega169V Microcontroller . The board includes an LCD screen , joystick , speaker , serial port , RTC , flash chip , temperature , light & voltage sensors . The board has a shirt pin on its back and 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 . Also , the AVR Butterfly has a piezo buzzer that can reproduce sound . The AVRButterfly demonstrates LCD driving by running a 14-segment , 6 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 8Mhz , however it is factory set by software to 2Mhz to preserve the button battery life . A pre-installed bootloader program allows the board to be re-programmed with a standard RS-232 serial plug . Footnotes ^ Since 1996 , NTH is a part of the Norwegian University of Science and Technology ( NTNU ) See also AVR instruction set AVR Butterfly Wikibooks has more about this subject : Atmel_AVR External links Atmel Official Links Atmel Norway Atmel ( English ) Atmel AVR products 3rd Party Support - Links for other 3rd party sites Parametric Product Table AVR Studio - Free assembler/simulator IDE provided by Atmel AVR Forums & Discussion Groups AVRFreaks community web site - in English AVR - in Polish Atmega128 - in Spanish www.mikrocontroller.net - in German C Language Development AVR Libc – C Library for GCC WinAVR – Open Source Suite for Windows & GCC C Programming for Microcontrollers – AVR Butterfly and Free WinAVR GCC Toolset GNU Development Environment for AVRs – by Rich Neswold Procyon AVRlib – C Function Library Programming AVRs with GCC – by Guido Socher Atman AVR C/C++ – Powerfull IDE and Debugger based on AVR GCC BASIC & Other AVR Languages Other AVR Links Newbie Articles Candle Automation Tutorials Cornell Student Projects AVR tutorials & projects ATmega103 clone Another AVR Tutorial Sample CODE in C for AVR with circuit Diagrams RISC Power Architecture · ARM architecture · DEC Alpha · Atmel AVR · MIPS architecture · PA-RISC · PIC microcontroller · SPARC Categories : Microcontrollers | Electronics companies | Electronics companies of Norway | Computer companies of Norway In other languages : Dansk | Deutsch | Español | Français | 日本語 | Norsk ( bokmål ) | Norsk ( nynorsk ) | Polski | Русский | Suomi | Svenska | Türkçe Atmel_AVR 