mp lab3 assemblya

7
Lab 03- Introd COMSATS Institut Introduction to Microcontroller Departmen Objectives: To familiarize with To get started with microcontrollers. Tools: For PCB designing machine. AVR Studio, Proteu duction to Assembly language progra te of Information Technology, Islamabad Lab 03 o Programming in Assemb rs and Basic Input/Output using Assembly Prepared by Abdul Samad nt of Electrical Engineering CIIT, Islama h PCB designing and etching process h assembly language programming fo g: Cooper sheet, Ferric Chloride ,Print us ISIS. amming 1 bly for AVR Operations abad s. or ter & Drill

Upload: rahehaqguests

Post on 24-Aug-2015

215 views

Category:

Documents


2 download

DESCRIPTION

MP Lab3 Assemblya

TRANSCRIPT

Lab 03- Introduction to COMSATS Institute of Information Technology, Islamabad Introduction to Programming in Assembly for AVR Microcontrollers and Basic Input/OutputDepartment of Electrical Engineering Objecties! To familiarize with PCB designing and etching process.To get started with assembl language programming for microcontrollers. "ools! !or PCB designing" Cooper sheet# !erric machine. $%& 'tudio# Proteus I'I' Introduction to $ssembl language programmingCOMSATS Institute of Information Technology, Islamabad #ab $% Introduction to Programming in Assembly for AVR Microcontrollers and Basic Input/Output using Assembly Prepared by Abdul &amad Department of Electrical Engineering 'II"( Islamabadwith PCB designing and etching process.To get started with assembl language programming for !or PCB designing" Cooper sheet# !erric Chloride #Printer ( )rill $%& 'tudio# Proteus I'I'. $ssembl language programming1 Introduction to Programming in Assembly for AVR Operations 'II"( Islamabad with PCB designing and etching process. To get started with assembl language programming for Chloride #Printer ( )rill Lab 03- Introduction to $ssembl language programming COMSATS Institute of Information Technology, Islamabad2 Introduction to Programming in Assembly! The main ad*antage of using assembl language is that it is fast and +uic,.Program written in assembl ta,e less time as we ,now e-act time for each instruction. 'uch ,nowledge of time re+uired for e-ecution of e*er instruction ma,es us capable of measuring accurate times and generating specific delas.$nother ad*antage is that programs are short hence if the program memor is short assembl becomes the preferred choice.The use of machine codes gi*es us precise control o*er microcontroller that we want to program. $ssembl is also case insensiti*e hence commands written in upper or lower case don.t ma,e an difference. AVR Assembler! /e will be using $%& assembler in this lab. This assembler is automaticall installed when $%& 'tudio is installed. The $ssembler translates assembl source code into ob0ect code. The generated ob0ect code can be used as input to a simulator or an emulator such as the $tmel $%& In-Circuit 1mulator. The $ssembler also generates a P&23able code and an optional 11P&23 file which can be programmed directl into the program memor and 11P&23 memor of an $%& microcontroller. Assembly Project Setup in AVR Studio: !ollow the following steps to setup an assembl language pro0ect in $%& 'tudio. 4-$fter opening $%& 'tudio go to pro0ect menu and select pro0ect wizard. The following window will be displaed" Lab 03- Introduction to $ssembl language programming COMSATS Institute of Information Technology, Islamabad3 2-'elect new pro0ect to get to the following window"

Lab 03- Introduction to $ssembl language programming COMSATS Institute of Information Technology, Islamabad4 3-'elect $%& $ssembler as pro0ect tpe. 'pecif the pro0ect location and gi*e our pro0ect a suitable name and clic, ne-t to get the following window" 4-'elect $%& 'imulator in debug platform and $T315$46 in )e*ice list. Then clic,ing on finish will complete the pro0ect setup. Assembly language programming: Registers: &egisters are 7 bit storage capacit which can store unsigned numbers from 0-899 or signed numbers from -48: to 487 ;most significant bit indicator of sign