1 AVR Introduction

download 1 AVR Introduction

of 20

Transcript of 1 AVR Introduction

  • 7/30/2019 1 AVR Introduction

    1/20

    AVR or Atmel AVR are RISC based family ofmicrocontroller produced by Atmel Corporations

    The AVR is a Harvard architecture machine withprograms and data stored separately

  • 7/30/2019 1 AVR Introduction

    2/20

    Data RAM

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

    Program Memory

    Program instructions are stored in non-volatile Flashmemory. Although they are 8-bit MCUs, eachinstruction takes 16 bits with an 8-bit opcode followedby 8 bits of data or an address to be modified by theprevious instruction. So the flash memory is actuallyaddressed in a 16-bit fashion.

  • 7/30/2019 1 AVR Introduction

    3/20

    Internal Data Memory

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

    Program ExecutionAtmel's AVRs have a single level pipeline design. Thismeans the next machine instruction is fetched as thecurrent one is executing. Most instructions take just

    one or two clock cycles, making AVRs relatively fastamong the eight-bit microcontrollers. The AVR familyof processors were designed with the efficientexecution of compiled C code in mind and has severalbuilt-in pointers for the task.

  • 7/30/2019 1 AVR Introduction

    4/20

    Current AVRs offer a wide range of features:

    Multifunction, Bi-directional General Purpose I/O ports withconfigurable, 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 forProtection

    On chip debugging (OCD) support through JTAG ordebugWIRE onmost devices

    Internal Data EEPROM up to 4 kB

    Internal SRAM up to 8 K

  • 7/30/2019 1 AVR Introduction

    5/20

    8-Bit and 16-Bit Timers

    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

  • 7/30/2019 1 AVR Introduction

    6/20

    CAN Controller Support

    USB Controller Support

    Proper High-speed hardware & Hub controller withembedded AVR.

    Also freely available low-speed (HID) softwareemulation

    Ethernet Controller Support

    LCD Controller Support

    Low-voltage Devices Operating Down to 1.8v picoPower Devices

    IC Compatible Two-Wire Interface (TWI)

    PWM output (Dead time generator on some devices)

    Analog Comparators

  • 7/30/2019 1 AVR Introduction

    7/20

    Relatively low cost, ICs available

    Efficient RISC architecture, almost 10 times faster thanCISCFor details look into data sheets Crystal Clock is not divided and is given directly to the

    processor. 8051 divides clock by 12

    Microchip divides clock by 4 Motorola divides clock by 3 So generally speaking, an AVR running at 16 MHz crystal (Max

    speed of some AVRs) is equivalent to a 192 MHz 8051 or a 64 MHzPIC or a 36 MHz 68HC11 in general, but variations do exist

  • 7/30/2019 1 AVR Introduction

    8/20

    Although the assembly language of AVR is completely

    different from 8051, as that of Motorola and Microchiptoo, but:

    As AVR is manufactured by same company i.e. Atmelso the most direct benefit is that its datasheets aresimilar to AT89C51 and easy to follow for students

    who have studied AT89C51 datasheets Some AVR devices (e.g. AT90S8515) are Pin compatible

    to AT89C51 so previously made PCBs (with someminor modifications) can be used for testing andlearning the AVR architecture and programming

  • 7/30/2019 1 AVR Introduction

    9/20

    In system programmable via different methods

    A simple low cost trivial to make programming circuit isrequired to program most AVRs (Feature also availablein most PIC and some 8051 too)

    Latest AVRs support on-chip Boot program this

    completely eliminates the need for any externalprogramming hardware and the AVR can beprogrammed through its built-in UART or othercommunication ports. (Motorola has been offering thisfeature for a long time.)

  • 7/30/2019 1 AVR Introduction

    10/20

    Most AVRs have built-in 10 to 16-bit PWM channelsgenerated automatically by timers. Number ofchannels ranges from 2 to 6

    Most AVRs have built-in 10- bit ADC and MUX withnumber of channels ranging from 4 to 8

    Large variety of Flash Memory ranging from 1KB to128 KB

    Large variety of SRAM ranging up to 4 KB

    Built-in EEPROM support up to 4 KB

    I2C and SPI synchronous serial communication forshort distance networking of microcontrollers andother peripherals DACs, ADCs, Flash memory, MP3decoder ICs etc.

  • 7/30/2019 1 AVR Introduction

    11/20

    AVRs are generally classified in four board groups

    tinyAVRs 1-8 kB program memory

    8-20-pin package

    Limited peripheral setmegaAVRs

    4-256 kB program memory

    28-100-pin package

    Extended instruction set and peripheral set

  • 7/30/2019 1 AVR Introduction

    12/20

    XMEGA AVRs16-384 kB program memory

    44-100 pin package

    32-bit AVR UC3

    Application Specific AVRs

  • 7/30/2019 1 AVR Introduction

    13/20

    Features

    Size

  • 7/30/2019 1 AVR Introduction

    14/20

    Software we are going to use areAVR Studio

    For Simulation and Lab Experiments

    Proteus 7.1 or above

  • 7/30/2019 1 AVR Introduction

    15/20

  • 7/30/2019 1 AVR Introduction

    16/20

    High-performance, Low-power AVR 8-bit

    Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle

    Execution

    32 x 8 General Purpose Working Registers Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier

  • 7/30/2019 1 AVR Introduction

    17/20

    Nonvolatile Program and Data Memories

    16K Bytes of In-System Self-Programmable FlashEndurance: 10,000 Write/Erase Cycles

    Optional Boot Code Section with Independent Lock BitsIn-System Programming by On-chip Boot Program

    True Read-While-Write Operation512 Bytes EEPROM

    Endurance: 100,000 Write/Erase Cycles 1K Byte Internal SRAM

    Programming Lock for Software Security

  • 7/30/2019 1 AVR Introduction

    18/20

    Peripheral FeaturesTwo 8-bit Timer/Counters with Separate Prescalers and Compare

    Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode,

    and Capture Mode Real Time Counter with Separate Oscillator

    Four PWM Channels 8-channel, 10-bit ADC

    8 Single-ended Channels7 Differential Channels in TQFP Package Only2 Differential Channels with Programmable Gain at 1x, 10x, or200x

    Byte-oriented Two-wire Serial Interface Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator

  • 7/30/2019 1 AVR Introduction

    19/20

    Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standbyand Extended Standby

    JTAG (IEEE std. 1149.1 Compliant) Interface Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support Programming of Flash, EEPROM, Fuses, and Lock Bits through theJTAG Interface

  • 7/30/2019 1 AVR Introduction

    20/20

    I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, and 44-pad MLF

    Operating Voltages 2.7 - 5.5V for ATmega16L 4.5 - 5.5V for ATmega16

    Speed Grades 0 - 8 MHz for ATmega16L 0 - 16 MHz for ATmega16