AVR Microcontroller System

Embed Size (px)

Citation preview

  • 7/27/2019 AVR Microcontroller System

    1/37

  • 7/27/2019 AVR Microcontroller System

    2/37

    Introducing Microcontrollers About AVR

    AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming

  • 7/27/2019 AVR Microcontroller System

    3/37

  • 7/27/2019 AVR Microcontroller System

    4/37

    A microprocessor is a central processing unit(CPU) on a single chip.

    When a microprocessor and associatedsupport circuitry, peripheral I/O componentsand memory (program as well as data) wereput together to form a small computerspecifically for data acquisition and controlapplications, it was called a microcomputer.

  • 7/27/2019 AVR Microcontroller System

    5/37

    When the components that make amicrocomputer were put together on a single

    chip of silicon, it was called themicrocontroller.

  • 7/27/2019 AVR Microcontroller System

    6/37

    A microcontrollerinterfaces to

    external deviceswith a minimum ofexternalcomponents

  • 7/27/2019 AVR Microcontroller System

    7/37

    A recent white paper by Sun Microsystems claims thatby the end of the decade, an average home willcontain between 50 to 100 microcontrollerscontrolling digital phones, microwave ovens, VCRs,televisions sets and television remotes, dishwashers,home security systems, PDAs etc.

    An average car has about 15 processors; the 1999Mercedes S-class car has 63 microprocessors, while

    the 1999 BMW has 65 processors! Except perhaps the human body, microprocessors andmicrocontrollers have gotten into everything aroundus.

  • 7/27/2019 AVR Microcontroller System

    8/37

  • 7/27/2019 AVR Microcontroller System

    9/37

    Enhanced RISC architecture with mostlyfixed-length instruction, load-store memory

    access and 32 general-purpose registers. A two-stage instruction pipeline that speeds

    up execution Majority of instructions take one clock cycle Up to 10-MHz clock operation

  • 7/27/2019 AVR Microcontroller System

    10/37

    Wide variety of on-chip peripherals, includingdigital I/O, ADC, EEPROM, Timer, UART, RTC

    timer, PWM etc Internal program and data memory. In-System programmable (ISP) Available in 8-pin to 64-pin size to suit wide

    variety of applications

  • 7/27/2019 AVR Microcontroller System

    11/37

    Up to 12 times performance speedup overconventional CISC controllers.

    Wide operating voltage from 2.7V to 6.0V Simple architecture offers a small learning

    curve to the uninitiated.

  • 7/27/2019 AVR Microcontroller System

    12/37

  • 7/27/2019 AVR Microcontroller System

    13/37

  • 7/27/2019 AVR Microcontroller System

    14/37

    8-Kbyte self-

    programming Flash

    Program Memory

    1-Kbyte SRAM 512 Byte EEPROM

    6 or 8 Channel 10-bit A/D-converter.

    Up to 16 MIPSthroughput at 16 Mhz.

    2.7 - 5.5 Volt operation.

  • 7/27/2019 AVR Microcontroller System

    15/37

  • 7/27/2019 AVR Microcontroller System

    16/37

  • 7/27/2019 AVR Microcontroller System

    17/37

  • 7/27/2019 AVR Microcontroller System

    18/37

  • 7/27/2019 AVR Microcontroller System

    19/37

  • 7/27/2019 AVR Microcontroller System

    20/37

  • 7/27/2019 AVR Microcontroller System

    21/37

  • 7/27/2019 AVR Microcontroller System

    22/37

  • 7/27/2019 AVR Microcontroller System

    23/37

  • 7/27/2019 AVR Microcontroller System

    24/37

  • 7/27/2019 AVR Microcontroller System

    25/37

  • 7/27/2019 AVR Microcontroller System

    26/37

  • 7/27/2019 AVR Microcontroller System

    27/37

    The purpose of this

    demo is:

    to design a simple AVR

    system

    Interface it to and LCDdisplay

    Program it to display

    Hello World

    Programmer

    AVR MCU

    LCD Display

  • 7/27/2019 AVR Microcontroller System

    28/37

  • 7/27/2019 AVR Microcontroller System

    29/37

  • 7/27/2019 AVR Microcontroller System

    30/37

  • 7/27/2019 AVR Microcontroller System

    31/37

    LCD Interface AVR Port

    RS PORTC.2

    RW PORTC.3

    E PORTC.4

    DATA PORTD

  • 7/27/2019 AVR Microcontroller System

    32/37

  • 7/27/2019 AVR Microcontroller System

    33/37

    AVR Studio GCC

    AVRLibs PonyProg

  • 7/27/2019 AVR Microcontroller System

    34/37

    Include the following files in your project

    lcd.c

    global.h timer.h

    lcd.h

  • 7/27/2019 AVR Microcontroller System

    35/37

    Add a new c source file to your AVR Studioproject.

    Type in the main function as shown below:

  • 7/27/2019 AVR Microcontroller System

    36/37

    Main() {

    lcdInitHW(); lcdInit();

    lcdGotoXY(0,4);

    lcdPrintData(Hello Word!, 11);

    }

  • 7/27/2019 AVR Microcontroller System

    37/37