+ All Categories
Home > Documents > Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello...

Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello...

Date post: 26-Mar-2015
Category:
Upload: jasmine-stevens
View: 232 times
Download: 7 times
Share this document with a friend
Popular Tags:
34
Transcript
Page 1: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 2: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Introducing MicrocontrollersAbout AVRAVR Mega8 ArchitectureAVR Programming InterfaceDemo: ‘Hello World’ AVR Design.Demo: Hardware DesignDemo: Programming

Page 3: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 4: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

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

When a microprocessor and associated support circuitry, peripheral I/O components and memory (program as well as data) were put together to form a small computer specifically for data acquisition and control applications, it was called a microcomputer.

Page 5: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

When the components that make a microcomputer were put together on a single chip of silicon, it was called the microcontroller.

Page 6: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

A microcontroller interfaces to external devices with a minimum of external components

Page 7: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

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

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

Except perhaps the human body, microprocessors and microcontrollers have gotten into everything around us.

Page 8: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 9: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

RISC architecture with mostly fixed-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

Page 10: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Wide variety of on-chip peripherals, including digital I/O, ADC, EEPROM, Timer, UART, RTC timer, PWM etc

Internal program and data memory. In-System programmableAvailable in 8-pin to 64-pin size to

suit wide variety of applications

Page 11: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Up to 12 times performance speedup over conventional CISC controllers.

Wide operating voltage from 2.7V to 6.0V

Simple architecture offers a small learning curve to the uninitiated.

Page 12: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 13: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

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 MIPS

throughput at 16 Mhz.

2.7 - 5.5 Volt operation.

Page 14: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 15: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 16: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 17: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 18: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

The AVR chip has a built in interface, that enables you to write and read the content of the program flash and the built-in-EEPROM. This interface works serially and needs three signal lines: SCK: A clock signal that shifts the bits to be written

to the memory into an internal shift register, and that shifts out the bits to be read from another

internal shift register, MOSI: The data signal that sends the bits to be

written to the AVR, MISO: The data signal that receives the bits read

from the AVR.

Page 19: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

These three signal pins are internally connected to the programming machine only if you change the RESET pin to zero.

Otherwise, during normal operation of the AVR, these pins are programmable I/O lines like all the others.

If you like to use these pins for other purposes during normal operation, and for in-system-programming, you'll have to take care, that these two purposes do not

conflict. Usually you then decouple these by resistors or by

use of a multiplexer. What is necessary in your case, depends from

your use of the pins in the normal operation mode.

Page 20: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

VTG: Target Voltage

LED: indicates that the programmer is doing its job

Page 21: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 22: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 23: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 24: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

The purpose of this demo is: to design a simple

AVR system Interface it to and

LCD display Program it to

display ‘Hello World’

Programmer

AVR MCUAVR MCU

LCD DisplayLCD Display

Page 25: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 26: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 27: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 28: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

LCD Interface AVR Port

RS PORTC.2

RW PORTC.3

E PORTC.4

DATA PORTD

Page 29: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.
Page 30: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

AVR StudioGCCAVRLibsPonyProg

Page 31: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Include the following files in your project lcd.c global.h timer.h lcd.h

Page 32: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Add a new c source file to your AVR Studio project.

Type in the main function as shown below:

Page 33: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Main(){

lcdInitHW(); lcdInit(); lcdGotoXY(0,4); lcdPrintData(“Hello Word!”, 11);

}

Page 34: Introducing Microcontrollers About AVR AVR Mega8 Architecture AVR Programming Interface Demo: Hello World AVR Design. Demo: Hardware Design Demo: Programming.

Recommended