Sie sind auf Seite 1von 82

MT6411 – MICROPROCESSOR LABORATORY

FACULTY PREPARATION PROGRAMME

MT 6411

MICROPROCESSOR LABORATARY

II year BE MECHATRONICS – IV semester

RAJALAKSHMI ENGINEERING COLLEGE


Thandalam, Chennai – 602 105

Department of MECHATRONICS, 1
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

TABLE OF CONTENT
S.No Index Page no.

1. Preface for Faculty Preparation Programme 4

2. College Vision & Mission 5

3. Department Vision and Mission 6

4. Program Educational Objectives (PEOs) and Program Outcomes(POs) 7

5. Course Objectives and Course Outcomes 8

6. Syllabus 9

7. Lab Plan 10

8. Addition of two 8 bit numbers using 8085 11

9. Subtraction of two 8 bit numbers using 8085 14

10. Multiplication of two 8 bit numbers using 8085 17


Division of two 8 bit numbers using 8085
11. 23

12. Addition of two 16 bit numbers using 8085 26

13. Subtraction of two 16 bit numbers using 8085 29

14. Ascending order using 8085 microprocessor 33

15. Descending order using 8085 microprocessor 38

16. BCD to Hexadecimal conversion using 8085 microprocessor 43

17. Hexadecimal to BCD conversion using 8085 microprocessor 47

18. Interface DAC converter using 8085 microprocessor 50

19. Interface ADC converter using 8085 microprocessor 54

20. Interface stepper motor using 8051 microcontroller 58

Department of MECHATRONICS, 2
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

CONTENT BEYOND SYLLABUS

21 Interface 8279 display using 8085 microprocessor 69

22 Interfacing 8255 with 8085 71

23 Model Questions 74

24 Viva Question with answers 75

25 APPENDIX 80

26 Opcodes table of INTEL 8085 80

Department of MECHATRONICS, 3
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PREFACE FOR FACULTY PREPARATION PROGRAMME

Subject : MT6411 MICROPROCESSOR I LABORATORY

Degree : Bachelor of Engineering

Year : II year

Semester : IV semester

Academic year : 2016 – 2017

Department of MECHATRONICS, 4
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

RAJALAKSHMI ENGINEERING COLLEGE


THANDALAM, CHENNAI – 602 105.
Affiliated to Anna University, Chennai
Approved by AICTE, Accredited By NBA & NAAC
ISO 9001: 2008 CERTIFIED

MISSION AND VISION OF THE INSTITUTION


VISION
To be an institution of excellence in Engineering, Technology and Management,
Education & Research. To provide competent and ethical professionals with a concern for
society..
MISSION
To impart quality technical education imbibed with proficiency and humane values.
To provide right ambience and opportunities for the students to develop into creative,
talented and globally competent professionals. To promote research and development in
technology and management for the benefit of the society.

Department of MECHATRONICS, 5
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

RAJALAKSHMI ENGINEERING COLLEGE


THANDALAM, CHENNAI – 602 105.
Affiliated to Anna university, Chennai
Approved by AICTE, Accredited By NBA & NAAC

DEPARTMENT OF MECHATRONICS ENGINEERING


VISION
“To be a globally competent renowned School of Engineering in Mechatronics”
MISSION
To impart high quality professional education and produce Mechatronics Engineers with all
round knowledge of multi-disciplinary branches of engineering and technology.
To foster skill sets required to be a global professional in the areas of intelligent systems,
robotics, research and technology management and to fulfil the expectations of industry and
needs of the society.
To inculcate entrepreneurial qualities for creating, developing and managing global
engineering ventures

PROGRAMME EDUCATIONAL OBJECTIVES (PEOS):


PEO I
Graduates will have comprehensive knowledge in the analytical, scientific and
engineering fundamentals necessary to model, analyze and solve engineering problems and to
prepare them for graduate studies and for successful careers in industry.
PEO II
Graduates will effectively design and develop products in the areas such as
manufacturing, motion Control, Machine vision, system simulation, intelligent systems,
Automotive Systems and Robotics.
PEO III
Graduates will acquire Technical expertise, Leadership skills, Ethical practices and
Team spirit with a concern towards society.

Department of MECHATRONICS, 6
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAMME OUTCOMES
(a) Graduates will demonstrate basic knowledge in mathematics, science and engineering.
(b) Graduates will demonstrate the ability to design and conduct experiments, interpret and
analyze data, and report results.
(c) Graduates will demonstrate the ability to design or model or simulate or implement a
mechatronics system or a process that meets desired specifications and requirements.
(d) Graduates will demonstrate the ability to function on engineering and science laboratory
teams, as well as on multidisciplinary design teams.
(e) Graduates will demonstrate the ability to identify, formulate and solve mechatronics
engineering problems.
(f) Graduates will demonstrate an understanding of their professional and ethical
responsibilities.
(g) Graduates will be able to communicate effectively in both verbal and written forms to
enhance their opportunities to build a successful career.
(h) Graduates will have the confidence to apply engineering solutions in global and societal
contexts.
(i) Graduates should be capable of self-education and clearly understand the value of lifelong
learning.
(j) Graduates will be broadly educated and will have an understanding of the impact of
engineering on society and demonstrate awareness of contemporary issues.
(k) Graduates will be familiar with modern engineering software tools and equipment to
analyze mechatronics engineering problems.
(l) Graduates will be exposed to industrial practices and acquire the ability to serve in the
core engineering industry.

Department of MECHATRONICS, 7
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

COURSE NAME COURSE OBJECTIVE COURSE OUTCOMES


 To get a basic knowledge in  Student will be able to write the
writing the assembly assembly language programs by
language for 8 bit arithmetic using various addressing modes
operations using 8085
for arithmetic operations in
microprocessor.
8085 microprocessor.

 To get an overview on the  Student will be able to convert


assembly language program the ASCII to Hexadecimal and
coding for code vise-versa and finding largest
conversions, sorting and and smallest number in a given
some other logics. array of numbers.

 To get a basic knowledge in  Student will be able to write the


writing the assembly assembly language programs by
MICROPROCESSOR
language for multibyte using various addressing modes
LABORATORY
arithmetic operations using
for multibyte arithmetic
8085.
operations.

 To provide a knowledge on  Student will be able to interface


interfacing for conversion of various peripherals like,analog
signals. to digital convertor and digital
to analog convertor with 8085
microprocessor.

 To expose a practical  Student will be able to interface


knowledge on interfacing peripherals like stepper motor,
8085 with temperature, Temperature controller.
stepper motor controller.

Department of MECHATRONICS, 8
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

MT6411 MICROPROCESSOR LABORATORY


LT P C
0032

OBJECTIVES:

To expose the students to microprocessor and trvia them to perform simple


programming
To provide knowledge on interfacing.

LIST OF EXPERIMENTS:

I PROGRAMMING
1. Addition of two 8 – bit numbers, sum of 8 – bits and 16 bits.
2. Decimal addition of two 8 – bit numbers Sum: 16 bits.
3. 8 - bit subtraction.
4. 8 – bit decimal subtraction.
5. Additional of two 16 – bit numbers, Sum: 16 bits or more.
6. Multibyte subtraction.
7. To arrange a series of numbers in Ascending order.
8. To arrange a series of numbers in Descending order.
9. 8 – bit Multiplication.
10. 8 – bit Division.
11. Decimal to hexadecimal conversion and hexadecimal to decimal number
conversion.
II. INTERFACING
12. Analog to digital conversion.
13. Digital to analog conversion.
14. Steeper motor controller.
15. Temperature controller.

TOTAL: 45 PERIODS

Department of MECHATRONICS, 9
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

LAB PLAN

CYCLE I
1. Addition of two 8 – bit numbers, sum of 8 – bits and 16 bits.
2. Decimal addition of two 8 – bit numbers Sum: 16 bits.
3. 8 - bit subtraction.
4. 8 – bit decimal subtraction.
5. Additional of two 16 – bit numbers, Sum: 16 bits or more.
6. Multibyte subtraction.
7. To arrange a series of numbers in Ascending order.
8. To arrange a series of numbers in Descending order.
9. 8 – bit Multiplication.
10. 8 – bit Division.
11. Decimal to hexadecimal conversion and hexadecimal to decimal number
conversion.

CYCLE II
1. Analog to digital conversion.
2. Digital to analog conversion.
3. Steeper motor controller.
4. Temperature controller.

Department of MECHATRONICS, 10
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.:1
Date :

ADDITION OF TWO 8 BIT NUMBERS USING 8085

AIM:

To add two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the first number from memory in accumulator.
3. Get the second number and add it to the accumulator.
4. Store the answer at another memory location.

CALCULATION:

Department of MECHATRONICS, 11
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:

START

[C] 00H

[HL] 8200H

[A] [M]

[HL] [HL]+1

[A] [A]+[M]

Is there a NO
Carry ?

YES

[C] [C]+1

[HL] [HL]+1

[M] [A]

[HL] [HL]+1

[M] [C]

STOP

Department of MECHATRONICS, 12
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


8100 START MVI C, 00
Clear C reg.
8101
8102 LXI H, 8200
Initialize HL reg. to
8103
4500
8104
Transfer first data to
8105 MOV A, M
accumulator
Increment HL reg. to
8106 INX H point next memory
Location.
Add first number to
8107 ADD M
acc. Content.
8108 JNC L1 Jump to location if
8109 result does not yield
810A carry.
810B INR C Increment C reg.
Increment HL reg. to
810C L1 INX H point next memory
Location.
Transfer the result from
810D MOV M, A
acc. to memory.
Increment HL reg. to
810E INX H point next memory
Location.
810F MOV M, C Move carry to memory
8110 RST 1 Stop the program

OBSERVATION:

WITHOUT CARRY WITH CARRY


INPUT OUTPUT INPUT OUTPUT
8200 8202 8200 8202
8201 8203 8201 8203

RESULT:

Thus the 8 bit numbers stored at 8200 &8201 are added and the result stored at 8202
& 8203 using 8085 microprocessor.

Department of MECHATRONICS, 13
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 2
Date :

SUBTRACTION OF TWO 8 BIT NUMBERS USING 8085

AIM:

To subtract two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the first number from memory in accumulator.
3. Get the second number and subtract from the accumulator.
4. If the result yields a borrow, the content of the acc. is complemented and 01H is
added to it (2’s complement). A register is cleared and the content of that reg. is
incremented in case there is a borrow. If there is no borrow the content of the acc. is
directly taken as the result.
5. Store the answer at next memory location.

Department of MECHATRONICS, 14
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:
START

[C] 00H

[HL] 8200H

[A] [M]

[HL] [HL]+1

[A] [A]-[M]

Is there a NO
Borrow ?

YES
Complement [A]
Add 01H to [A]

[C] [C]+1

[HL] [HL]+1

[M] [A]

[HL] [HL]+1

[M] [C]

STOP

Department of MECHATRONICS, 15
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


8100 START MVI C, 00
Clear C reg.
8101
8102 LXI H, 8200
Initialize HL reg. to
8103
4500
8104
Transfer first data to
8105 MOV A, M
accumulator
Increment HL reg. to
8106 INX H point next mem.
Location.
Subtract first number
8107 SUB M
from acc. Content.
8108 JNC L1 Jump to location if
8109 result does not yield
810A borrow.
810B INR C Increment C reg.
Complement the Acc.
810C CMA
content
810D ADI 01H Add 01H to content of
810E acc.
Increment HL reg. to
810F L1 INX H point next mem.
Location.
Transfer the result from
8110 MOV M, A
acc. to memory.
Increment HL reg. to
8111 INX H point next mem.
Location.
8112 MOV M, C Move carry to mem.
8113 RST 1 Stop the program

Department of MECHATRONICS, 16
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

OBSERVATION:

WITHOUT CARRY WITH CARRY


INPUT OUTPUT INPUT OUTPUT
8200 8202 8200 8202
8201 8203 8201 8203

CALCULATION:

RESULT:

Thus the 8 bit numbers stored at 4500 &4501 are subtracted and the result stored at
4502 & 4503.

Department of MECHATRONICS, 17
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 3
Date :

MULTIPLICATION OF TWO 8 BIT NUMBERS USING 8085

AIM:

To multiply two 8 bit numbers stored at consecutive memory locations and store the
result in memory using 8085 microprocessor.

ALGORITHM:

LOGIC: Multiplication can be done by repeated addition.

1. Initialize memory pointer to data location.


2. Move multiplicand to a register.
3. Move the multiplier to another register.
4. Clear the accumulator.
5. Add multiplicand to accumulator
6. Decrement multiplier
7. Repeat step 5 till multiplier comes to zero.
8. The result, which is in the accumulator, is stored in a memory location.

Department of MECHATRONICS, 18
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:

START

[HL] 4500

B M

[HL]  [HL]+1

A  00

C  00

[A]  [A] +[M]

Is there NO
any carry

YES
C  C+1

B  B-1

NO
IS B=0

YES

Department of MECHATRONICS, 19
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

[HL] [HL]+1

[M] [A]

[HL] [HL]+1

[M] [C]

STOP

Department of MECHATRONICS, 20
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


8100 START LXI H, 8200 Initialize HL reg. to
8101 4500
8102
Transfer first data to
8103 MOV B, M reg. B
Increment HL reg. to
8104 INX H point next mem.
Location.
8105 MVI A, 00H Clear the acc.
8106
8107 MVI C, 00H Clear C reg for carry
8108
Add multiplicand
8109 L1 ADD M
multiplier times.
810A JNC NEXT
Jump to NEXT if there
810B
is no carry
810C
810D INR C Increment C reg
810E NEXT DCR B Decrement B reg
810F JNZ L1
Jump to L1 if B is not
8110
zero.
8111
Increment HL reg. to
8112 INX H point next mem.
Location.
Transfer the result from
8113 MOV M, A
acc. to memory.
Increment HL reg. to
8114 INX H point next mem.
Location.
Transfer the result from
8115 MOV M, C
C reg. to memory.
8116 RST 1 Stop the program

Department of MECHATRONICS, 21
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

OBSERVATION:

INPUT OUTPUT
8200 8202
8201 8203

CALCULATION:

RESULT:

Thus the 8-bit multiplication was done in 8085p using repeated addition method.

Department of MECHATRONICS, 22
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No. : 4
Date :

DIVISION OF TWO 8 BIT NUMBERS USING 8085

AIM:

To divide two 8-bit numbers and store the result in memory using 8085
microprocessor.

ALGORITHM:

LOGIC: Division is done using the method Repeated subtraction.


1. Load Divisor and Dividend
2. Subtract divisor from dividend
3. Count the number of times of subtraction which equals the quotient
4. Stop subtraction when the dividend is less than the divisor .The dividend now
becomes the remainder. Otherwise go to step 2.
5. stop the program execution.

CALCULATION:

Department of MECHATRONICS, 23
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOWCHART:
Start

Initialize B=00H and initialize memory


pointer

Move the content of memory to acc.


Increment the memory pointer

Compare Acc. with content of memory

YES
If
carry=1

NO
A=A-M
B=B+1

Increment memory pointer by one and


copy the content of acc. to memory

Increment memory pointer by one and


copy the content of B reg. to memory

Stop

Department of MECHATRONICS, 24
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

MNEMO OPERA
ADDRESS OPCODE LABEL COMMENTS
NICS ND
8100 MVI B,00
Clear B reg for quotient
8101
8102 LXI H,8200
Initialize HL reg. to
8103
8200H
8104
8105 MOV A,M Transfer dividend to acc.
Increment HL reg. to point
8106 INX H
next mem. Location.
8107 LOOP2 CMP M Subtract divisor from dividend
8108 JC LOOP1
Jump to LOOP if result does
8109
yield borrow
810A
Subtract the content of
810B SUB M
memory location from acc.
810C INR B Increment B reg.
810D JMP LOOP2
810E Jump to LOOP2
810F
Increment HL reg. to point
8110 LOOP1 INX H
next mem. Location.
Transfer the remainder from
8111 MOV M,A
acc. to memory.
Increment HL reg. to point
8112 INX H
next mem. Location.
Transfer the quotient from B
8113 MOV M,B
reg. to memory.
8114 RST 1 Stop the program

OBSERVATION:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8200 8202
8201 8203

RESULT:

Thus an ALP was written for 8-bit division using repeated subtraction method and
executed using 8085 p kits.

Department of MECHATRONICS, 25
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No. : 5
Date :

ADDITION OF TWO 16 BIT NUMBERS USING 8085

AIM:

To add two 16-bit numbers stored at consecutive memory locations using 8085
microprocessor.

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the first number from memory and store in Register pair.
3. Get the second number in memory and add it to the Register pair.
4. Store the sum & carry in separate memory locations.

CALCULATION:

Department of MECHATRONICS, 26
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:
START

[L] [8050 H]
[H] [8051 H]

[DE] [HL]

[L] [8052H]
[H] [8053H]

[A] 00H

[HL] [HL]+[DE]

NO
Is there a
Carry?

YES
[A] [A]+1

[8054] [ L]

[8055] [H]

[8056] [A]

STOP

Department of MECHATRONICS, 27
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


8100 START LHLD 8050H
8101 Load the augend in DE
8102 pair through HL pair.
8103 XCHG
8104 LHLD 8052H
Load the addend in HL
8105
pair.
8106
8107 MVI A, 00H Initialize reg. A for
8108 carry
Add the contents of HL
8109 DAD D Pair with that of DE
pair.
810A JNC LOOP If there is no carry, go
810B to the instruction
810C labeled LOOP.
Otherwise increment
810D INR A
reg. A
810E LOOP SHLD 8054H Store the content of HL
810F Pair in 8054H(LSB of
8110 sum)
8111 STA 8056H Store the carry in
8112 8056H through Acc.
8113 (MSB of sum).
8114 RST 1 Stop the program.

OBSERVATION:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8050H 8054H
8051H 8055H
8052H 8056H
8053H

RESULT:

Thus an ALP program for 16-bit addition was written and executed in 8085p using
special instructions.

Department of MECHATRONICS, 28
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.:6
Date :

SUBTRACTION OF TWO 16 BIT NUMBERS USING 8085

AIM:

To subtract two 16-bit numbers stored at consecutive memory locations using 8085
microprocessor.

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the subtrahend from memory and transfer it to register pair.
3. Get the minuend from memory and store it in another register pair.
4. Subtract subtrahend from minuend.
5. Store the difference and borrow in different memory locations.

Department of MECHATRONICS, 29
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:

START

[L] [8050 H]
[H] [8051 H]

[DE] [HL]

[L] [8052H]
[H] [8053H]

[HL] [HL]-[DE]

Is there a NO
borrow?

YES
[C] [C]+1

[8054] [ L]

[8055] [H]

[8056] [C]

STOP

Department of MECHATRONICS, 30
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

MNEMO OPER
ADDRESS OPCODE LABEL COMMENTS
NICS AND
8100 START MVI C, 00
Initialize C reg.
8101
8102 LHLD 8050H
Load the subtrahend in DE
8103
reg. Pair through HL reg.
8104
pair.
8105 XCHG
8106 LHLD 8052H
Load the minuend in HL reg.
8107
Pair.
8108
Move the content of reg. L to
8109 MOV A, L
Acc.
Subtract the content of reg.
810A SUB E
E from that of acc.
Move the content of Acc. to
810B MOV L, A
reg. L
Move the content of reg. H
810C MOV A, H
to Acc.
Subtract content of reg. D
810D SBB D
with that of Acc.
Transfer content of acc. to
810E MOV H, A
reg. H
810F SHLD 8054H
Store the content of HL pair
8110
in memory location 8504H.
8111
8112 JNC NEXT
If there is borrow, go to the
8113
instruction labeled NEXT.
8114
8115 INR C Increment reg. C
Transfer the content of reg. C
8116 NEXT MOV A, C
to Acc.
8117 STA 8056H
Store the content of acc. to
8118
the memory location 8506H
8119
811A RST 1 Stop the program execution.

Department of MECHATRONICS, 31
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

OBSERVATION:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8050H 8054H
8051H 8055H
8052H 8056H
8053H

CALCULATION:

RESULT:

Thus an ALP program for subtracting two 16-bit numbers was written and executed using
8085 microprocessor.

Department of MECHATRONICS, 32
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No. :7
Date :

ASCENDING ORDER USING 8085 MICROPROCESSOR


AIM:
To sort the given number in the ascending order using 8085 microprocessor.

ALGORITHM:

1. Get the numbers to be sorted from the memory locations.


2. Compare the first two numbers and if the first number is larger than second then
interchange the number.
3. If the first number is smaller, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order

Department of MECHATRONICS, 33
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOWCHART:
START

[B]  04H

[HL]  [8100H]

[C]  04H

[A]  [HL]

[HL  [HL] + 1

YES IS
[A] < [HL]?

NO

[D] [HL]

[HL]  [A]

[HL]  [HL] - 1

[HL]  [D]

[HL]  [HL] + 1

[C]  [C] – 01 H

Department of MECHATRONICS, 34
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

IS NO
[C] = 0?

YES
[B]  [B]-1

IS NO
[B] = 0?

YES

STOP

Department of MECHATRONICS, 35
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDR OPCO LABEL MNEM OPER COMMENTS


E DE ONICS AND
SS
8100 MVI B,04 Initialize B reg with number
8101 of comparisons (n-1)
8102 LOOP 3 LXI H,8200 Initialize HL reg. to
8103 8100H
8104
8105 MVI C,04 Initialize C reg with no. of
8106 comparisons(n-1)
8107 LOOP2 MOV A,M Transfer first data to acc.
8108 INX H Increment HL reg. to point
next memory location
8109 CMP M Compare M & A
810A JC LOOP1 If A is less than M then go to
810B loop1
810C
810D MOV D,M Transfer data from M to D reg
810E MOV M,A Transfer data from acc to M
810F DCX H Decrement HL pair
8110 MOV M,D Transfer data from D to M
8111 INX H Increment HL pair
8112 LOOP1 DCR C Decrement C reg
8113 JNZ LOOP2 If C is not zero go to loop2
8114
8115
8116 DCR B Decrement B reg
8117 JNZ LOOP3 If B is not Zero go to loop3
8118
8119
811A RST 1 Stop the program

Department of MECHATRONICS, 36
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

OBSERVATION:

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
8200 8200
8201 8201
8202 8202
8203 8203
8204 8204

RESULT:

Thus the ascending order program is executed and thus the numbers are arranged in
ascending order using 8085 microprocessor.

Department of MECHATRONICS, 37
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 8
Date :

DESCENDING ORDER USING 8085 MICROPROCESSOR

AIM:
To sort the given number in the descending order using 8085 microprocessor.

ALGORITHM:

1. Get the numbers to be sorted from the memory locations.


2. Compare the first two numbers and if the first number is larger than second then
interchange the number.
3. If the first number is larger, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order.

Department of MECHATRONICS, 38
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOWCHART:
START

[B]  04H

[HL]  [8100H]

[C]  04H

[A]  [HL]

[HL  [HL] + 1

NO IS
[A] < [HL]?

YES

[D] [HL]

[HL]  [A]

[HL]  [HL] - 1

[HL]  [D]

[HL]  [HL] + 1

[C]  [C] – 01 H

Department of MECHATRONICS, 39
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

IS NO
[C] = 0?

YES
[B]  [B]-1

IS NO
[B] = 0?

YES

STOP

Department of MECHATRONICS, 40
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRE OPCO LABEL MNEM OPER COMMENTS


SS DE ONICS AND
8100 MVI B,04 Initialize B reg with number
8101 of comparisons (n-1)
8102 LOOP 3 LXI H,8200 Initialize HL reg. to
8103 8100H
8104
8105 MVI C,04 Initialize C reg with no. of
8106 comparisons(n-1)
8107 LOOP2 MOV A,M Transfer first data to acc.
8108 INX H Increment HL reg. to point
next memory location
8109 CMP M Compare M & A
810A JNC LOOP1 If A is greater than M then go
810B to loop1
810C
810D MOV D,M Transfer data from M to D reg
810E MOV M,A Transfer data from acc to M
810F DCX H Decrement HL pair
8110 MOV M,D Transfer data from D to M
8111 INX H Increment HL pair
8112 LOOP1 DCR C Decrement C reg
8113 JNZ LOOP2 If C is not zero go to loop2
8114
8115
8116 DCR B Decrement B reg
8117 JNZ LOOP3 If B is not Zero go to loop3
8118
8119
811A RST 1 Stop the program

Department of MECHATRONICS, 41
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

OBSERVATION:

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
8200 8200
8201 8201
8202 8202
8203 8203
8204 8204

RESULT:

Thus the descending order program is executed and thus the numbers are arranged in
descending order using 8085 microprocessor.

Department of MECHATRONICS, 42
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 9
Date :

BCD TO HEXADECIMAL CONVERSION USING 8085


MICROPROCESSOR

AIM:

To convert a BCD number in memory to equivalent hex number using 8085


microprocessor.

ALGORITHM:

1. Initialize memory pointer to 8200H.


2. Get the most significant bit.
3. Multiply MSD by ten using repeated addition.
4. Add the least significant bit to result obtained in previous step.
5. Store hex data in memory.
6. Stop.

Department of MECHATRONICS, 43
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOW CHART:

START

[HL] 4500

B M

[HL]  [HL]+1

A  00

C  00

[A]  [A] +[M]

Is there NO
any carry

YES
C  C+1

B  B-1

NO
IS B=0

YES

Department of MECHATRONICS, 44
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

[HL] [HL]+1

[M] [A]

[HL] [HL]+1

[M] [C]

STOP

Department of MECHATRONICS, 45
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


8100 LXI H,8200 Initialise memory
pointer
8101
8102
8103 MOV A,M Copy the content of
memory to acc
8104 ADD A MSB X 2
8105 MOV B,A Store MSB X 2
8106 ADD A MSB X 4
8107 ADD A MSB X 8
8108 ADD B MSB X 10
8109 INX H Point to LSB
810A ADD M Add the acc with
memory content
810B INX H Increment memory
pointer
810C MOV M,A Copy to memory
810D RST 1 Stop

OBSERVATION:

INPUT OUTPUT
8200 01 (MSB) 8202 0A H (HEX)
8201 00 (LSB)

RESULT:

Thus BCD to HEX conversion is done by 8085 microprocessor kit.

Department of MECHATRONICS, 46
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 10
Date :

HEXADECIMAL TO BCD USING 8085 MICROPROCESSOR

AIM:

To convert a HEX number into equivalent BCD number in memory by 8085


microprocessor.

ALGORITHM:

1. Initialize memory pointer to 8200H.


2. Get the hexadecimal number in C register.
3. Perform repeated addition for C number of times.
4. Adjust BCD in each step.
5. Store BCD data in memory.
6. Stop.

Department of MECHATRONICS, 47
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

FLOWCHART:
START

B  00

[HL] 4500

A M

[HL]  [HL]+1

M  A-M

[B]  [B] +1

IS A<0

A  A+ M

B  B-1

[HL] [HL]+1

[M] [A]

[HL] [HL]+1

[M] [B]

STOP

Department of MECHATRONICS, 48
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRESS OPCODE LABEL MNEMO OPERA COMMENTS


NICS ND
8100 LXI H,8200 Initialise memory pointer
8101
8102
8103 MVI D,00 Clear D register for MSB
8104
8105 XRA A Clear accumulator
8106 MOV C,M Copy the memory content to C
reg.
8107 L2 ADI 01 Count no. one by one
8108
8109 DAA Adjust BCD count
810A JNC L1 Jump to loop1
810B
810C
810D INR D Increment D reg.
810E L1 DCR C Decrement C reg.
810F JNZ L2 Jump to loop2 if Z=0
8110
8111
8112 STA 8201 Store LSB
8113
8114
8115 MOV A,D Copy content of D reg to acc
8116 STA 8202 Store MSB
8117
8118
8119 RST 1 Stop the program

OBSERVATION:

INPUT OUTPUT

8200 8201
8202

RESULT:

Thus hexadecimal to BCD conversion using 8085 microprocessor is done and the
output is obtained.

Department of MECHATRONICS, 49
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. No.: 11
Date:

ANALOG TO DIGITAL CONVERSION INTERFACING USING 8085


MICROPROCESSOR
Aim:
To perform analog to digital conversion interfacing by writing an assembly level
program 8058 microprocessor

Algorithm:
1. Initialize the control word for port A as input, port B and port C as output.
2. Send it in Control Register.
3. Select input for Multiplexer.
4. Port C is enabled for Start of Conversion.
5. Call the delay subroutine.
6. Read the input from Port A at End of Conversion.
7. End the program.

Flowchart:
START

Initialize the control word for port A as


input, port B and port C as output

Send it in Control Register

Select input for Multiplexer

Port C is enabled for Start of


Conversion

Call the delay subroutine

Read the input from Port A at End of Conversion

STOP

Department of MECHATRONICS, 50
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Subroutine:
Move 0F in B

Move FF in A

Delay time period

Decrement A

Yes
If
No zero
No

Decrement B

Yes
If
No zero
No

Return

Department of MECHATRONICS, 51
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Program:

ADDRE HEX LABEL OPCODE OPER COMMENTS


SS CO AND
DE
9000 MVI A,90 Move immediate data 90 to A
9001
9002 OUT 23 Out data in A to 23
9003
9004 MVI A, 01 Move immediate data 01 to A
9005
9006 OUT 21 Out data in A to 21
9007
9008 MVI A, FF Move immediate data FF to A
9009
900A OUT 22 Out byte in A 22
900B
900C MVI A, FF Move immediate data FF to A
900D
900E OUT 22 Out byte in A to 22
900F
9010 CALL 9100 CALL subroutine at 9100
9011
9012
9013 IN 20 Pot byte in 20 to A
9014
9015 RST 1 Reset
9100 MVI B,0F Move immediate
9101
9102 MVI A, FF Move immediate data FF to A
9103
9104 NOP No operation
9105 NOP No operation
9106 DCR A Decrement A
9107 JNZ 9104 Jump on zero to 9104
9108
9109
910A DCR B Decrement B
910B JNZ 9102 Jump on no-zero to 9102
910C
910D
910E RET Return to main program

Department of MECHATRONICS, 52
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Result:

Thus, an assembly level program was implemented to perform ADC interfacing


using 8085.

Department of MECHATRONICS, 53
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Exp.No: 12
Date:

DIGITAL TO ANALOG CONVERSION INTERFACING USING 8085


MICROPROCESSOR

Aim:
To develop a program to interface digital to analog conversion using 8085
microprocessor using its assembly level language program.

Apparatus Required:

1. Microprocessor kit
2. DAC kit
3. Key board
4. Power chord

Algorithm:

1. Initialize the control word for port A as input, port B and port C as output.
2. Send it in Control Register.
3. Move the peak value FF and low value 00 into accumulator
4. Call the delay subroutine
5. Display the operation.
6. End the program.

Subroutine:

1. Move the data into B-Reg. and


2. Get the data and move into accumulator.
3. Create the delay
4. Decrement the data in accumulator by one
5. If A=0, then decrement the data in B register by one else go to step 3
6. If B=0, Jump to step 2 else step 7.
7. Return to main program.

Calculation:

Department of MECHATRONICS, 54
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Flowchart:

Start

Initialize the Ports

Load the ACC with value for


obtaining analog equivalent

Call the subroutine

Display the operation

Stop

Subroutine:
Move the data to B-Register

Move the data accumulator

Create the delay

Decrement accumulator by one

If
Yes A=0

Decrement B register by one

No
Yes
If
B=0
No

Return to the main program

Department of MECHATRONICS, 55
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRE HEX LABEL OPCODE OPERAND COMMENTS


SS CODE
8100 3E MVI A,80 Move immediate
8101 80 80 to ACC
8102 D3 OUT 23 Display the output
8103 23
8104 3E LOOP1 MVI A,FF Move immediate FF into
ACC
8105 FF
8106 D3 OUT 21 Display the output port
8107 21
8108 CD CALL 9123 Call the delay subroutine
8109 23
810A 91
810B 3E MVI A,00 Move immediate 00 into ACC
810C 00
810D D3 OUT 21 Display the output
810E 21
810F CD CALL 9123 Call the delay subroutine
8110 23
8111 91
8112 C3 JMP 8104 Jump to 8104
8113 04
8114 81
9123 SUBRO MVI B,10 Move immediate 10 to B-Reg.
UTINE
9124 2F
9125 10 LOOP 2 MVI A, FF Move immediate 10 to A-Reg
9126 0E
9127 FF LOOP1 NOP No operation
9128 00 NOP No operation
9129 00 NOP No operation
912A 00 NOP No operation
912B 00 DCR A Decrement ACC by 1
912C 3D JNZ 9127 Jump on not Zero to 9127
912D C2
912E 27
912F 91 DCR B Decrement B Reg. by 1
9130 0B JNZ 9125 Jump on not zero to 9125
9131 C2
9132 25
9133 91 RET Return
C9

Department of MECHATRONICS, 56
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

RESULT:
Thus digital to analog interfacing is implemented using 8085 microprocessor.

Department of MECHATRONICS, 57
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Exp.No: 13
Date:

STEPPER MOTOR INTERFACING USING 8085 MICROPROCESSOR

Aim:
To implement an assembly language program for interfacing stepper motor using
8085 microprocessor.

Apparatus Required:

1. Microprocessor kit
2. Key board
3. Power chord
4. Stepper motor & kit

Algorithm:

1. Start the Program


2. Initialize the ports.
3. Load the step sequence values.
4. Output the data in sequence.
5. Call the delay subroutine.
6. Repeat the STEP 3 & 4 with immediate data’s.
7. Stop the program.

Department of MECHATRONICS, 58
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Flowchart:

Start

Initialize the ports

Set value for stepping sequence1 A

Output the data sequence 1

Call delay B

Set value for stepping sequence2

Output the data sequence 2

Call delay B

Set value for stepping sequence 3

Output the data sequence 3

Call delay B

Set value for stepping sequence 4

Output the data sequence 4

Call delay B

Department of MECHATRONICS, 59
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Subroutine:

Initialize B with 10

Load A with FF

Delay Time period

Decrement A

If NO
A=0

YES

Decrement B-Reg.

If NO
B=0

YES
B

Department of MECHATRONICS, 60
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Program:

ADDRE HEX LABEL OPCO OPER COMMENTS


SS CODE DE AND
9000 MVI A,80 Move immediate data 80 into
ACC
9001
9002 OUT 23 Out the value of A to 23
9003
9004 LOOP1 MVI A,05 Move immediate data 05 into
ACC
9005
9006 OUT 20 Out the value of A to 20
9007
9008 CALL 9023 Call to the subroutine to 9023
9009
900A
900B MVI A,07 Move immediate data 07 into
ACC
900C
900D OUT 20 Out the value of A to 20
900E
900F CALL 9023 Call to the subroutine to 9023
9010
9011
9012 MVI A,06 Move immediate data 06 into
ACC
9013
9014 OUT 20 Out the value of A to 20
9015
9016 CALL 9023 Call to the subroutine to 9023
9017
9018
9019 MVI A,04 Move immediate data 04 into
ACC
901A
901B OUT 20 Out the value of A to 20
901C
901D CALL 9023 Call to the subroutine to 9023
901E
901F
9020 JMP 9004 Jump into 9004
9021
9022

Department of MECHATRONICS, 61
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

ADDRE HEXCO LABEL OP CODE OPER COMMENTS


SS DE AND
SUBROUTINE
9023 MVI B,10 Move immediately data 10 to
B
9024
9025 MVI A,FF Move immediately data FF to
ACC
9026
9027 NOP No operation
9028 NOP No operation
9029 NOP No operation
902A NOP No operation
902B DCR A Decrement A by 1
902C JNZ 9027 Jump on no zero to 9027
902D
902E
902F DCR B Decrement B by 1
9030 JNZ 9025 Jump on not zero
9031
9032
9033 RET Return

Result:

Thus an assembly level language program is implemented to interface the stepper


motor into 8085 microprocessor to rotate in either direction.

Department of MECHATRONICS, 62
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. no.: 14

Date

TEMPERATURE CONTROLLER USING 8085

Aim:
To interface temperature controller with 8085 microprocessor.

Apparatus Required:
1.8085 kit
2.Temperature controller kit

Theory:
Temperature measurement is used in variety of applications like furnace, water bath,
oven, etc. with the help of transducers like thermocouple.The output of thermocouple is
proportional to temperature which is in milliVolts. Therefore to drive further stages of
system, this signal is amplified using instrumentation amplifier. The amplified output is fed
to channel 3 of ADC and 8085 provides High to Low SOC and ALE signal. When ADC
completes the conversion, 8085 reads the equivalent digital data from Port A which is the
current value of temperature of object. This value of measured temperature is then sent to
display system. For measuring temperature of furnace, water bath, etc. 8085 1st measures
current temperature (t1) and compares with the reference temperature (T1) at which the
temperature is to be kept constant.If the measure temperature (t1) is greater than reference
temperature (T1) then 8085 sends control signal to the transistorized relay circuit through
Port B and turns OFF the heating process to maintain temperature at desired level. If the
measure temperature (t1) is less than reference temperature (T1) then 8085 sends control
signal to the transistorized relay circuit through Port B and turns ON the heating process to
maintain temperature at desired level, thus maintaining the temperature of furnace, bath tub,
etc.

Department of MECHATRONICS, 63
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Chips select Logic:

Control word Format:

=98H

Data for channel selection:

=0BH (SOC= HIGH)

Department of MECHATRONICS, 64
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

=03H (SOC= LOW)

Data for turning Heater ON/OFF:

=00H (Heater OFF)

=01H (Heater ON)

Program:

Department of MECHATRONICS, 65
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Department of MECHATRONICS, 66
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Department of MECHATRONICS, 67
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

RESULT:
Thus temperature controller is interfaced with 8085 and its characteristics was
studied.

Department of MECHATRONICS, 68
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Exp. No: 15
Date:

8279 INTERFACING USING 8085 MICROPROCESSOR

Aim:

To implement an assembly level program using 8085 Microprocessor for 8279


Interfacing.

Apparatus Required:

1. Keyboard
2. Power Chord
3. Microprocessor Kit
4. 8279 Interfacing kit.

Algorithm:

1. Start the Program


2. Select the 7 segment code to display by using a suitable control word to the
display select port.
3. Send the hexadecimal code to the data port.
4. Introduce a time delay.
5. Send the second digit hexadecimal code to the data port.
6. Introduce a time delay.
7. Repeat the step 5 and 6 for the remaining digits.
8. End the program.

Department of MECHATRONICS, 69
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Flow Chart:

Start

Set the command word to select the MSB of the word

Send the hexa decimal code to the data port

Introduce time delay

Set command word to select LSB of the word

Send the hexa decimal code of the last digit to the data port

Stop

Department of MECHATRONICS, 70
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

PROGRAM:

ADDRE HEX LABEL OPER OPCO COMMENTS


SS CODE AND DE
9100 H8200 LX1 Lead HL Pair
9101 With 8200
9102
9103 A12 MV1 Move immediate
9104 Data 12 to A
9105 51 OUT Out byte at A
9106 To 51
9107 A3E MV1 Move immediate
9108 Data 3E to A
9109 51 OUT Out byte at A
910A To 51
910B AA0 MV1 Move immediate
910C Data A0 to A
910D 51 OUT Out byte at A
910E To 51
910F B06 MV1 Move immediate
9110 Data 06 to B
9111 A,00 MV1 Move immediate
9112 Data 00 to A
9113 50 OUT Out byte at A
9114 To 50
9115 LOOP A,M MOV Move M to A
9116 50 OUT Out byte at A
9117 To 50
9118 H INX Increment HL pair
9119 B DCR Decrement B
9120 9115 JNZ Jump on no zero
912A To 9115
912B
912C 1 RST Reset

Result:

Thus an assembly level program was implemented to perform 8279 interfacing using
8085.

Department of MECHATRONICS, 71
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Ex. no.: 16
Date:

INTERFACING 8255 WITH 8085


AIM:
To interface programmable peripheral interface 8255 with 8085 and study its
characteristics in mode0.

APPARATUS REQUIRED:

8085 p kit, 8255Interface board.


I/O MODES:
Control Word:

Department of MECHATRONICS, 72
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

MODE 0 – SIMPLE I/O MODE:


This mode provides simple I/O operations for each of the three ports and is
suitable for synchronous data transfer. In this mode all the ports can be configured either as
input or output port.
Let us initialize port A as input port and port B as output port

PROGRAM:
ADDRESS OPCODES LABEL MNEMONICS OPERAND COMMENTS
8100 START: MVI A, 90 Initialize port A as
8101 Input and Port B as
output.
8102 OUT C6 Send Mode Control
8103 word
8104 IN C0 Read from Port A
8105
8106 OUT C2 Display the data in
8107 port B
8108 STA 8200 Store the data read
8109 from Port A in 4200
810A
810B HLT Stop the program.

RESULT:
Thus 8255 is interfaced with 8085 and its characteristics in mode0 was studied.

Department of MECHATRONICS, 73
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

MODEL QUESTION PAPER

1. Write an ALP to find the smallest number in an array of 5 numbers. (BB, 0F, 23, 45, 6B)
using 8085 microprocessor.

2. Write an ALP to find the largest number in an array of 5 numbers. (BB, 0F, 23, 45, 6B)
using 8085 microprocessor.

3. Write an ALP to sort an array of 5 numbers (BB, 0F, 23, 45, 6B) in ascending order using
8085 microprocessor.

4. Write an ALP to sort an array of 5 numbers (DE, 0F, 03, 45, 6B) in descending order
using 8085 microprocessor.

5. Write an ALP to convert a hexadecimal number 33 into BCD number using 8085
microprocessor.

6. Write an ALP to interface DAC with 8085 microprocessor.

7. Write an ALP to convert a hexadecimal number 44 into ASCII number using 8085
microprocessor.

8. Write an ALP to add two 16-bit numbers (AABBH + EEFFH) using 8085
microprocessor.

9. Write an ALP to interface 8- DIP switches which controls an 8-LED package with an
8085 microprocessor.

10. Write an ALP to interface ADC with 8085 microprocessor.

11. Write an ALP to interface and control seven segment displays using 8279 with an 8085
microprocessor.

12. Write an ALP to interface and operate the stepper motor in clockwise direction using
8085 microprocessor.

13. Write an ALP to interface and operate the temperature controller using 8085
microprocessor.

14. Write an ALP to divide two 8-bit numbers (CDH / ABH) using 8085 processor.

15. Write an ALP to subtract two 8-bit numbers (0AH – ODH) using 8085 processor.

Department of MECHATRONICS, 74
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

16. Write an ALP to multiply two 8-bit numbers (ABH × CDH) using 8085 processor.

17. Write an ALP to add two 8-bit numbers (0AH + ODH) using 8085 processor

18. Write an ALP to interface ADC with 8085 processor

19. Write an ALP to add two 16-bit numbers (FF0AH + FEODH) using 8085 processor

20. Write an ALP to subtract two 16-bit numbers (CD0AH – A1ODH) using 8085 processor.

Department of MECHATRONICS, 75
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

VIVA QUESTIONS WITH ANSWERS

1.What is a Microprocessor?
Microprocessor is a CPU fabricated on a single chip, program-controlled device, which
fetches the instructions from memory, decodes and executes the instructions.
2. What is Instruction Set?
It is the set of the instructions that the Microprocessor can execute.
3. What is Bandwidth ?
The number of bits processed by the processor in a single instruction.
4. What is Clock Speed ?
Clock speed is measured in the MHz and it determines that how many instructions a
processor can processed. The speed of the microprocessor is measured in the MHz or GHz.
5. What are the features of Intel 8086 ?
Features:
· Released by Intel in 1978
· Produced from 1978 to 1990s
· A 16-bit microprocessor chip.
· Max. CPU clock rate:5 MHz to 10 MHz
· Instruction set: x86-16
· Package: 40 pin DIP
· 16-bit Arithmetic Logic Unit
· 16-bit data bus (8088 has 8-bit data bus)
· 20-bit address bus - 220 = 1,048,576 = 1 meg
· The address refers to a byte in memory.
6. What is Logical Address:?
• A memory address on the 8086 consists of two numbers, usually written in
hexadecimal and separated by a colon, representing the segment and the offset. This
combination of segment and offset is referred to as a logical address
• Logical address=segment: offset
7. What is The Effective Address:
• In general, memory accesses take the form of the following example:
• Mov ax, [baseReg + indexReg + constant]
• This example copies a word sized value into the register AX.
• Combined, the three parameters in brackets determine what is called the effective
address, which is simply the offset referenced by the instruction
8. What is Physical Address?
Physical memory address pointed by SEGMENT:OFFSET pair is calculated as:
Physical address = (<Segment Addr> * 10) + <Offset Addr>
9.What are the flags in 8086?
In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag,
Interrupt flag, Direction flag, and Sign flag.
10.Why crystal is a preferred clock source?
Because of high stability, large Q (Quality Factor) & the frequency that doesn’t drift with
aging. Crystal is used as a clock source most of the times.

Department of MECHATRONICS, 76
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

11.What is Tri-state logic?


Three Logic Levels are used and they are High, Low, High impedance state. The high and
low are normal logic levels & high impedance state is electrical open circuit conditions. Tri-
state logic has a third line called enable line.
12.What happens when HLT instruction is executed in processor?
The Micro Processor enters into Halt-State and the buses are tri-stated.
13.What is Program counter?
Program counter holds the address of either the first byte of the next instruction to be fetched
for execution or the address of the next byte of a multi byte instruction, which has not been
completely fetched. In both the cases it gets incremented automatically one by one as the
instruction bytes get fetched. Also Program register keeps the address of the next instruction.
14. What is 1st / 2nd / 3rd / 4th generation processor?
The processor made of PMOS / NMOS / HMOS / HCMOS technology is called 1st / 2nd /
3rd / 4th generation processor, and it is made up of 4 / 8 / 16 / 32 bits.
15.Name the processor lines of two major manufacturers?
High-end: Intel - Pentium (II, III, 4), AMD - Athlon. Low-end: Intel - Celeron, AMD -
Duron. 64-bit: Intel - Itanium 2, AMD - Opteron.
16.How many bit combinations are there in a byte?
Byte contains 8 combinations of bits.
17.Have you studied buses? What types?
There are three types of buses.
Address bus: This is used to carry the Address to the memory to fetch either Instruction or
Data.
Data bus : This is used to carry the Data from the memory.
Control bus : This is used to carry the Control signals like RD/WR, Select etc.
27..What does memory-mapping mean?
The memory mapping is the process of interfacing memories to microprocessor and
allocating addresses to each memory locations.
28. What is interrupt 1/0?
If the 1/0 device initiate the data transfer through interrupt then the 1/0 is called interrupt
driven 1/0.
29. Why EPROM is mapped at the beginning of memory space in 8085 system?
In 8085 microprocessor, after a reset, the program counter will have OOOOH address. If the
monitor program is stored from this address then after a reset, it will be executed
automatically. The monitor program is a permanent program and stored in EPROM memory.
If EPROM memory is mapped at the beginning of memory space, i.e., at OOOOH, then the
monitor program will be executed automatically after a reset.
31.What is DMA?
The direct data transfer between I/O device and memory is called DMA.
32. What is the need for Port?
The I/O devices are generally slow devices and their timing characteristics do not match with
processor timings. Hence the I/O devices are connected to system bus through the ports.
33.What is a port?
The port is a buffered I/O, which is used to hold the data transmitted from the microprocessor
to I/O device or vice-versa.

Department of MECHATRONICS, 77
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

34.Give some examples of port devices used in 8085 microprocessor based system?
The various INTEL I/O port devices used in 8085 microprocessor based system are 8212,
8155, 8156, 8255, 8355 and 8755.
35. Write a short note on INTEL 8255?
The INTEL 8255 is a I/O port device consisting of 3 numbers of 8 –bit parallel I/O ports. The
ports can be programmed to function either as a input port or as a output port in different
operating modes. It requires 4 internal addresses and has one logic LOW chip select pin.
36.What is the drawback in memory mapped I/0?
When I/O devices are memory mapped, some of the addresses are allotted to I/O devices and
so the full address space cannot be used for addressing memory (i.e., physical memory
address space will be reduced). Hence memory mapping is useful only for small systems,
where the memory requirement is less.
37. How DMA is initiated?
When the I/O device needs a DMA transfer, it will send a DMA request signal to DMA
controller. The DMA controller in turn sends a HOLD request to the processor. When the
processor receives a HOLD request, it will drive its tri-stated pins to high impedance state at
the end of current instruction execution and send an acknowledge signal to DMA controller.
Now the DMA controller will perform DMA transfer.
38. What is processor cycle (Machine cycle)?
The processor cycle or machine cycle is the basic operation performed by the processor. To
execute an instruction, the processor will run one or more machine cycles in a particular
order.
39. What is Instruction cycle?
The sequence of operations that a processor has to carry out while executing the instruction is
called Instruction cycle. Each instruction cycle of a processor indium consists of a number of
machine cycles.
40. What is fetch and execute cycle?
In general, the instruction cycle of an instruction can be divided into
fetch and execute cycles. The fetch cycle is executed to fetch the opcode from memory. The
execute cycle is executed to decode the
instruction and to perform the work instructed by the instruction.
41.What is Block and Demand transfer mode DMA?
In Block transfer mode, the DMA controller will transfer a block of data and relieve the bus
for processor. After sometime another block of data is transferred by DMA and so on.
In Demand transfer mode the DMA controller will complete the entire .data transfer at a
stretch and then relieve the bus to processor.
42. What is the need for timing diagram?
The timing diagram provides information regarding the status of various signals, when a
machine cycle is executed. The knowledge of timing diagram is essential for system designer
to select matched peripheral devices like memories, latches, ports, etc., to form a
microprocessor system.
43. How many machine cycles constitute one instruction cycle in 8085?
Each instruction of the 8085 processor consists of one to five machine cycles.
44. Define opcode and operand.
Opcode (Operation code) is the part of an instruction / directive that identifies a specific
operation.

Department of MECHATRONICS, 78
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

Operand is a part of an instruction / directive that represents a value on which the instruction
acts.
45. What is opcode fetch cycle?
The opcode fetch cycle is a machine cycle executed to fetch the opcode of an instruction
stored in memory. Every instruction starts with opcode fetch machine cycle.
46. What operation is performed during first T -state of every machine cycle in 8085 ?
In 8085, during the first T -state of every machine cycle the low byte address is latched into
an external latch using ALE signal.
47. Why status signals are provided in microprocessor?
The status signals can be used by the system designer to track the internal operations of the
processor. Also, it can be used for memory expansion (by providing separate memory banks
for program & data and selecting the bank using status signals).
48. How the 8085 processor differentiates a memory access (read/write) and 1/0 access
(read/write)?
The memory access and 1/0 access is differentiated using 10 I M signal.
The 8085 processor asserts 10 I M low for memory read/write operation and 10 I M is
asserted high for 1/0 read/write operation.
49. When the 8085 processor checks for an interrupt?
In the second T -state of the last machine cycle of every instruction, the 8085 processor
checks whether an interrupt request is made or not.
50. What is interrupt acknowledge cycle?
The interrupt acknowledge cycle is a machine cycle executed by 8085 processor to get the
address of the interrupt service routine in-order to service the interrupt device.

Department of MECHATRONICS, 79
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

APPENDIX
OPCODES TABLE OF INTEL 8085

Opcodes of Intel 8085 in Alphabetical


Order

Sr. No. Mnemonics, Operand Opcode Bytes


1. ACI Data CE 2
2. ADC A 8F 1
3. ADC B 88 1
4. ADC C 89 1
5. ADC D 8A 1
6. ADC E 8B 1
7. ADC H 8C 1
8. ADC L 8D 1
9. ADC M 8E 1
10. ADD A 87 1
11. ADD B 80 1
12. ADD C 81 1
13. ADD D 82 1
14. ADD E 83 1
15. ADD H 84 1
16. ADD L 85 1
17. ADD M 86 1
18. ADI Data C6 2
19. ANA A A7 1
20. ANA B A0 1
21. ANA C A1 1
22. ANA D A2 1
23. ANA E A3 1
24. ANA H A4 1
25. ANA L A5 1
26. ANA M A6 1
27. ANI Data E6 2
28. CALL Label CD 3
29. CC Label DC 3
30. CM Label FC 3
31. CMA 2F 1
32. CMC 3F 1
33. CMP A BF 1
34. CMP B B8 1
35. CMP C B9 1
36. CMP D BA 1

Department of MECHATRONICS, 80
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

37. CMP E BB 1
38. CMP H BC 1
39. CMP L BD 1
40. CMP M BD 1
41. CNC Label D4 3
42. CNZ Label C4 3
43. CP Label F4 3
44. CPE Label EC 3
45. CPI Data FE 2
46. CPO Label E4 3
47. CZ Label CC 3
48. DAA 27 1
49. DAD B 09 1
50. DAD D 19 1
51. DAD H 29 1
52. DAD SP 39 1
53. DCR A 3D 1
54. DCR B 05 1
55. DCR C 0D 1
56. DCR D 15 1
57. DCR E 1D 1
58. DCR H 25 1
59. DCR L 2D 1
60. DCR M 35 1
61. DCX B 0B 1
62. DCX D 1B 1
63. DCX H 2B 1
64. DCX SP 3B 1
65. DI F3 1
66. EI FB 1
67. HLT 76 1
68. IN Port-address DB 2
69. INR A 3C 1
70. INR B 04 1
71. INR C 0C 1
72. INR D 14 1
73. INR E 1C 1
74. INR H 24 1
75. INR L 2C 1
76. INR M 34 1
77. INX B 03 1
78. INX D 13 1
79. INX H 23 1
80. INX SP 33 1
81. JC Label DA 3

Department of MECHATRONICS, 81
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY

82. JM Label FA 3
83. JMP Label C3 3
84. JNC Label D2 3
85. JNZ Label C2 3
86. JP Label F2 3
87. JPE Label EA 3
88. JPO Label E2 3
89. JZ Label CA 3

Department of MECHATRONICS, 82
Rajalakshmi Engineering College, Chennai-602105.

Das könnte Ihnen auch gefallen