LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER

Similar documents
LABORATORY MANUAL MICROPROCESSORS AND MICROCONTROLLERS. S.E (I.T) ( S e m. IV)

EEE Lecture 1 -1-

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

CHAPTER 2 NUMBER SYSTEMS

ECE260: Fundamentals of Computer Engineering

,- # (%& ( = 0,% % <,( #, $ <<,( > 0,% #% ( - + % ,'3-% & '% #% <,( #, $ <<,(,9 (% +('$ %(- $'$ & " ( (- +' $%(& 2,#. = '%% ($ (- +' $ '%("

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Design at the Register Transfer Level

Design of Sequential Circuits

Chapter 7. Sequential Circuits Registers, Counters, RAM

CSE 241 Digital Systems Spring 2013

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

ALU (3) - Division Algorithms

AN2044 APPLICATION NOTE

Digital Fundamentals

EXPERIMENT Bit Binary Sequential Multiplier

Assembly Programming through Arduino

Digital Signal 2 N Most Significant Bit (MSB) Least. Bit (LSB)

Digital Fundamentals

hexadecimal-to-decimal conversion

The Magic of Negative Numbers in Computers

Mark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

CprE 281: Digital Logic

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2

per chip (approx) 1 SSI (Small Scale Integration) Up to 99

SUMMER 18 EXAMINATION Subject Name: Principles of Digital Techniques Model Answer Subject Code:

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Digital Electronics Final Examination. Part A

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER 14 EXAMINATION Model Answer

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

Digital Electronic Meters

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

PGT104 Digital Electronics. PGT104 Digital Electronics

Stop Watch (System Controller Approach)

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Logic Design II (17.342) Spring Lecture Outline

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

Four Important Number Systems

Vidyalankar S.E. Sem. III [INFT] Analog and Digital Circuits Prelim Question Paper Solution

CHAPTER 7. Exercises 17/ / /2 2 0

89BSD CALCULATION METHOD APPLICATION NOTE

Lecture 13: Sequential Circuits, FSM

YEAR III SEMESTER - V

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

ECE 341. Lecture # 3

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

CPE100: Digital Logic Design I

Digital Electronics Circuits 2017

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

DE58/DC58 LOGIC DESIGN DEC 2014

Number Systems 1(Solutions for Vol 1_Classroom Practice Questions)

Chapter 1: Solutions to Exercises

6.111 Lecture # 12. Binary arithmetic: most operations are familiar Each place in a binary number has value 2 n

CHW 261: Logic Design

CHW 261: Logic Design

Project Two RISC Processor Implementation ECE 485

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Digital Circuits, Binary Numbering, and Logic Gates Cornerstone Electronics Technology and Robotics II

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers*

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Numbers and Arithmetic

of Digital Electronics

Measurement and Instrumentation. Sampling, Digital Devices, and Data Acquisition

CSE 20: Discrete Mathematics

Digital Circuits ECS 371

Logic Theory in Designing of Digital Circuit & Microprocessor

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

ICS 233 Computer Architecture & Assembly Language

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Principles of Digital Techniques

IMPERIAL COLLEGE OF SCIENCE, TECHNOLOGY AND MEDICINE UNIVERSITY OF LONDON DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2005

ENGIN 112 Intro to Electrical and Computer Engineering

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Digital Design through Arduino

Counters. We ll look at different kinds of counters and discuss how to build them

Digital Design. Register Transfer Specification And Design

Exam for Physics 4051, October 31, 2008

Adders, subtractors comparators, multipliers and other ALU elements

Digital Fundamentals

Numbers and Arithmetic

Sample Test Paper - I

A crash course in Digital Logic

Microcontrollers. Fast - Fourier - Transformation. þ additional file AP EXE available

NUMBERS AND CODES CHAPTER Numbers

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Hardware Design I Chap. 4 Representative combinational logic

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

Transcription:

LABORATORY MANUAL S u b j e c t : MICROPROCESSOR AND MICROCONTROLLER TE (E lectr onics) ( S e m V ) 1

I n d e x Serial No T i tl e P a g e N o M i c r o p r o c e s s o r 8 0 8 5 1 8 Bit Addition by Direct Method and Indirect Method 3 2 16 Bit Subtraction 4 3 Block Transfer 5 4 Exchange a Block 6 5 Largest Number in a Given Block 7 6 Arrange Data in Ascending Order 8 7 Conversion of BCD to HEX 9 8 Conversion of HEX to BCD 10 9 Interfacing with DAC 11 10 Interfacing with ADC 12 11 Generate square wave by interfacing 8253 with 8085 13 Microcontroller 8051 12 Addition of 10 Numbers 14 13 Conversion of packed BCD to Unpacked BCD 15 14 Conversion of unpacked BCD to packed BCD 16 15 Generate Square wave 17 A r m LP C 2148 16 Drive LED using LPC 2138 18 17 Drive a Seven Segment Display 19 18 Drive Traffic Light 20 19 Drive DC motor using Arm 21 2

L a b o r a t o r y S e s s i o n 1 T i t l e : O b j e c t i v e : 8 Bit Addition by Direct Method and Indirect Method Addition of two 8 bit numbers stored in memory 1 I n s t r u c t i o n s o f Mi c r o p r o c e s s o r 8 0 8 5 2 Addressing mode of Mi c r o p r o c e s s o r 8 0 8 5 3 F l a g r e g i s t e r o f Mic r o p r o c e s s o r 8 0 8 5 - Ramesh Gaon k a r A l g o r i t h m : Direct Method 1 Get the Number from respective source 2 Get first number in Accumulator 3 Add with second number and store result in memory location along with carry Indirect Method 1 Set the HL as memory pointer to 1 st memory location 2 Load first number into Accumulator 3 Increment the memory pointer to point to the second number 4 Add the two numbers 5 Increment the memory pointer, store result in memory location Post Lab Assignments: 1 List the condition of the flags in the status register after ADD instructions has been executed 2 List some 8085 instructions which are used for addition and storing data 3

L a b o r a t o r y S e s s i o n 2 T i tl e: 16 Bit Subtraction Subtraction of two number stored in memory 1 Instructions of Mi c r o p r o c e s s o r 8 0 8 5 2 Addressing mode of Mi c r o p r o c e s s o r 8 0 8 5 3 F l a g r e g i s t e r o f Mi c r o p r o c e s s o r 8 0 8 5 R e f e r e n c e s: Mi c r o p r o c e s s o r Architecture, programming a n d Application with 8085 A l g o r i t h m : 1 Load the 16 bit number in HL pair 2 Transfer first number in DE registers pair 3 Load second number in HL registers pair 4 Subtract t h e L S B of 1st number from second number 5 Subtract the MSB of 1 s t number from second and consider borrow 6 Store result Post Lab Assignments: 1 List of condition of the flag in the status register after S UB instructions has been executed 2 Some 8085 mnemonics which is used for subtraction and storing a DATA 4

L a b o r a t o r y S e s s i o n 3 T i t l e : Write a program I assembly language to transfer a block of data Accessing two separate memory blocks 1 Instructions of Mi c r o p r o c e s s o r 8 0 8 5 2 Addressing modes o f Mi c r o p r o c e s s o r 8 0 8 5 3 F l a g r e g i s t e r o f Mi c r o p r o c e s s o r 8 0 8 5 1 Load the source and destination address 2 Set count depending on block size 3 Move first number from source to destination block through accumulator 4 Increment the source and destination pointer 5 Decrement the count 5 Check whether count = 0, then stop otherwise go to step 3 5

L a b o r a t o r y S e s s i o n 4 Title : Write a program in assembly language to exchange a block of data Exchanging of data from one memory slot to another memory slot 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 1Set the t w o memory pointers which will point to starting address of respective blocks (1 & 2) 2 Set the counter equal to block size 3 Load the data 1 from block 1 into t e m p Register 1 4 Load the data 1 from block 2 into the accumulator 5 Load accumulator data to starting address of block1 6 Load the data from temp reg1 to the accumulator 7 Load this accumulator data to starting address of 2 n d block 8 Step no 5 and step no 7 exchange the contents of 1 st t w o locations In the respective blocks 9 Increment the two memory pointers 10 Decrement the counter if not zero go to step 3 6

L a b o r a t o r y S e s s i o n 5 T i t l e : Write a program in assembly language to find out a largest of 10 numbers Finding largest number from number stored in memory Pre-Requisites: 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 : 1 Set the memory pointer 2 Set the counter count =10 3 Load the contents of 1 s t location in accumulator 4 Increment the memory pointer 5 Compare the contents of accumulator with next location 6 If A> next location go to step 7 else move contents of next location to the accumulator 7 Increment the memory pointer 8 Decrement the counter, if not equal to zero go to step 5 else increment memory pointer and load the contents of A into memory location(result) Post Lab Assignments: Explain all the conditional branch instructions 7

L a b o r a t o r y S e s s i o n 6 T i t l e : Write a program to arrange the given number in ascending order Arrange the numbers in ascending order stored in the memory 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 1Set the memory pointer 2 Set the count equal to total no of bytes to be compared 3 Use Bubble Sort Algorithm where 1 st largest number is found and stored at the end of the block, then 2 nd largest number pushed to location (n-1) 3 r d largest number stored at location (n-2) and so on for n cycles 8

L a b o r a t o r y S e s s i o n 7 T i t l e : Write a program to convert BCD number into hexadecimal number Conversion of BCD number into hexadecimal number 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Micropr o c e s s o r 8 0 8 5 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 1 Initialize the memory pointer 2 Load first number in accumulator 3 Get the MSB Digit 4 Multiply the most significant digit by 10 5 Add the LSB Digit to Previous Result 9

L a b o r a t o r y S e s s i o n 8 T i t l e : Write a program to convert a hexadecimal number into BCD number Conversion of hexadecimal number into BCD number 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 1 Initialize t h e m e m o ry pointer get the hex number in any one reg(eg C) 2 Compute repeated addition C number of times 3 Adjust the result for BCD in each step 4 Store the result in memory location 10

L a b o r a t o r y S e s s i o n 9 T i t l e : Write a program to interface DAC with 8085 To generate Ramp wave and triangular wave and observe it on the CR,O 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 4 Working of 8255 R amp Waveform 1 Initialize the control word 2 Enable the latch via port pin PB0 3 Clear the accumulator 4 Output the data on port A 5 Increment the accumulator 6 Go to step 4 TRIANGULAR WAVEFORM 1 Initialize the control word 2 Enable the latch via port pin PB0 3 Clear the accumulator 4 Output the data on port A 5 Increment the accumulator 6 Check if accumulator ==ff, if Yes go to step 7 else go to step 4 7 Output the contents on port A 8 Decrement the accumulator 9 Check if accumulators==00, if Yes go to step 4 else go to step 7 11

L a b o r a t o r y S e s s i o n 1 0 T i t l e : Write a program to interface an ADC with 8085 To compute the analog to digital data using an 8085 program and hardware interface 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 4 Working of 8255 1 Initialize the control word 2 Give clock and ALE on port B( CLK==PB2,SOC==PB0) 3 Remove SOC ie SOC =0 4 Check for EOC on port C 5 If EOC = 0, go on checking 6 Give o/p enable pulse (PB1==1) ie Send it is on port B 7 Reads digital data on port A Observations: Note down the digital data readings for analog voltage 0V to 5V In step of 05 12

L a b o r a t o r y S e s s i o n 1 1 T i t l e : Write a program to interface 8254 to generate a square wave To understand the square wave mode of 8253 and its application 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microproces s o r 8 0 8 5 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 4 Working of 8253 1 calculate the count value 2 Load the control word in the control word register (addr==1b) 3 Load the LSB of count value 4Output it at counter (0, 1 or 2) 5 Load the MSB of count value 6 Output it at the counter Observations: Observe the square waveform on the CRO and calculate its frequency 13

L a b o r a t o r y S e s s i o n 1 2 T i t l e : Write a program to add numbers using microcontroller 8051 Add numbers stored in memory 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 5 1 2 Addressing modes of Microprocessor 8051 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 5 1 R e f e r e n c e s: M a z i d i & M a z i d i 8051 P I C & Embedded system using assembly Pearson Education 1Set counter equal to total number of bytes to be added 2 Set the memory pointer 3 Clear Accumulator 4 Add accumulator contents to 1 st location contents 5 Increment memory pointer 6 If carry = 0go to next step 7 Increment register R2 8 Decrement the count if not equal to zero go to step 4 Post Lab Assignments: Explain addressing modes of 8051 and arithmetic instructions of 8051 14

L a b o r a t o r y S e s s i o n 1 3 T i t l e : Write a program to convert packed BCD into unpacked BCD numbers Conversion of packed BCD into unpacked BCD number 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 5 1 2 Addressing modes of Microprocessor 8051 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 5 1 R e f e r e n c e s: M a z i d i & M a z i d i 8051 P I C & Embedded system using assembly Pearson Education 1 Initialize the memory pointer 2 Load the packed BCD into the accumulator and R2 also 3 Mask the lower nibble 3 Swap the nibbles 4 Load this value into the memory location 5 Load the number from R2 into accumulator 6 Mask the upper nibble 7 Load this value into the 2 nd memory location 15

L a b o r a t o r y S e s s i o n 1 4 T i t l e : Write a program to unpack two packed BCD numbers 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 5 1 2 Addressing modes of Microprocessor 8051 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 5 1 R e f e r e n c e s: M a z i d i & M a z i d i 8051 P I C & Embedded system using assembly Pearson Education 1Set the memory pointer 2 Load the 1 s t unpacked BCD number into the accumulator 3 Move accumulator contents to R2 4 Increment the memory pointer 5 Load the 2 n d unpacked BCD number into the accumulator 6 Move R2 to accumulator 7 Swap the nibbles (accumulator) 8 Add accumulator to R1 9 Increment the memory pointer 10 Load accumulator contents to memory location (contains the result ie packed BCD) 16

L a b o r a t o r y S e s s i o n 1 5 T i t l e : T O G E N E R A T E O F 50 % D U T Y CY C L E U S I NG 8 0 51 O b j e c t i v e : Pre-r e q u i s i t es : References: T h e o r y : A l g o r i t h m : a) Understand 8051 Timers modes b ) U s e o f T C O N, T M O D a n d P C O N S F R s t o p r o g r a m t h e T i m e r s f o r a p a r t i c u l a r o v e r f l o w t i m e s c ) W r i t e I S R f o r T i m e r I n t e r r u p t 1 8051 Timer modes 2 SFRs TCON, TMOD, IE PCON definitions 3 ISR locations M a z i d i & M a z i d i 8 0 5 1 P I C & Embedded system using assembly Pearson Education Kenneth Ayala - P e n r a m I n t e r n a t i o n a l ( I I e d i t i o n ) T i m e r Mode 0: Setting timer X mode bits to 00b in the TMOD register results in using the THX register as an 8 - bit counter & TLX as a 5 bit counter; the pulse input is divided by 32d in TL so that TH counts the original oscillator frequency reduced by a total 384d As an example, the 6 MHz oscillator frequency would result in a final frequency to TH of 15625 Hz The timer flag is set whenever THX go from FFh to 00h, or in 0164 seconds for 6 MHz crystal if THX starts at 00h Timer Mode 1: Mode 1 is similar to mode 0 except TLX is configured as a full 8-bit counter when the mode bits are set to 01b in TMOD The timer flag would be set in 01311 seconds using a 6 MHz crystal Timer Mode 2: setting the mode bits to 10b in TMOD configures the timer to use only the TLX counter as an 8 bit counter THX are used to hold a value that is loaded into TLX every time TLX overflow from FFh to 00h The timer flag is also set when TLX overflowsthis mode exhibits an auto reload feature: TLX will count up from the number in THX, overflow and initialized again with the contents of THX Timer Mode 3: timer 0, 1 may be programmed to be in mode 0, 1 or 2 independently of a similar mode for the other timer This is not true for mode 3; the timers do not operate independently if mode 3 is chosen for timer 0 Placing timer 1 in mode 3 cause it to stop counting; the control bit TR1 and the timer 1 flag TF1 are then used by timer 0Timer 0 in mode 3 becomes two completely separate 8 bit counters M ain Pr ogr am 1 TMOD is loaded 2 Load the required count into TH0, TL0 3 Toggle the port P10 4 Call the delay Subroutine using timer 5 Go to step 2 D el a y S u br ou t i n e 1 Start Timer 0 2 Monitor Timer0 flag Till it is set to 1 3 Stop the timer 4 Clear timer 0 flag 5 Return Post Lab Assignments:Explain the counter programming of 8051 17

L a b o r a t o r y S e s s i o n 2 0 T i t l e : O b j e c t i v e : Write a Program to Toggle the LED s Using LPC2138 To understand applications of ARM controller Pre-requisites: a) Understand a r c h i t e c t u r e, p o r t structure of LPC 2138 b ) I n s t r u c t i o n s e t o f L P C 2 1 3 8 R e f e r e n c e : Arm system on chip Architecture 2e Pearson Education Kenneth Ayala - P e n r a m I n t e r n a t i o n a l ( I I e d i t i o n ) A l g o r i t h m : 1 Select the direction output for port 0 2 Set the pot0 3 Call Delay routine 4 Clear the port 0 5 Go to step 2 Post Lab Assignments: Write the features of LPC2138 Explain the register architecture of ARM Explain the ARM processor modes 18

L a b o r a t o r y S e s s i o n 2 1 T i t l e : W r i t e a P r o g r a m t o d r i v e 7 s e g m e n t d i s p l a y u s i n g L P C 2 1 3 8 O b j e c t i v e : To understand applications of ARM controller Pre-r equi si tes: a) Understand a r c h i t e c t u r e, p o r t structure of LPC 2138 b ) I n s t r u c t i o n s e t o f L P C 2 1 3 8 R e f e r e n c e : Arm system on chip Architecture 2e Pearson Education Kenneth Ayala - P e n r a m I n t e r n a t i o n a l ( I I e d i t i o n ) A l g o r i t h m : 1 Select the direction output for port 0 2 Send the sequence to display digit 0 on 7 segment display which is connected to lower 8 pins of port0 3 Call Delay routine 4 Clear the port 0 5 Call Delay routine 6 Similarly send the sequence to display digit 1, 2,3,4,5,6,7,8 and decimal point 19

L a b o r a t o r y S e s s i o n 2 2 T i t l e : Write a Program for Traffic Light C o n t r o l l e r u s i n g L P C 2 1 3 8 O b j e c t i v e : To understand applications of ARM controller Pre-requisites: a) Understand a r c h i t e c t u r e, p o r t structure of LPC 2138 b) I n st r uc t i o n s e t o f L P C 2 1 3 8 R e f e r e n c e : Arm system on chip Architecture 2e Pearson Education Kenneth Ayala - P e n r a m I n t e r n a t i o n a l ( I I e d i t i o n ) A l g o r i t h m : 1 Select the direction output for port 0 2 Send the sequence 1 of Traffic light on port 0 3 Call Delay routine 4 Send the sequence 1 of Traffic light on port 0 5 Call delay routine 6 Send the sequence 2 of Traffic light on port 0 7 Call delay routine 8 Go to step 2 20

L a b o r a t o r y S e s s i o n 2 3 T i t l e : W r i t e a P r o g r a m t o d r i v e D C m o t o r u s i n g L P C 2 1 3 8 O b j e c t i v e : To understand applications of ARM controller Pre-r e q uisites: a) Understand a r c h i t e c t u r e, p o r t structure of LPC 2138 b ) I n s t r u c t i o n s e t o f L P C 2 1 3 8 R e f e r e n c e : Arm system on chip Architecture 2e Pearson Education Kenneth Ayala - P e n r a m I n t e r n a t i o n a l ( I I e d i t i o n ) A l g o r i t h m : 1 Select the direction output for port 0 2 Port pin P00 is connected to stepper motor 4 Set its port pin P00 5 Call delay routine 6 Clear its port pin P00 8 Call delay routine 9 Go to step 4 21

L a b o r a t o r y S e s s i o n 8 Title : Write a program to divide a 16 bit number by 8 bit number and store equivalent Quotient and reminder at different memory locations 1 Instructions of Microp r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 : 1 Get the dividend in HL register pair 2 Get the divisor in accumulator and store it in register C 3 Perform the division by subtracting the divisor from the dividend till the dividend is greater than the divisor 4 Increment quotient every time if the dividend is greater than the divisor when subtraction is performed 5 When the dividend is less than the divisor then the divider is the reminder 22

L a b o r a t o r y S e s s i o n 9 T i t l e : Write a program to convert given BCD numbers into binary equivalent 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 85 1 Initialize HL pair with address 2 Move content of memory to accumulator 3 Move contents of accumulator to register B 23

L a b o r a t o r y S e s s i o n 1 2 Title : Write a program to find number of 1 s from a 8 bit data stored in memory location 1 I n s t r u c t i o n s o f M i c r o p r o c e s s o r 8 0 8 5 2 Addressing modes of Microprocessor 8085 3 F l a g r e g i s t e r o f M i c r o p r o c e s s o r 8 0 8 5 1 Load first number in accumulator 2 3 4 5 Post Lab Assignments: 24

25