microprocessor manual new
TRANSCRIPT
TEE 453MICROPROCESSOR LABORATORY
L T P0 0 2
A. Study Experiments
1 To study 8085 based microprocessor system2 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 numbers7 To perform conversion of temperature from 0F to 0C and vice-versa8 To perform computation of square root of a given number9 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 system11 To obtain interfacing of keyboard controller12 To obtain interfacing of DMA controller 13 To obtain interfacing of PPI14 To obtain interfacing of UART/USART15 To perform microprocessor based stepper motor operation through 8085 kit16 To perform microprocessor based traffic light control17 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
1
A
D
M
G
R
RST 5
Reset the system.
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 INTEL’s 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 GENERATIONThe clock generation circuit is an Intel’s 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 CONTROLLERThe 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 ARBITERSThe 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.
MEMORYVMC-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
D
F
G
I
M
P
T
U
To select the Assembler Mode and used to convert the input Assemble Language to the Machine Language in the Memory.
Display or Modify the RAM’S 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.
Trace Program
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 data2002 : 3E 00 MVI A, 00 ; Lowest in Accumulator2004 : 21 00 35 LXI H, 3500 H ; First memory location2007 : BE CMP M ; is [Acc.} > data2008 : D2 0C 80 JNC 200C ; if YES, skip200B : 7E MOV A, M ; Otherwise, store data in Acc.200C : 05 DCR B200D : 23 INX H200E : C2 07 20 JNZ 2007 ; If counter is not zero continue200B : 32 00 25 STA 2504 ; Result200E : EF RST 5
PROGRAM: for smallest
2000 : 06 0A MVI B, 0A H ; 10 data2002 : 3E 00 MVI A, 00 ; Lowest in Accumulator2004 : 21 00 35 LXI H, 3500 H ; First memory location2007 : BE CMP M ; is [Acc.} < data2008 : D2 0C 80 JC 200C ; if YES, skip200B : 7E MOV A, M ; Otherwise, store data in Acc.200C : 05 DCR B200D : 23 INX H200E : C2 07 20 JNZ 2007 ; If counter is not zero continue200B : 32 00 25 STA 2504 ; Result200E : 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. B2002 DCR B ; N-1 comparisons2003 MOV C, B ; keep a copy Reg. C2004 LXI H, 3500
2007 MOV A, M2008 INX H2009 MOV D, M200A CMP M ; If [Acc.] < [M], exchange200B JC 2012200E MOV M, A200F DCX H2010 MOV M, D2011 INX H2012 DCR C ; Is comparison is not over, continue2015 JNZ 20072016 DCR B ; if cycle are not over, continue2017 JNZ 2003201A RST
PROGRAM: for descending order
2000 MVI B, 0A ; Length of data in Reg. B2002 DCR B ; N-1 comparisons2003 MOV C, B ; keep a copy Reg. C2004 LXI H, 3500
2007 MOV A, M2008 INX H2009 MOV D, M200A CMP M ; If [Acc.] < [M], exchange200B JNC 2012200E MOV M, A200F DCX H2010 MOV M, D2011 INX H2012 DCR C ; Is comparison is not over, continue2015 JNZ 20072016 DCR B ; if cycle are not over, continue2017 JNZ 2003201A 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: Multiplication2000 LHLD35012003 XCHG2004 LDA35032007 LXI H, 0000200A MVI C, 08200C DAD H200D RAL200E JNC20122011 DAD D2012 DCR C2013 JNZ 200C2016 SHLD 35042019 RST 5
PROGRAM: Division2000 LHLD 35012003 LDA 35032006 MOV B, A2007 MVI C, 082009 DAD H200A MOV A, H200B SUB B200C JC 2011200F MOV H, A2010 INR L2011 DCR C2012 JNZ 20092015 SHLD 35042018 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 35012003 LDA 35032006 MOV B, A2007 MVI C, 082009 DAD H200A MOV A, H200B SUB B200C JC 2011200F MOV H, A2010 INR L2011 DCR C2012 JNZ 20092015 SHLD 35042018 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, 35002003 MVI C, 01 ; Set subtraction counter to 12005 MVI B, 01 ; Set odd number to 12007 MOV A, M ; Load accumulator with number2008 SUB B ; Subtract odd number2009 JZ 2015 ; If [Acc.] = 0, store result200C JC 201A ; If [Acc.] < [Reg. B], then mark ERROR200F INR C2010 INR B ; Increment twice for next odd counter2011 INR B2012 JMP 2008 ; Repeat subtraction 2015 MOV A, C ; Store result2016 STA 35012019 RST 5 ; Stop execution201A MVI A, 0E ; Error maker201C STA 3501201F 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,902002 OUT 032004 INIT MVI B,002006 MVI C,012008 SCAN MOV A,C2009 OUT 02200B IN 00200D CALL CODE2010 CPI 08H2012 JM DISP2015 MOV A,B2016 ADI 08H2018 MOV B,A2019 CPI 18H201B JP INIT201E MOV A,C201F RLC2020 MOV C,A2021 JMP SCAN2024 DISP ORA B
2025 NOP2028 NOP202A CALL UPDDT202D JMP INIT2038 CODE ORA A2039 JNZ CODE2203C MVI A,08203E RET203F CODE2 MVI D,002041 CODE5 RRC2042 JC CODE102045 INR D2046 JMP CODE52049 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
No
Yes
No
Start
Count = 2500HPointer = (2501H)
Max = 0
IsMax <
(Pointer)?
MAX = (Pointer)
Pointer = Pointer + 1Count = Count - 1
IsCount = 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
No
Yes
Yes
Start
Initialize address Set byte counter
Set Accumulator = 00
Is Accumulator
> next number
Decrement byte counter
Is byte counter = 00
Store Result
Stop
Increment addr. pointer
Transfer datum to Accumulator
Flow chart for multiplication 8- bit numbers
Flow Chart for square root of a number
No Yes
Start
Set subtraction counter to 1 Set odd number to 1
[Acc] given number
Subtract odd number from given number
Is remainder
0?
Increment subtraction counter
Odd no. = Odd no. + 2
Store subtraction counter
Error
StopStop
Start
Flow Chart for arrange numbers in ascending order.
Yes
No
No
Yes
Start
Initialize cycle counter, comparison counter and address pointer
Bring first data in Accumulator
Is [Acc.] < next?
Exchange data
Decrement comparison counter
Is comp. counter = 0?
Decrement cycle counter
Is cycle counter =
0?
Stop
Next datum to Acc.
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 address of first number in H-L pair.2003 MOV A,M Get first number in accumulator.2004 INX H Get address of second 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 address of first number in H-L pair.2003 MOV A,M Get first number in accumulator.2004 INX H Get address of second 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 address of first number in H-L pair.2003 MOV A,M Get first number in accumulator.2004 INX H Get address of second number in H-L pair.2005 ADD M Add two numbers.2006 DAA Convert to decimal2007 STA 2503H Store result at specified memory location.200A RST 5 To set Breakpoint
Subtraction:2000 LXI H,2501 Load the address of first number in H-L pair.2003 MOV A,M Get first number in accumulator.2004 INX H Get address of second number in H-L pair.2005 SUB M Subtract two numbers.2006 DAA Convert to decimal2007 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 address of 1st number in H – L pair
Get 1st number in Accumulator
Get address of 2nd number in H – L pair
Subtract two number
Convert Accumulator HEX number into Decimal 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 Load the address of first number in H-L pair.2003 MOV C,M Get first number in Register C.2004 SUB A2005 MOV B,A2006 INX H2007 ADD M2008 DAA2009 JNC NOF200C PUSH PSW200 MOV A,B200 ADI 01H200 DAAMOV B,APOP PSWNOF: DCR CJNZ 2006MOV L,AMOV H,B
5.Write an ALP to ADD 2-BCD
numbers: LXI H, 8A00MVI D, 00MOV A, M INX H ADD M DAAJNC LOOP-1INR DLOOP-1 STA 8A03MOV A, DSTA 8A04RST5
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