Sunteți pe pagina 1din 26

TEE 453 MICROPROCESSOR LABORATORY L 0 A.

Study Experiments 1 2 3 To study 8085 based microprocessor system To study 8086 and 8086A based microprocessor system To study Pentium Processor T 0 P 2

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

C. Interfacing based Experiments (any four) 10 11 12 13 14 15 16 17 To obtain interfacing of RAM chip to 8085/8086 based system To obtain interfacing of keyboard controller To obtain interfacing of DMA controller To obtain interfacing of PPI To obtain interfacing of UART/USART To perform microprocessor based stepper motor operation through 8085 kit To perform microprocessor based traffic light control 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 3000FFFF 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 RESET 1 A D M G R RST 5 Reset the system.

Operation

Press this to select the Mode. To select the Assembler Mode. To select the Dissembler Mode. To see the particular memory location and to modify the content of that location. Press G, after that press $, to execute the program in single step. To see the result press R with particular register. 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 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 - 64K bytes of RAM using 62256.

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 A D F G I M P

Operation To select the Assembler Mode and used to convert the input Assemble Language to the Machine Language in the Memory. Display or Modify the RAMS Hexadecimal Fill Data into the RAM. Proceed to the address for execution. Interrupt. Moving data in the memory from a specified address to another address by input the starting address, the ending address and the desire address. 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 2002 : 3E 00 2004 : 21 00 35 2007 : BE 2008 : D2 0C 80 200B : 7E 200C : 05 200D : 23 200E : C2 07 20 200B : 32 00 25 200E : EF MVI B, 0A H MVI A, 00 LXI H, 3500 H CMP M JNC 200C MOV A, M DCR B INX H JNZ 2007 STA 2504 RST 5 ; 10 data ; Lowest in Accumulator ; First memory location ; is [Acc.} > data ; if YES, skip ; Otherwise, store data in Acc. ; If counter is not zero continue ; Result

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

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 2002 2003 2004 2007 2008 2009 200A 200B 200E 200F 2010 2011 2012 2015 2016 2017 201A MVI B, 0A DCR B MOV C, B LXI H, 3500 MOV A, M INX H MOV D, M CMP M JC 2012 MOV M, A DCX H MOV M, D INX H DCR C JNZ 2007 DCR B JNZ 2003 RST ; Length of data in Reg. B ; N-1 comparisons ; keep a copy Reg. C

; If [Acc.] < [M], exchange

; Is comparison is not over, continue ; if cycle are not over, continue

PROGRAM: for descending order 2000 2002 2003 2004 2007 2008 2009 200A 200B 200E 200F 2010 2011 2012 2015 2016 2017 201A MVI B, 0A DCR B MOV C, B LXI H, 3500 MOV A, M INX H MOV D, M CMP M JNC 2012 MOV M, A DCX H MOV M, D INX H DCR C JNZ 2007 DCR B JNZ 2003 RST 5 ; Length of data in Reg. B ; N-1 comparisons ; keep a copy Reg. C

; If [Acc.] < [M], exchange

; Is comparison is not over, continue ; if cycle are not over, continue

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

PROGRAM: Division 2000 2003 2006 2007 2009 200A 200B 200C 200F 2010 2011 2012 2015 2018 LHLD 3501 LDA 3503 MOV B, A MVI C, 08 DAD H MOV A, H SUB B JC 2011 MOV H, A INR L DCR C JNZ 2009 SHLD 3504 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 2003 2005 2007 2008 2009 200C 200F 2010 2011 2012 2015 2016 2019 201A 201C 201F LXI H, 3500 MVI C, 01; Set subtraction counter to 1 MVI B, 01; Set odd number to 1 MOV A, M ; Load accumulator with number SUB B ; Subtract odd number JZ 2015 ; If [Acc.] = 0, store result JC 201A ; If [Acc.] < [Reg. B], then mark ERROR INR C INR B ; Increment twice for next odd counter INR B JMP 2008 ; Repeat subtraction MOV A, C ; Store result STA 3501 RST 5 ; Stop execution MVI A, 0E ; Error maker STA 3501 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,
PROGRAM2000 KBD 2002 2004 INIT 2006 2008 SCAN 2009 200B 200D 2010 2012 2015 2016 2018 2019 201B 201E 201F 2020 2021 2024 DISP 2025 2028 202A 202D 2038 CODE 2039 203C 203E 203F CODE2 2041 CODE5 2042 2045 2046 2049 CODE10 204A MVI A,90 OUT 03 MVI B,00 MVI C,01 MOV A,C OUT 02 IN 00 CALL CODE CPI 08H JM DISP MOV A,B ADI 08H MOV B,A CPI 18H JP INIT MOV A,C RLC MOV C,A JMP SCAN ORA B NOP NOP CALL UPDDT JMP INIT ORA A JNZ CODE2 MVI A,08 RET MVI D,00 RRC JC CODE10 INR D JMP CODE5 MOV A,D RET keyboard

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

No

Is Max < (Pointer) ?

Yes

MAX = (Pointer)

Pointer = Pointer + 1 Count = Count - 1

No

Is Count = 0 ?

(3500H) = MAX

END

Flow Chart for arrange numbers in ascending order.

Ascending order program


2000 2002 2005 2007 2008 MVI B, 09 LXI H, 2200 MVI C, 09 MOV A, M INX H : Initialize counter : Initialize memory pointer : Initialize counter 2 : Get the number : Increment memory pointer

2009 200A 200D 2010 2011 2012 2013 2014 2015 2016 2019 201A 201D

CMP M JC 2015 JZ 2015 MOV D, M MOV M, A DCX H MOV M, D INX H DCR C JNZ 2007 DCR B JNZ 2002 RST 5

: Compare number with next number : If less, don't interchange : If equal, don't interchange

: Interchange two numbers : Decrement counter 2 : If not zero, repeat : Decrement counter 1 : To halt program

Flow Chart for finding largest number

Start

Initialize address Set byte counter

Set Accumulator = 00

Increment addr. pointer

Is Accumulator > next number

No

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 remainder 0?

Yes

Error

Increment subtraction counter

Store subtraction 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

Is [Acc.] < next? Next datum to Acc. No Exchange data

Yes

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

DECIMAL ADDITION AND SUBTRACTION Addition: 2000 2003 2004 2005 2006 2007 200A Subtraction: 2000 2003 2004 2005 2006 2007 200A LXI H,2501 MOV A,M INX H SUB M DAA STA 2503H RST 5 Load the addres s of first number in H-L pair. Get first number in accumulato r. Get addres s of secon d number in H-L pair. Subtract two numbers. Convert to decimal Store result at specified memory location. To set Breakpoint LXI H,2501 MOV A,M INX H ADD M DAA STA 2503H RST 5 Load the addres s of first number in H-L pair. Get first number in accumulato r. Get addres s of secon d number in H-L pair. Add two numbers. Convert to decimal Store result at specified memory location. 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 address of 1st nd number in H L L Convert Accumulator HEX H pair Get address of 2 number in number into Decimal number pair Get 1st number in Accumulator Subtract two number Store the Result

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 2003 MOV C,M 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 Load the addres s of first number in H-L pair. Get first number in Register C .

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 2006 LDA 2201H

: Get the first number in DE register pair

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

S-ar putea să vă placă și