10
Anant Shrivastava Anant Shrivatsava EI – 7 th SEM

Avr introduction

Embed Size (px)

DESCRIPTION

an introduction to AVR microcontroller family. you can contact anant @ http://anantshri.info

Citation preview

Page 1: Avr introduction

Anant Shrivastava

Anant Shrivatsava

EI – 7th SEM

Page 2: Avr introduction

Anant Shrivastava

INTRODUCTION• AVR or Atmel AVR are RISC based family of microcontroller produced by Atmel Corporations

• The acronym AVR has been reported to stand for Advanced Virtual RISC, but it has also been rumored to stand for the initials chip's designers:

Alf and Vegard [RISC]. Atmel says that the name AVR is not an acronym and does not stand for anything in particular.

Page 3: Avr introduction

Anant Shrivastava

• The original AVR MCU was developed at a local ASIC house in Trondheim Norway, where the two founders of Atmel Norway were working as students. It was known as a uRISC (MicroRISC). The internal architecture was further developed by

Alf and Vergard.

• The AVR is a Harvard architecture machine with programs and data stored separately.

Page 4: Avr introduction

Anant Shrivastava

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 and 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.

Page 5: Avr introduction

Anant Shrivastava

Device ArchitectureData RAMFlash, EEPROM, and SRAM are all integrated onto a single chip, removing the need for external memory (though still available on some devices).Program MemoryProgram 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 instruction. So the flash memory is actually addressed in a 16-bit fashion.Internal Data MemoryThe 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.

Page 6: Avr introduction

Anant Shrivastava

Internal RegistersThe 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). EEPROMSome AVR microcontrollers have internal Electrically Erasable Programmable Read Only Memory (EEPROM) for semi-permanent data storage. Like Flash memory, EEPROM can maintain its contents when electrical power is removed.Since the number of writes to EEPROM is not unlimited - Atmel specifies 100,000 write cycles in their datasheets.

More on Device Architecture

Page 7: Avr introduction

Anant Shrivastava

Program ExecutionAtmel'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.

MCU SpeedThe 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. Since many operations on the AVR are single cycle, the AVR can achieve up to 1MIPS per MHz.

Page 8: Avr introduction

Anant Shrivastava

Features•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

Page 9: Avr introduction

Anant Shrivastava

•Synchronous/Asynchronous Serial Peripherals (UART/USART) •Serial Peripheral Interface Bus (SPI)•Universal Serial Interface (USI) for Two/Three-Wire Synchronous Data Transfer

•Brownout Detection•Watchdog Timer (WDT)•Multiple Power-Saving Sleep Modes•Lighting and motor control (PWM Specific) Controller models•10-Bit A/D Converters, with multiplex of up to 16 channels•A variety of serial interfaces, including

MORE FEATURES

Page 10: Avr introduction

Anant Shrivastava

SOME MORE FEATURES•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 DevicesI²C Compatible Two-Wire Interface (TWI) PWM output (Dead time generator on some devices)

Input captureAnalog Comparators