MICROPROCESSOR Lab
MICROPROCESSOR Lab
MICROPROCESSOR Lab
(EE-319-F)
LAB MANUAL
V SEMESTER
The ALU performs the arithmetic and logical operation, addition, subtraction, logical AND, OR, EX-
OR, Complement, Increment, Decrement, shift, clear.
2.Timing and Control Unit:-
It generates timing and control signals, which are necessary for the execution of instruction.
3.Registers: -
These are used for temporary storage of data and instruction. INTEL 8085 has following registers: -
i) One 8 bit accumulator
ii) Six 8 bit registers (B, C, D, E, H, L)
iii) One 16 bit stack pointer, SP
iv) One 16 bit program counter, PC
v) Instruction register
vi) Status register
vii) Temporary registers
PSW
This 8-bit program status word includes status flags and three undefined bits.
36 12
RST-IN AD0 13
1 AD1 14
X1 AD2 15
AD3 16
2 AD4 17
X2 AD5 18
5 AD6 19
6 SID AD7 21
TRAP A8 22
9 A9 23
8 RST 5.5 A10 24
7 RST 6.5 A11 25
RST 7.5 A12 26
10 A13 27
INTR A14 28
11 A15
INTA 30
29 ALE 31
S0 WR 32
33 RD 34
S1 IO/M 3
39 RST-OT 37
HOLD CLKO 4
35 SOD 38
READY HLDA
PIN CONFIGURATION
A8-A15 (Output):-
These are address bus and used for the most significant bits of memory address.
AD0-AD7 (Input/Output):-
These are time multiplexed address data bus. These are used for the least significant 8 bits of
the memory address during first clock cycle and then for data during second and third clock
cycle
ALE (Address Latch Enable)
It goes high during the 1st clock cycle of a machine. It enables the lower 8 bits of address to
be latched either in the memory or external latch.
IO/M
It is status signal, when it goes high; the address on address bus is for I/O device, otherwise
for memory.
So, S1
These are status signals to distinguish various types of operation
S1 So Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Fetch
RD (output)
It is used to control read operation.
WR (output)
It is used to control write operation
HOLD (input)
It is used to indicate that another device is requesting the use of address & data bus.
HLDA (output)
It is acknowledgement signal used to indicate HOLD request has been received.
INTR (input)
When it goes high, microprocessor suspends its normal sequence of operations.
INTA (output)
It is interrupt acknowledgement signal sent by microprocessor after INTR is received.
Clk (output)
It is clock output for user. Its frequency is same at which processor operates.
SID (input)
It is used for data line for serial input.
SOD (output)
It is used for data line for serial output.
Vcc
+5 volts supply
Vss
Ground reference
EXPERIMENT NO .1 (B)
INTA(Output): Pin no. 24 Interrupt acknowledge. On receiving interrupt signal the processor issues
an interrupt acknowledge signal. It is active LOW.
ALE(Output) : Pin no. 25 Address latch enable. It goes HIGH during T1. The microprocessor sends
this signal to latch the address into the Intel 8282/8283 latch.
DEN(Output) : Pin no. 26 Data enable. When Intel 8286/8287 octal bus transceiver is used this
signal acts as an output enable signal. It is active LOW.
DT/R(Output) : Pin no. 27 Data Transmit/Receive. When Intel 8286/8287 octal bus transceiver is
used this signal controls the direction of data flow through the transceiver. When it is High data are
sent out. When it is LOW data are received.
M/IO(Output) : Pin no. 28.Memory or I/O access. When it is HIGH the CPU wants to access
memory. When it is LOW the CPU wants to access I/O device.
WR (Output) : Pin no. 29. Write. When it is LOW the CPU performs memory or I/O write Operation.
HLDA (Output) : Pin no. 30.HOLD acknowledge. It is issued by the processor when it receives
HOLD signal. It is active HIGH signal. When HOLD request is removed HLDA goes LOW.
HOLD (Output) : Pin no. 31.Hold. when another device in microcomputer system wants to use the
address and data bus, it sends a HOLD request to CPU through this pin. It is an active HIGH signal.
S0,S1,S2(Output) : Pin nos. 26,27,28.status signals. These signals are connected to the bus
controller Intel 8288.The bus controller generates memory and I/O access control signals. Table
for status signals is :
S2 S1 S0
0 0 0 Interrupt acknowledge
0 0 1 Read data from I/O port
0 1 0 Write data into I/O port
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
1 1 1 Passive state.
LOCK(Output) : Pin no. 29.It is an active LOW signal. When it is LOW all interrupts are masked
and no HOLD request is granted. In a multiprocessor system all other processors are informed by
this signal that they should not ask the CPU for relinquishing the bus control.
RQ / GT1, RQ / GT0 (Bidirectional) : Pin no. 30,31. Local bus Priority control. Other
processors ask the CPU through these lines to release the local bus. RQ / GT1 has higher priority
than RQ / GT0
U1
16
AD0 15
22 AD1 14
19 READY AD2 13
21 CLK AD3 12
RESET AD4 11
18 AD5 10
INTR AD6 9
AD7 8
AD8 7
AD9 6
AD10 5
AD11 4
AD12 3
AD13 2
AD14 39
AD15 38
A16/S3 37
A17/S4 36
A18/S5 35
A19/S6
34
BHE/S7
26
S0 27
S1 28
31 S2
30 RQ/GT0 32
17 RQ/GT1 RD 29
23 NMI LOCK 25
33 TEST QS0 24
MX QS1
8086
PIN DIAGRAM OF 8086
THEORY (Program)
START
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
INPUT DATA
7501- 13H
7502- 12H
OUTPUT DATA
7503- 25H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
THEORY (Program)
START
Exchange DE HL
No
If carry
Yes
Increment reg. C
Move C to A
Store Accumulator
Store HL result
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
INPUT DATA
7601 : 13H
7602 : 31H
7603 : 12H
7604 : 10H
OUTPUT DATA
7500 : 25H
7501 : 41H
7502 : 00H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
THEORY(Program) :
START
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
INPUT DATA
7501 : 20H
7502 : 10H
OUTPUT DATA
7503 : 10H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
THEORY (Program) :
Memory Machine Mnemonics Operands Comments
Address Code
7000 2A, 01,75 LHLD 7501 H Get 1st 16 bit no. in HL pair
7003 EB XCHG Exchange HL pair with DE.
7004 2A, 03,75 LHLD 7503 H Get 2nd 16 bit no. in HL pair
7007 7B MOV A, E Get lower byte of ist no.
7008 95 SUB L Subtract lower byte of 2nd no.
7009 6F MOV L, A Store the result in reg. L
700A 7A MOV A, D Get higher byte of Ist no.
START
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter -2
Register Name
INPUT DATA
7501 : 30H
7502 : 40H
7503 : 10H
7504 : 20H
OUTPUT DATA
7505 : 20H
7506 : 20H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
AIM : WRITE A PROGRAM USING 8085 FOR MULTIPLICATION OF TWO 8-BIT NUMBERS
BY BIT ROTATION METHOD & VERIFY.
THEORY(Program)
START
NO IS
Carry from
Multiplier?
YES
Count = Count - 1
NO IS
Count =0?
YES
Store Product
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
INPUT DATA
7501- 25H
7502- 00H
7503- 05H
OUTPUT DATA
7504- B9H
7505- 00H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
AIM : WRITE A PROGRAM USING 8085 FOR DIVISION OF TWO 8-BIT NUMBERS BY
REPEATED SUBTRACTION METHOD & TEST FOR TYPICAL DATA.
THEORY (Program) :
START
NO
IS
Dividend >
Divisor?
YES
Quotient is in reg. C
A= Dividend - Divisor
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
LAB MANUAL ( V SEM ECE) Page 27
MP LAB (EE-329-F)
INPUT DATA
7501- Divisor
7502-Dividend
OUTPUT DATA
7503-Remainder
7504-Quotient
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
EXPERIMENT NO. 5
THEORY(Program):
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter
Name
Register
START
YES
Is
remainder=0
Or negative
NO Store the result
INPUT DATA
2500-10H
2501- 00H
OUTPUT DATA
2550- 04H
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
EXPERIMENT NO. 6
AIM : WRITE A PROGRAM USING 8086 FOR DIVISION OF A DEFINED DOUBLE WORD
BYANOTHER WORD & VERIFY.
THEORY(Program)
START
Get Divisor in CX
END
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S O
Enter Enter EB/AX
SRC-SEGM Address
Enter Starting Address
Program Address Next
Write Program Write Program
Esc Reset
G GO
Enter-enter Starting Address
SRC-SEGM Add Fill
Enter Reset
Prog. Address O
Enter EB/AX
S
Enter Result Address
Any key-2
Enter-2
Register Name
INPUT DATA
AX : 5678H
DX : 1234H
CX : 2525H
OUTPUT DATA
AX : 7D77(Quotient)
DX : 0145(Remainder)
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
EXPERIMENT NO. 7
AIM : WRITE A PROGRAM USING 8086 FOR COPYING 12 BYTES OF DATA FROM SOURCE
TO DESTINATION & VERIFY.
THEORY(Program)
START
Get Count in CX
Increment in SI
Increment in SI
Move bytes
NO IS
Count =0?
YES
END
INPUT DATA
0300 : 0B
0301 : 00 030B : 0A
0302 : 03 030C : 0B
0303 : 04 030D : 0E
0304 : 05
0305 : 06
0306 : 15 OUTPUT DATA
0307 : 07 0202 : 03
0308 : 12 0203 : 04
0309 : 08 0204 : 05
030A : 09 0205 : 06
LAB MANUAL ( V SEM ECE) Page 36
MP LAB (EE-329-F)
0206 : 15 020A : 09
0207 : 07 020B : 0A
0208 : 12 020C : 0B
0209 : 08 020D : 0E
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
Q 5 Explain DAD rp ?
Ans: Add register pair to HL pair.
EXPERIMENT NO.8
THEORY(Program)
START
Move count in CX
Decrement CX
Increment SI
No
No IS
Count =0?
Decrement Count
No IS END
Count =0?
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
INPUT DATA
0300 : 05
0301 : 00
0302 : 20
0303 : 25
0304 : 28
0305 : 15
0306 : 07
OUTPUT DATA
0302 : 28
0303 : 25
0304 : 20
0305 : 15
0306 : 07
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
1. What is microprocessor?
Ans It is a program controlled semi conductor device (IC), which fetches, decodes and execute
instructions.
3. What is a bus?
Ans Bus is a group of conducting lines that carries data, address and control signals.
7. Define T-state?
Ans T-state is defined as one subdivision of operation performed in one clock period. These
subdivisions are internal states synchronized with the system clock, and each T-state is precisely
equal to one clock period.
EXPERIMENT NO.9
AIM : WRITE A PROGRAM TO INTERFACE ADC & DAC WITH 8085 & DEMONSTRATE
GENERATION OF SQUARE WAVE.
DESCRIPTION: A D/A converter chip DAC 0800 has been provided on the board of M85-07 to
enable the user to have analog output. This can be used for generating various waveforms or for any
closed loop applications. The chip has been used in I/O mapped mode and has an address of (A0-A7),
i.e any of A0 to A7 can be used as an address. This chip has been designed to give an output of 0 to 8
Volts. The output of DAC 0800 is coming at Pin No.13 of connector CN11.
THEORY(Program)
START
Clear LCD
Delay called
Dealy Called
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
1. What is ALE?
Ans The ALE (Address latch enable) is a signal used to demultiplex the address and data lines using an
external latch. It is used to enable the external latch.
3. Give some examples of port devices used in 8085 microprocessor based system?
Ans The various port devices used in 8085 are 8212,8155,8156,8255,8355,8755.
5. What operation is performed during first T-state of every machine cycle in 8085?
Ans In 8085, during the first T-state of every machine cycle the low byte address is latched into an
external latch using ALE signal.
9. What is TRAP?
Ans The TRAP is a non-maskable interrupt of 8085. It is not disabled by processor reset or after
recognition of interrupt.
10. How clock signals are generated in 8085 and what is the frequency of the internal clock?
Ans The 8085 has the clock generation circuit on the chip but an external quartz crystal or LC circuit or
RC circuit should be connected at the pins X1 andX2. The maximum internal clock frequency of
8085 is 3.03MHz.
EXPERIMENT No. 10
AIM: - To study the stepper motor and to execute microprocessor computer based control of the same
by changing number of steps, the direction of rotation and speed.
APPARATUS USED:- Stepper Motor Kit, µP Kit, Interface Cord and Connecting Leads.
THEORY:- The stepper motor is a special type of motor which is designed to rotate through a specific
angle called step for each electrical pulse received from its control unit. It is used in digitally controlled
position control system in open loop mode. The input command is in form of a train of pulses to turn the
shaft through a specified angle. the main unit is designed to interface with µP 8085 kit. The stepper motor
controller card remains active while the pulse sequence generator disabled as given plug is connected with
µp interface socket . Following programme enables the stepper motor to run with µp 8085 kit. For two
phase four winding stepper motor only four LSB signals are required.
CIRCUIT DIAGRAM:-
DIRECTION 12 V
CW CCW
FIELD
PHASE
PULSE STEPPER
and
PHASE MOTOR
ROTOR
SEQ
DRIVER
GEN.
Y GRD TRIG
PROCEDURE:-
Connect the stepper motor with µp 8085 kit as shown in fig. press EXMEM key to enter the address as
given then press NEXT to enter data .
ADDRESS DATA
2000 3E 80 MVI A,80 Initialize port A as output port.
2002 D3 03 OUT 03 OB
2004 3E F9 Start MVI AFA
2006 D3 00 OUT 00 Output code for step o.
2008 CD 3020 call delay delay between two steps.
200B 3E F5 MVI A, F6 Location reserve for current Delay
200D D3 OO OUT OO Output code for step 1.
LAB MANUAL ( V SEM ECE) Page 45
MP LAB (EE-329-F)
Press FILL key to store data in memory area. This will complete the pulse sequence generation. To delay
programme route, first press EXMEM to start, a dot sign will appear in address field then enter the start
address. Press NEXT to enter data.
ADDRESS DATA
2030 11 00 00 LXI D 00 00 Generates a delay.
2033 CD BC 03 CALL DELAY
2036 11 00 00 LXI D 00 00 Generates a delay.
2039 CD BC 03 CALL DELAY
203C C9 RET
Press FILL to save data.to execute the programme press the key GO .The above programme is to rotate
the motor at a particular as defined by the given address. Changing the following contents will change the
motor speed.
ADDRESS DATA
2030 11 00 20 AND 2036 TO SIMILAR 11 00 20
CHANGE 11 00 10 TO 11 00 10
CHANGE 11 00 05 TO 11 00 05
CHANGE 11 00 03 TO 11 00 03.
The motor direction depends upon codes FA, F6 ,F5 AND F9.Change in following codes will change the
motor direction.
ADDRESS DATA
2005 3E F9 TO 3E FA
200C 3E F5 TO 3E F6
2012 3E F6 TO 3E F5
2019 3E FA TO 3E F9.
PRECAUTION:-
1. Make the connection of motor with µp kit properly.
2. Do not change the motor direction at high speed.
LAB MANUAL ( V SEM ECE) Page 46
MP LAB (EE-329-F)
1. Define stack?
Ans Stack is a sequence of RAM memory locations defined by the programmer.
4. How the 8085 processor differentiates a memory access and I/O access?
Ans The memory access and I/O access is differentiated using IO/M signal. The 8085 processor asserts
IO/M low for memory operation and high for I/O operations.
8. What is a port?
Ans The port is a buffered I/O, which is used to hold the data transmitted from the microprocessor to
I/O devices and vice versa.
EXPERIMENT NO. 11
AIM : WRITE A PROGRAM TO CONTROL THE TRAFFIC LIGHT SYSTEM USING 8085 &
8255 PPI.
DESCRIPTION: This Program controls light of one square. By changing the delay between two
signals one can change the speed of traffic. 8255 Port Address.
Port A- 00H
Port B -01H
Port C- 02H
Control Word 03H
THEORY(Program)
PROCEDURE:-
SCIENTECH
ANSHUMAN Reset
S Exmem
Enter Enter Starting Address
Program Address Next
Write Program Write Program
Execution Steps Execution Steps
Esc Reset
G GO
Enter-enter Starting Address
Prog. Address Fill
Enter Reset
S Exmem
Enter Result Address
Any key-2
Enter-2
Register Name
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
3. What is USART?
Ans The device which can be programmed to perform Synchronous or Asynchronous serial
communication is called USART (Universal Synchronous Asynchronous Receiver Transmitter).
Eg: INTEL 8251
9. What is GPIB?
Ans GPIB is the General Purpose interface Bus. It is used to interface the test instruments to the system
controller.