You are on page 1of 26

TEE 453

MICROPROCESSOR LABORATORY
L T P
0 0 2

A. Study Experiments

1 To study 8085 based microprocessor system


2 To study 8086 and 8086A based microprocessor system
3 To study Pentium Processor

B. Programming based Experiments (any four)

4 To develop and run a program for finding out the largest/smallest number from a given set of
numbers.
5 To develop and run a program for arranging in ascending/descending order of a set of numbers
6 To perform multiplication/division of given numbers
7 To perform conversion of temperature from 0F to 0C and vice-versa
8 To perform computation of square root of a given number
9 To perform floating point mathematical operations (addition, subtraction, multiplication and
division)

C. Interfacing based Experiments (any four)

10 To obtain interfacing of RAM chip to 8085/8086 based system


11 To obtain interfacing of keyboard controller
12 To obtain interfacing of DMA controller
13 To obtain interfacing of PPI
14 To obtain interfacing of UART/USART
15 To perform microprocessor based stepper motor operation through 8085 kit
16 To perform microprocessor based traffic light control
17 To perform microprocessor based temperature control of hot water.

EXPERIMENT 1
OBJECT: To study the 8085 microprocessor training kit (VMC- 8509)

APPARATUS REQUIRED: 8085 microprocessor training kit.

THEORY:

General
The system has got 8085 as the central processing unit. The clock freq for the system is 3.07
MHz and is generated from a crystal of 6.14 MHz.
8085 has got 8 data lines and 16 address lines. The lower 8 address lines and 8 data lines are
multiplexed. Since the lower 8 address bits appear on the bus during the first clock cycle of a machine
cycle and the 8 bit data appears on the bus during the second and third clock cycle, It becomes
necessary to latch the lower 8 address bits during the first clock cycle so that the 16 bits address
remains available in subsequent cycle. This is achieved using a latch a 74-LS-373.

MEMORY: -
VMC-850X provides 2/8k bytes of RAM using 6116-6264 chips and 4k/8k bytes of EPROM for
monitor.
The various chips which can be used are 2732, 2764, 27128, 27256, 6116 and 6264. There is one
memory space provided on VMC 850CX. This one space can be defined any address slots from 3000-
FFFF depending upon the size of the memory chip to be used.

INPUT/OUTPUT DEVICES
The various I/O chips used in VMC8501 are 8279, 8255 & 8253 and VMC8502 are 8279, 8255,
8253 & 8151.The functional role of all these chips is given below: -

8279 (KEY BOARD AND DISPLAY CONTROLLER): -


8279 is a general-purpose programmable keyboard and display I/O interface device designed for
used with the 8085 microprocessor. It provides a scanned interface to 28 contact key matrixes provided
in VMC850X and scanned interface for the six seven segment displays. 8279 has got 16 x 8 display
RAM that can be loaded or interrogated by the CPU. When a key is pressed, its corresponding codes
are entered in the FIFO queue of 8279 and can now we read by the microprocessor.

8255 (PROGRAMABLE PERIPHERAL INTERFACE): -


8255 is a programmable peripheral interface (PPI) designed to used with 8085 microprocessor.
This basically acts as a general purpose I/O devices to interface peripheral equipment to the system bus.
It has got three input output ports of eight lines each. VMC850X provides 24 I/O ports using 8255
chips.

8253(PROGRAMABLE INTERNAL TIMER)


This chip is programmable interval timer/ counter and can be used for the generation of accurate
time delays under software control. Other functions that can be performed by this chip are
programmable rate generator, binary rate multiplier, even counter, real-time clock etc. This chip has got
three independent 16 bits counter each having a count rate of 2KHz.

8155 (PROGRAMMABLE I/O PORT AND TIMER INTERFACE)


8155 is a programmable is I/O port and a timer interface designed to use with 8085
microprocessor. The 8155 include 256 bytes of R/W memory, three I/O port and a timer. This basically
acts as a general purpose I/O device to interface peripheral equipment to the system bus. It has got two
8 bit parallel I/O port (port-A, port-B) and one 6 bit (port-C)
DISPLAY: -
VMC850X provides six digits of seven-segment display. Four digits are for displaying the
address of any location or name of any register; where as the rest of two digits are meant for displaying
the contents of a register. All the six digits of the display are in hexadecimal notation.

Function Key
Operation
RESET Reset the system.

1 Press this to select the Mode.

A To select the Assembler Mode.

D To select the Dissembler Mode.

M To see the particular memory location and to modify the content of


that location.

G Press G, after that press $, to execute the program in single step.

R To see the result press R with particular register.

RST 5 To halt the program on this kit.

PRECAUTIONS:

1. Handle the kit carefully.


2. Connect the power supply (if needed) carefully.
3. Connect keyboard carefully.

EXPERIMENT 2
OBJECT: Study of 8086 microprocessor training kit.

APPARATUS REQUIREMENT: VMC 8609 microprocessor training kit.

THEORY: VMC-8609 is a single board microprocessor training /development kit configured around
the INTELs 16 bit microprocessor 8086. The kit has been designed to operate in the max mode.

HARDWARE DESCRIPTION

CPU
8086 is a 16 bit, third generation microprocessor and is suitable for an exceptionally wide spectrum of
microprocessor applications. 8086 has got 16 bit data lines and 20 address lines.

CLOCK GENERATION
The clock generation circuit is an Intels 8284-clock generator/driver. The circuit accepts a crystal
input, which operate at fundamental frequency of 14.7456 MHz. The clock generator/driver divides the
crystal frequency by three to produce the 4.9 MHz CLK signal required by CPU. The clock
generator/driver provides two control signal outputs, which are synchronized (internally) to the 4.9
MHz CLK signals; RDY (ready) and RST (reset).

BUS CONTROLLER
The 8288 is a bus controller which decodes the status signals output by 8089,or a maximum mode
8086.The 8288 issue a bus command that identifies the bus cycle as a memory read, memory write, i/o
read, i/o write, etc. It also provides a signal that strobes the address into latches.

BUS ARBITERS
The 8289 is a bus arbiter that controls the access of a processor to multimaster system resources
(typically memory) that is shared by two or more microprocessors.

MEMORY
VMC-8609 provides 16K byte of EPROM loaded with monitor and 16K bytes of CMOS RAM .The
total on board memory can be configured as follows.
EPROM - 512 bytes of EPROM using 27C010, 1024 bytes using 27C020
& 256K bytes using 62C1024.

RAM - 64K bytes of RAM using 62256.

I/O DEVICES

8279

8279 is a general-purpose programmable keyboard and display I/O interface device Designed for use
with the 8086 microprocessor. It provides a scanned inter face to 28 channel key matrix provided in
VMC-8603 and scanned displays.
8255

8255 is programmable peripheral interface (PPI) designed to use with 8086 microprocessor. This
basically acts as a general purpose I/O component to interface peripheral equipments to the system bus.

8253
This chip is a programmable interval timer/counter and can be used for the generation of accurate time
delays under software control. Various other functions that can be implemented with this chip are
programmable rate generation.

8251

This chip is programmable communication interface and is used as a peripheral device. This device
accepts data characters from CPU in parallel form and then converts them into a continuous serial data
stream for transmission.

DISPLAY

VNC-8609 provides eight digits of seven-segment display. Four digits are for displaying the address of
any location or name or any register, whereas the rest of the four digits are meant for displaying the
contents of memory location or of a resister. All the eight digits of the display are in hexadecimal
notation.

Function Key Operation


A To select the Assembler Mode and used to convert the input Assemble
Language to the Machine Language in the Memory.

D Display or Modify the RAMS Hexadecimal

F Fill Data into the RAM.

G Proceed to the address for execution.

I Interrupt.

M Moving data in the memory from a specified address to another


address by input the starting address, the ending address and the desire
address.
P
For print the output connect the printer with I/O system of 8255.
T
Trace Program
U
Unassembled Mode.

PRECAUTIONS:

1. Handle the kit carefully.


2. Connect keyboard carefully.

EXPERIMENT 4
OBJECT: To develop and run a program for finding out the largest / smallest number from a given set
of numbers.

EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard.

PROGRAM: for largest

2000 : 06 0A MVI B, 0A H ; 10 data


2002 : 3E 00 MVI A, 00 ; Lowest in Accumulator
2004 : 21 00 35 LXI H, 3500 H ; First memory location
2007 : BE CMP M ; is [Acc.} > data
2008 : D2 0C 80 JNC 200C ; if YES, skip
200B : 7E MOV A, M ; Otherwise, store data in Acc.
200C : 05 DCR B
200D : 23 INX H
200E : C2 07 20 JNZ 2007 ; If counter is not zero continue
200B : 32 00 25 STA 2504 ; Result
200E : EF RST 5

PROGRAM: for smallest

2000 : 06 0A MVI B, 0A H ; 10 data


2002 : 3E 00 MVI A, 00 ; Lowest in Accumulator
2004 : 21 00 35 LXI H, 3500 H ; First memory location
2007 : BE CMP M ; is [Acc.} < data
2008 : D2 0C 80 JC 200C ; if YES, skip
200B : 7E MOV A, M ; Otherwise, store data in Acc.
200C : 05 DCR B
200D : 23 INX H
200E : C2 07 20 JNZ 2007 ; If counter is not zero continue
200B : 32 00 25 STA 2504 ; Result
200E : EF RST 5

RESULT: The program is executed and the result is stored in 2504H memory location.

PRECAUTION: Before executing the program make sure that it is entered properly

EXPERIMENT 5

OBJECT: To develop and run a program for arranging in ascending/descending order of a set of
numbers.
EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard.

PROGRAM: for ascending order

2000 MVI B, 0A ; Length of data in Reg. B


2002 DCR B ; N-1 comparisons
2003 MOV C, B ; keep a copy Reg. C
2004 LXI H, 3500
2007 MOV A, M
2008 INX H
2009 MOV D, M
200A CMP M ; If [Acc.] < [M], exchange
200B JC 2012
200E MOV M, A
200F DCX H
2010 MOV M, D
2011 INX H
2012 DCR C ; Is comparison is not over, continue
2015 JNZ 2007
2016 DCR B ; if cycle are not over, continue
2017 JNZ 2003
201A RST

PROGRAM: for descending order

2000 MVI B, 0A ; Length of data in Reg. B


2002 DCR B ; N-1 comparisons
2003 MOV C, B ; keep a copy Reg. C
2004 LXI H, 3500
2007 MOV A, M
2008 INX H
2009 MOV D, M
200A CMP M ; If [Acc.] < [M], exchange
200B JNC 2012
200E MOV M, A
200F DCX H
2010 MOV M, D
2011 INX H
2012 DCR C ; Is comparison is not over, continue
2015 JNZ 2007
2016 DCR B ; if cycle are not over, continue
2017 JNZ 2003
201A RST 5

RESULT: The program is executed and the result is verified.


PRECAUTION: Before executing the program make sure that it is entered properly.

EXPERIMENT 6
OBJECT: To perform Multiplication / Division of given numbers

EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard

PROGRAM: Multiplication
2000 LHLD3501
2003 XCHG
2004 LDA3503
2007 LXI H, 0000
200A MVI C, 08
200C DAD H
200D RAL
200E JNC2012
2011 DAD D
2012 DCR C
2013 JNZ 200C
2016 SHLD 3504
2019 RST 5

PROGRAM: Division
2000 LHLD 3501
2003 LDA 3503
2006 MOV B, A
2007 MVI C, 08
2009 DAD H
200A MOV A, H
200B SUB B
200C JC 2011
200F MOV H, A
2010 INR L
2011 DCR C
2012 JNZ 2009
2015 SHLD 3504
2018 RST 5

RESULT: The program is executed and the result is verified.

PRECAUTION: Before executing the program make sure that it is entered properly.

EXPERIMENT 6

OBJECT: To perform Multiplication / Division of given numbers


EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard

PROGRAM: Multiplication 8-bit numbers

2000 LDA 2200H


2003 MOV E, A
2004 MVI D, 00 : Get the first number in DE register pair
2006 LDA 2201H
2009 MOV C, A : Initialize counter
200A LX I H, 0000 H : Result = 0
200D DAD D : Result = result + first number
200E DCR C : Decrement count
200F JNZ 200D : If count 0 repeat
2012 SHLD 2300H : Store result
2015 RST 5 : Terminate program execution

PROGRAM: Division

2000 LHLD 3501


2003 LDA 3503
2006 MOV B, A
2007 MVI C, 08
2009 DAD H
200A MOV A, H
200B SUB B
200C JC 2011
200F MOV H, A
2010 INR L
2011 DCR C
2012 JNZ 2009
2015 SHLD 3504
2018 RST 5

RESULT: The program is executed and the result is verified.

PRECAUTION: Before executing the program make sure that it is entered properly.

EXPERIMENT 7
OBJECT: To perform computation of square root of a number.

EQUIPMENT USED: 8085 microprocessor training kit. Power supply, keyboard

PROGRAM:

2000 LXI H, 3500


2003 MVI C, 01; Set subtraction counter to 1
2005 MVI B, 01; Set odd number to 1
2007 MOV A, M ; Load accumulator with number
2008 SUB B ; Subtract odd number
2009 JZ 2015 ; If [Acc.] = 0, store result
200C JC 201A ; If [Acc.] < [Reg. B], then mark ERROR
200F INR C
2010 INR B ; Increment twice for next odd counter
2011 INR B
2012 JMP 2008 ; Repeat subtraction
2015 MOV A, C ; Store result
2016 STA 3501
2019 RST 5 ; Stop execution
201A MVI A, 0E ; Error maker
201C STA 3501
201F RST 5

RESULT: The program is executed and the result is verified.

PRECAUTION: Before executing the program make sure that it is entered properly.

EXPERIMENT 8
Object-To obtain interfacing of keyboard controller

Apparatus required- keyboard interface card, 8085 microprocessor kit, power supply, keyboard

PROGRAM-

2000 KBD MVI A,90


2002 OUT 03
2004 INIT MVI B,00
2006 MVI C,01
2008 SCAN MOV A,C
2009 OUT 02
200B IN 00
200D CALL CODE
2010 CPI 08H
2012 JM DISP
2015 MOV A,B
2016 ADI 08H
2018 MOV B,A
2019 CPI 18H
201B JP INIT
201E MOV A,C
201F RLC
2020 MOV C,A
2021 JMP SCAN
2024 DISP ORA B
2025 NOP
2028 NOP
202A CALL UPDDT
202D JMP INIT
2038 CODE ORA A
2039 JNZ CODE2
203C MVI A,08
203E RET
203F CODE2 MVI D,00
2041 CODE5 RRC
2042 JC CODE10
2045 INR D
2046 JMP CODE5
2049 CODE10 MOV A,D
204A RET

RESULT-
PRECAUTIONS:-

i. Connect the Interfacing Module properly.


ii. Be sure about the direction of cable.
iii. Before executing the program make sure that it is entered properly.

Flow Chart of finding largest number

Start
Count = 2500H
Pointer = (2501H)
Max = 0

Is
No Max <
(Pointer)
?

Yes

MAX = (Pointer)

Pointer = Pointer + 1
Count = Count - 1

Is
No
Count = 0
?

(3500H) = MAX

END

Flow Chart for arrange numbers in ascending order.


Ascending order program

2000 MVI B, 09 : Initialize counter


2002 LXI H, 2200 : Initialize memory pointer
2005 MVI C, 09 : Initialize counter 2
2007 MOV A, M : Get the number
2008 INX H : Increment memory pointer
2009 CMP M : Compare number with next number
200A JC 2015 : If less, don't interchange
200D JZ 2015 : If equal, don't interchange
2010 MOV D, M
2011 MOV M, A
2012 DCX H
2013 MOV M, D
2014 INX H : Interchange two numbers
2015 DCR C : Decrement counter 2
2016 JNZ 2007 : If not zero, repeat
2019 DCR B : Decrement counter 1
201A JNZ 2002
201D RST 5 : To halt program

Flow Chart for finding largest number

Start
Initialize address Set
byte counter

Set Accumulator = 00

Is No
Accumulator
Increment addr. pointer > next
number
Transfer datum to
Accumulator
Yes

Decrement byte counter

Is byte
counter = 00

Yes

Store Result

Stop

Flow chart for multiplication 8- bit numbers


Flow Chart for square root of a number

Start
Set subtraction counter to 1
Set odd number to 1

[Acc] given number

Subtract odd number from


given number

No Is Yes
remainder
0?

Error Increment subtraction Store subtraction


counter counter

Stop
Odd no. = Odd no. + 2 Stop

Flow Chart for arrange numbers in ascending order.

Start
Initialize cycle counter, comparison
counter and address pointer

Bring first data in Accumulator

Yes
Is [Acc.]
< next?

Next datum to Acc. No


Exchange data

Decrement comparison counter

No Is comp.
counter = 0?

Yes

Decrement cycle counter

Is cycle
counter =
0?

Stop

EXPERIMENT 1

OBJECT: To perform Decimal, Hexadecimal addition and subtraction of two numbers.

EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard


PROGRAM:

HEXADECIMAL ADDITION AND SUBTRACTION

Addition:
2000 LXI H,2501 Load the addres s of first number in H-L pair.
2003 MOV A,M Get first number in accumulato r.
2004 INX H Get addres s of secon d number in H-L pair.
2005 ADD M Add two numbers.
2006 STA 2503H Store result at specified memory location.
2009 RST 5 To set Breakpoint

Subtraction:
2000 LXI H,2501 Load the addres s of first number in H-L pair.
2003 MOV A,M Get first number in accumulato r.
2004 INX H Get addres s of secon d number in H-L pair.
2005 SUB M Subtract two numbers.
2006 STA 2503H Store result at specified memory location.
2009 RST 5 To set Breakpoint

DECIMAL ADDITION AND SUBTRACTION

Addition:
2000 LXI H,2501 Load the addres s of first number in H-L pair.
2003 MOV A,M Get first number in accumulato r.
2004 INX H Get addres s of secon d number in H-L pair.
2005 ADD M Add two numbers.
2006 DAA Convert to decimal
2007 STA 2503H Store result at specified memory location.
200A RST 5 To set Breakpoint

Subtraction:
2000 LXI H,2501 Load the addres s of first number in H-L pair.
2003 MOV A,M Get first number in accumulato r.
2004 INX H Get addres s of secon d number in H-L pair.
2005 SUB M Subtract two numbers.
2006 DAA Convert to decimal
2007 STA 2503H Store result at specified memory location.
200A RST 5 To set Breakpoint

RESULT: The program is executed and the result is verified.

PRECAUTION: Before executing the program make sure that it is entered properly.

Flow chart for Addition of two hex numbers


Flow chart for Subtraction of two hex numbers

Subtract two numbers

Flow chart for Addition of two Decimal numbers

Start

Load address of 1st number in H L pair


Get 1st number in Accumulator

Get address of 2nd number in H L


pair

Add two number

Convert Accumulator HEX number


into Decimal number

Store the Result

Stop

Flow chart for Subtraction of two Decimal numbers

Start

Load
Getaddress
Convert
address ofof1st2nd
Accumulatornumber
number
HEXinin
H L pair
number
H L
into
st Decimalpair number
Get 1Subtract
number
Store the two
inResult
Accumulator
number
Stop

EXPERIMENT 2

OBJECT: To perform addition and subtraction of two BCD numbers using 8085
microprocessor.
EQUIPMENT USED: 8085 microprocessor training kit, Power supply, keyboard

PROGRAM:

2000 LXI H,2501H Load the addres s of first number in H-L pair.
2003 MOV C,M Get first number in Register C .
2004 SUB A
2005 MOV B,A
2006 INX H
2007 ADD M
2008 DAA
2009 JNC NOF
200C PUSH PSW
200 MOV A,B
200 ADI 01H
200 DAA
MOV B,A
POP PSW
NOF: DCR C
JNZ 2006
MOV L,A
MOV H,B

5.Write an ALP to ADD 2-BCD

numbers: LXI H, 8A00


MVI D, 00
MOV
A, M
INX H
ADD
M
DAA
JNC LOOP-1
INR D
LOOP-1 STA 8A03
MOV A, D
STA 8A04
RST5

Multiplication 8-bit numbers

2000 LDA 2200H


2003 MOV E, A
2004 MVI D, 00 : Get the first number in DE register pair
2006 LDA 2201H
2009 MOV C, A : Initialize counter
200A LX I H, 0000 H : Result = 0
200D DAD D : Result = result + first number
200E DCR C : Decrement count
200F JNZ 200D : If count 0 repeat
2012 SHLD 2300H : Store result
2015 RST 5 : Terminate program execution

Sample problem 1:

(2200H) = 03H

(2201H) = B2H

Result = B2H + B2H + B2H = 216H

= 216H

(2300H) = 16H

(2301H) = 02H

Division

You might also like