Beruflich Dokumente
Kultur Dokumente
MT 6411
MICROPROCESSOR LABORATARY
Department of MECHATRONICS, 1
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
TABLE OF CONTENT
S.No Index Page no.
6. Syllabus 9
7. Lab Plan 10
Department of MECHATRONICS, 2
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
23 Model Questions 74
25 APPENDIX 80
Department of MECHATRONICS, 3
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Year : II year
Semester : IV semester
Department of MECHATRONICS, 4
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Department of MECHATRONICS, 5
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
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
Department of MECHATRONICS, 8
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
OBJECTIVES:
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 :
AIM:
To add two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
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:
OBSERVATION:
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 :
AIM:
To subtract two 8 bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
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:
Department of MECHATRONICS, 16
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
OBSERVATION:
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 :
AIM:
To multiply two 8 bit numbers stored at consecutive memory locations and store the
result in memory using 8085 microprocessor.
ALGORITHM:
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
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:
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 8085p using repeated addition method.
Department of MECHATRONICS, 22
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Ex. No. : 4
Date :
AIM:
To divide two 8-bit numbers and store the result in memory using 8085
microprocessor.
ALGORITHM:
CALCULATION:
Department of MECHATRONICS, 23
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
FLOWCHART:
Start
YES
If
carry=1
NO
A=A-M
B=B+1
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 :
AIM:
To add two 16-bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
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:
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 8085p using
special instructions.
Department of MECHATRONICS, 28
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Ex. No.:6
Date :
AIM:
To subtract two 16-bit numbers stored at consecutive memory locations using 8085
microprocessor.
ALGORITHM:
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 :
ALGORITHM:
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:
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 :
AIM:
To sort the given number in the descending order using 8085 microprocessor.
ALGORITHM:
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:
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 :
AIM:
ALGORITHM:
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
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:
OBSERVATION:
INPUT OUTPUT
8200 01 (MSB) 8202 0A H (HEX)
8201 00 (LSB)
RESULT:
Department of MECHATRONICS, 46
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Ex. No.: 10
Date :
AIM:
ALGORITHM:
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:
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:
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
STOP
Department of MECHATRONICS, 50
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Subroutine:
Move 0F in B
Move FF in A
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:
Department of MECHATRONICS, 52
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Result:
Department of MECHATRONICS, 53
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Exp.No: 12
Date:
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:
Calculation:
Department of MECHATRONICS, 54
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Flowchart:
Start
Stop
Subroutine:
Move the data to B-Register
If
Yes A=0
No
Yes
If
B=0
No
Department of MECHATRONICS, 55
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
PROGRAM:
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:
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:
Department of MECHATRONICS, 58
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Flowchart:
Start
Call delay B
Call delay B
Call delay B
Call delay B
Department of MECHATRONICS, 59
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Subroutine:
Initialize B with 10
Load A with FF
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:
Department of MECHATRONICS, 61
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Result:
Department of MECHATRONICS, 62
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Ex. no.: 14
Date
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
=98H
Department of MECHATRONICS, 64
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
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:
Aim:
Apparatus Required:
1. Keyboard
2. Power Chord
3. Microprocessor Kit
4. 8279 Interfacing kit.
Algorithm:
Department of MECHATRONICS, 69
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
Flow Chart:
Start
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:
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:
APPARATUS REQUIRED:
Department of MECHATRONICS, 72
Rajalakshmi Engineering College, Chennai-602105.
MT6411 – MICROPROCESSOR LABORATORY
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
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.
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.
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
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
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
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
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.