Professional Documents
Culture Documents
YSPM’s
Yashoda Technical Campus,
Faculty of Engineering, Satara.
List of Experiments
10
EXPERIMENT NO : 01
Study of architecture of microprocessor 8085
Aim:
Objective:
Study of architecture of microprocessor 8085.
Apparatus Required
Theory:
Internal Architecture of 8085 Microprocessor
the instruction registers are specifically to store the instructions that are fetched from
memory.
There is an Instruction decoder which decodes the information present in the Instruction
register for further processing.
Timing and Control Unit
Timing and control unit is a very important unit as it synchronizes the registers and flow of
data through various registers and other units.
This unit consists of an oscillator and controller sequencer which sends control signals
needed for internal and external control of data and other units.
The oscillator generates two-phase clock signals which aids in synchronizing all the registers
of 8085 microprocessor.
Program Counter and Stack Pointer
Program counter is a special purpose register . Program counter is a 16-bit register A
program counter stores the address of the next instruction to be executed.
In other words, the program counter keeps track of the memory address of the instructions
that are being executed by the microprocessor and the memory address of the next
instruction that is going to be executed.
Microprocessor increments the program whenever an instruction is being executed, so that
the program counter points to the memory address of the next instruction that is going to be
executed.
Stack pointer is also a 16-bit register which is used as a memory pointer . Stack pointer
maintains the address of the last byte that is entered into stack. Each time when the data is
loaded into stack, Stack pointer gets decremented. Conversely it is incremented when data is
retrieved from stack.
Interrupt control
Consider that a microprocessor is executing the main program. Now whenever the interrupt
signal is enabled or requested the microprocessor shifts the control from main program to
process the incoming request. after the completion of request, the control goes back to the main
program. 8085 has five Interrupt . INTR ,RST 7.5 , RST 6.5 ,RST 5.5 ,TRAP. INTR is maskable 8080A
compatible interrupt. RST5.5 is a maskable interrupt. RST6.5 is a maskable interrupt. RST7.5 is a
maskable interrupt. TRAP is a non-maskable interrupt.
Serial Input/output control
The input and output of serial data can be carried out using 2 instructions in 8085.
SID-Serial Input Data SOD-Serial Output Data . Two more instructions are used to perform
serial-parallel conversion needed for serial I/O devices. SIM (Set Interrupt Mask) RIM (Read
Interrupt Mask )
Address buffer and Address-Data buffer
The contents of the stack pointer and program counter are loaded into the address buffer and
address-data buffer. These buffers are then used to drive the external address bus and address-
data bus. As the memory and I/O chips are connected to these buses, the CPU can exchange
desired data to the memory and I/O chips. The address-data buffer is not only connected to the
external data bus but also to the internal data bus which consists of 8-bits. The address data
buffer can both send and receive data from internal data bus.
Address bus and Data Bus
Address bus
8085 processor requires 16-bit address bus as the memory addresses are 16-bit wide. The 8 most
significant bits of the address are transmitted with the help of address bus and the 8 least
significant bits are transmitted with the help of multiplexed address/data bus.
The eight-bit data bus is multiplexed with the eight least significant bits of address bus. The
address/data bus is time multiplexed. for few microseconds, the 8 least significant bits of address
are generated, while for next few seconds the same pin generates the data. This is called Time
multiplexing.
Data Bus
The Data bus present in the microprocessor is also 8-bits wide .8-bits of data can be transmitted
from or to the microprocessor .
Conclusion :
In this experiment ,we have studied the Architecture of 8085 microprocessor is completed
EXPERIMENT NO : 02
Assembly language program for addition of 8 bit and 16 bit number
based on 8085 microprocessor
Aim:
Objective:
Write a Assembly language program for addition of 8 bit and 16 bit number based on 8085
microprocessor
Apparatus Required
1) 8085 Simulator 2) PC
PROGRAM 1
8 bit Decimal Addition:
Steps:
1 . Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Add the two numbers and store the result in 200B.
5. Go back to Monitor
FLOWCHART:-
Start
st
Get the 1 no.
nd
Get the 2 no.
End
E. &T.C. DEPT ., YTC, SATARA Page 7
Microprocessor and Microcontroller LAB
PROGRAM:-
PROGRAM 1
16 bit Decimal Addition:
Steps:
1 . Initialize HL Reg. pair with address 2000H where the first number is lying.
2.Save first 16-bit number in DE.
3.Get the second number in HL pair .
4.Add DE and HE pair and store the result Store 16-bit result in memory locations 2004H and
2005H.
5.Go back to Monitor
PROGRAM:-
Output: 55 (2004)
55 (2005)
REULTS:-
Thus the program to add two 8-bit & two 16-bit numbers was executed
E. &T.C. DEPT ., YTC, SATARA Page 8
Microprocessor and Microcontroller LAB
EXPERIMENT NO : 03
Assembly language program for subtraction of 8 bit and 16 bit number based on
8085 microprocessor
Aim:
Subtraction of 8 bit and 16 bit number based on 8085 microprocessor
Objective:
Write a Assembly language program for subtraction of 8 bit and 16 bit number based on
8085 microprocessor
Apparatus Required
1) 8085 Simulator 2) PC
PROGRAM 1
8 bit Decimal Addition:
Steps:
1 . Initialize HL Reg. pair with address where the first number is lying.
6. Store the number in accumulator.
7. Get the second number.
8. Subtract the two numbers and store the result in 200B.
9. Go back to Monitor
FLOWCHART:-
Start
st
Get the 1 no.
nd
Get the 2 no.
End
E. &T.C. DEPT ., YTC, SATARA Page 9
Microprocessor and Microcontroller LAB
PROGRAM:-
8 bit Decimal Substraction
Observation:
Input: HL = 9876H BC = 5432H
REULTS:-
Thus the program for subtraction of two 8-bit & two 16-bit numbers was executed
EXPERIMENT NO : 04
Assembly language program for Multiplication of 8 bit based on 8085 microprocessor
Aim:
Objective :
Apparatus Required
1) 8085 Simulator 2) PC
PROGRAM
Steps:
1) Start the program by loading HL register pair with address of memory location.
2) Move the data to a register (B register).
3) Get the second data and load into Accumulator.
4) Add the two register contents.
5) Check for carry.
6) Increment the value of carry.
7) Check whether repeated addition is over and store the value of product and carry in
memory location.
8) Terminate the program.
MVI D, 00 Initialize register D to 00
MVI A, 00 Initialize Accumulator content to 00
LXI H, 4150H
MOV B, M Get the first number in B - reg
INX H
MOV C, M Get the second number in C- reg.
LOOP: ADD B Add content of A - reg to register B.
JNC NEXT Jump on no carry to NEXT.
INR D Increment content of register D
NEXT: DCR C Decrement content of register C.
JNZ LOOP Jump on no zero to address
STA 4152H Store the result in Memory
MOV A, D Move the content of D register to Accumulator
STA 4153H Store the MSB of result in Memory
HLT Terminate the program.
Observation:
Input: FF (4150)
FF (4151)
Output: 01 (4152)
FE (4153)
REULTS:-
EXPERIMENT NO : 05
Assembly language program for Division of 8 bit based on 8085 microprocessor
Aim:
Objective :
Apparatus Required
2) 8085 Simulator 2) PC
PROGRAM
Steps:-
1) Start the program by loading HL register pair with address of memory location.
2) Move the data to a register (B register).
3) Get the second data and load into Accumulator.
4) Compare the two numbers to check for carry.
5) Subtract the two numbers.
6) Increment the value of carry.
7) Check whether repeated subtraction is over and store the value of product and carry in memory
location.
8) Terminate the program.
LXI H, 4150
MOV B, M Get the dividend in B – reg.
MVI C, 00 Clear C – reg for quotient
INX H
MOV A, M Get the divisor in A – reg.
NEXT: CMP B Compare A - reg with register B.
JC LOOP Jump on carry to LOOP
SUB B Subtract A – reg from B- reg.
INR C Increment content of register C.
JMP NEXT Jump to NEXT
LOOP: STA 4152 Store the remainder in Memory
MOV A, C Move the Content of C register to Accumulator
STA 4153 Store the quotient in memory
HLT Terminate the program.
Observation:
Input: FF (4150)
FF (4151)
RESULT
EXPERIMENT NO : 06
Apparatus Required
1) 8051 Simulator 2) PC
A) Addition Program:
ALGORITHM:
Observation:
Input A = 02 H ; B=05H
Output D:20H =07H
B) Subtraction Program
Observation:
Input A = 07 H ; B=02H
Output D:20H =05H
RESULT
Thus the program to for addition and subtraction using 8051 assemble language executed
EXPERIMENT NO : 07
Interfacing of stepper motor to 8051 microcontroller
Aim: Write an assembly language program for interfacing stepper motor with 8051
Apparatus Required
THEORY:
A Stepper Motor or a step motor is a brushless, synchronous motor which divides a full rotation
into a number of steps. Unlike a brushless DC motor which rotates continuously when a fixed DC
voltage is applied to it, a step motor rotates in discrete step angles. The Stepper Motors therefore
are manufactured with steps per revolution of 12, 24, 72, 144, 180, and 200, resulting in stepping
angles of 30, 15, 5, 2.5, 2, and 1.8 degrees per step.
The stepper motor can be controlled with or without feedback. Stepper motors work on the
principle of electromagnetism. There is a soft iron or magnetic rotor shaft surrounded by the
electromagnetic stators. The rotor and stator have poles which may be teethed or not depending
upon the type of stepper. When the stators are energized the rotor moves to align itself along with
the stator (in case of a permanent magnet type stepper) or moves to have a minimum gap with the
stator (in case of a variable reluctance stepper). This way the stators are energized in a sequence to
rotate the stepper motor.
PROGRAM:
ORG 0000H
MOV A,#66H
LOOP:MOV P2,A
ACALL DELAY
RR A
SJMP LOOP
DELAY:MOV R5,#0AH
AGAIN:MOV R3,#0FFH
BACK:DJNZ R3,BACK
DJNZ R5,AGAIN
RET
END
EXPERIMENT NO : 08
assembly code program to generate a delay of 10ms
Aim : -
Theory
Algorithm
PROGRAM:
CLR P1.0
MOV TMOD,#01H
HERE:MOV TL0,#00H
MOV TH0,#0DCH
SETB TR0
AGAIN:JNB TF0,AGAIN
CLR TR0
CLR TF0
END
Observation:
RESULT
Thus the program to for generation of delay using 8051 assemble language executed