Lab Manual 8085 Microprocessor
Lab Manual 8085 Microprocessor
Lab Manual 8085 Microprocessor
Contents
Instructions to students
01
Expt. #1:
02
Expt. #2:
04
Expt. #3:
07
Expt. #4.
11
Expt. #5.
15
Expt. #6.
18
Expt. #7.
20
Expt. #8.
25
Expt. #9.
29
Appendix
31
Department of Physics
Indian Institute of Technology Guwahati
JulyNovember, 2015
Instructions to students
This manual contains instructions for performing nine sets of experiments in digital electronics.
Two three-hour slots have been allotted every week to perform each of these nine experiments.
All experiments have to be performed independently by each student. Each experiment has two
sections. In the first part, circuits and procedures are provided for the students to achieve the
aims specified. This compulsory part is to be performed as instructed. At the end of this
section, some exercises are given, which are within the scope of the knowledge of the students
of this course. The students have to make their own circuits (for which any standard text book
can be referred) and perform these exercises within the allotted time.
The students are expected to come prepared to the lab with the relevant background
reading required for the experiment. Devote a file folder for the lab reports. Your preparation
for the experiment (prior to entering the lab) includes a write-up containing the title,
objective(s), circuit diagram(s), truth table(s), Boolean expression(s) related to the entire
experiment including the exercises. Once inside the lab, you are expected to wire up the
circuits, generate the relevant truth table(s) and get them endorsed by the instructor. You
should then proceed to experiment with the exercises provided (for which you should have
come prepared with circuit diagrams) and demonstrate those experiments to the instructor. The
lab report of each experiment (including the exercises) is to be completed and submitted by the
end of each lab session.
During the 8th week of this course, each student has to propose a mini project based on
the knowledge and experience acquired during the earlier laboratory classes. The proposal
consisting of the basic idea behind the circuit, its use along with the relevant circuit diagram(s)
and component list has to be submitted latest by the 8th week of the semester.
Components/instruments available with the department would be provided for this work, if
specified in the proposal. Ensure availability of the components before submitting the proposal.
The students should complete and demonstrate their mini project during the last lab session.
This would be followed by an end-semester (lab) exam.
Assessment of PH 311 is based on your (i) preparation for the lab classes and
performance in the lab including the exercises, (ii) mini project work, and (iii) performance in
the end-semester practical examination. Contact any of the instructors if you have any doubts
about this course. Hope you enjoy the course.
Course Instructors PH 311 (July-November 2015).
Electronics Lab II (PH311), 2015
Page 1
EXPERIMENT #1
AIM :
a)
b)
PROCEDURE:
Wire up the circuits given below (for pin diagram of the ICs, refer the Appendix-B of
this manual).
Apply inputs A and B.
Generate the truth table for each of the circuits (0 Volts 0, 5 Volts 1).
7402
7402
7402
A
B
NOT Gate
OR Gate
7402
7402
B
7402
AND Gate
7402
A
7402
7402
Y
7402
B
XOR Gate
Page 2
De Morgans laws:
A
(i) A . B = A + B
(ii) A + B = A . B
7432
7400
A
B
Y = A+ B
Y = A.B
7404
B
A
7402
A
B
7404
Y = A+ B
7408
Y = A.B
7404
B
Fig. 1.2: Verification of De Morgans Laws
INPUT
A
B
0
0
0
1
1
0
1
1
OUTPUT (Y)
VOLT LOGIC
EXERCISE:
1. Verify that NAND gate is a universal gate.
2. Design and verify a 5-bit odd parity checker.
*****
Page 3
EXPERIMENT #2
AIM :
Design and test half adder, half subtractor, full adder, 2-to-1 multiplexer and
1-to-2 demultiplexer circuits.
APPARATUS /COMPONENTS REQUIRED:
Power Supply (1 No.), Multimeter (1 No.), IC 7404 (NOT), IC 7486 (XOR), IC 7408 (AND),
IC 7432 (OR) (two each), IC 7402 (NOR) (one) and LEDs.
PROCEDURE:
Wire up the circuits (for pin diagram of the ICs, refer the Appendix-B of this manual).
Apply inputs A and B.
Generate the truth table for each of the circuits [0 Volts 0 , 5 Volts 1].
INPUT
A
B
0
0
1
1
OUTPUT (Y)
CARRY
SUM
LOGIC
VOLT LOGIC VOLT
0
1
0
1
Page 4
OUTPUT (Y)
BORROW
DIFFERENCE
VOLT LOGIC VOLT LOGIC
0
1
0
1
0
0
1
1
0
0
1
1
OUTPUT (Y)
CARRY
SUM
VOLT LOGIC VOLT LOGIC
0
1
0
1
0
1
0
1
Page 5
EXERCISE:
1. Design and verify an adder cum substractor circuit.
2. Design and verify a nibble multiplexer.
*****
Electronics Lab II (PH311), 2015
Page 6
EXPERIMENT #3
AIM :
Design and test a NAND latch and JK flip-flop and use the latter to construct
a 4-segment shift register and ripple counter.
7400
Page 7
Page 8
Page 9
EXERCISE:
1. Design and verify decade (MOD-10) counter..
2. Design and verify Up-Down counter.
*****
Page 10
EXPERIMENT #4
AIM :
Design and test comparator, encoder and decoder circuits.
APPARATUS /COMPONENTS REQUIRED:
NOT (IC 7404-3 Nos), XOR (IC 7486-2 Nos), OR (IC 7432 -4 Nos), AND (IC 7408-2 Nos),
3-i/p NAND (IC 7410 -2 Nos), LED (10 No.), 1 K Resistance (4 No.).
PART A.: DESIGN AND TEST OF 2-BIT MAGNITUDE COMPARATOR
.PROCEDURE :
Analyze the circuit and derive the appropriate Boolean expression for each of the
outputs.
Wire up the circuit as shown in the fig 4.1 below.
Logical inputs are given in the truth table 4.1.
Test the output (using LED and multi-meter) by using all possible combinations of
inputs.
LOGIC DIAGRAM: 2 BIT MAGNITUDE COMPARATOR
Page 11
A1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
INPUT
A0 B1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
B0
A>B
VOLT LOGIC
OUTPUT
A=B
VOLT LOGIC
A<B
VOLT
LOGIC
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Analyze and wire up the circuits as shown in the circuit diagram (Fig. 4.2).
Test the output (using LED and multi-meter) by using all the possible combinations of
inputs by connecting a 5 V power supply with the help of switches.
Page 12
OUTPUT
Y1 Y2 Y3 Y4 Y5 Y6 Y7
Page 13
OUTPUT
B
D0
VOLT
D1
LOGIC
VOLT
D2
LOGIC
VOLT
LOGIC
D3
VOLT
LOGIC
EXERCISE:
1. Demonstrate a BCD validation unit (Output is 1 if inputs are from 1010 to 1111).
2. Demonstrate a 2/4 active-high line decoder (Only 1 of 4 outputs is 1 for any input S1S0)
*****
Electronics Lab II (PH311), 2015
Page 14
EXPERIMENT #5
AIM :
Perform addition / subtraction, using a 4-bit adder chip, store the result in a
static RAM IC and retrieve the stored result from the RAM IC.
APPARATUS/COMPONENTS REQUIRED:
Power Supply (1 No.), Multimeter (1 No.), 4-bit parallel adder (IC 7483), IC7486, 4-bit static
4K RAM (IC 2114 1 Nos), LED (5 Nos).
PROCEDURE:
Adding and subtracting 4-bit no.
For functional description of 4-bit static 4K RAM (IC2214) and 4-bit parallel adder (IC
7483), refer to the data sheets.
Give the two 4-bit inputs (A3A2A1A0 & B3B2B1B0) to the adder chip through XOR
gates.
For addition operation, connect CIN to ground (GND or logic 0) and for subtraction
operation, connect CIN to +5V (logic 1).
The LEDs connected to the S3S2S1S0 provide the result of the addition/subtraction
result.
Page 15
CIRCUIT DIAGRAMS:
VCC
WE
VCC
VCC
14
B0
B1
B2
B3
12
13
11
9
10
4
5
1
2
7
4
8
3
11
7
GND
CS
12
9
6
2
15
14
S0
I/O 1
S1
I/O 2
S2
I/O 3
S3
I/O 4
14
13
12
11
18
2
1
1
4
R
A
M
5
6
7
4
3
2
1
17
16
15
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
COUT
9
GND
16
7486
A0
10
A1
8
A2
3
A3
1
10
13
CIN
1
+5 V
Disconnect the data inputs I/O4 I/O3 I/O2 I/O1 from input lines and connect them to
output lines to read the data. You can also wire up four LEDs to I/O4 I/O3 I/O2 I/O1 for
reading the stored data.
For reading data, make WE pin high and CS input low.
Give address inputs of the data you have stored and observe the outputs I/O4 - I/O1.
Page 16
EXERCISE:
Make necessary changes in the circuit to store the carry of the addition of the two 4-bit
numbers.
*****
Page 17
EXPERIMENT #6
AIM :
Programming exercises using INTEL 8085A microprocessor trainer kit.
APPARATUS /COMPONENTS REQUIRED:
Dyna85 Trainer kit (P8085), Power Supply (SMPS)
BACKGROUND:
A microprocessor (P) trainer kit consists of basic units required for a simple computer,
namely, a microprocessor chip (CPU), memory (EPROM, and RAM), input device (Hex keypad and cassette tape) and output device(seven segment display unit- four address fields
followed by two data fields). Programmable peripheral chips such as 8155 and 8255 provide
the necessary interface between the P and the external circuitry. These physical units
constitute the basic hardware of the system. Software in the form of a set of instructions written
using the 8085 instruction set makes the P perform a set of desired operations. It has to keep
in mind that the instructions should be converted into the hexadecimal form before entry in this
kit. A system program (commonly called the operating system) resides in the EPROM and gets
loaded whenever the kit is switched ON. The MICROFRIEND DYNA-85 kit given in the
laboratory is based on the INTEL 8085 chip. The CPU operates at 3 MHz (system clock). The
RAM locations (C000)16 to (FFFF)16 are available for the user to enter any desired
program. The following single-key system commands are provided in the trainer kit for
facilitating easy operation of the kits.
<RES> Does hardware reset. The word FriEnd appears in the display when pressed
<DCR> Decrements memory address presently displayed
<INR> Increments memory address presently displayed
<EXEC> Starts execution of <GO> command
<SET> Used for modifying contents of RAM locations reserved for the user
<GO> Used for loading the memory address of the beginning of the program
<STEP> For executing program in single step or break-point mode
<REG> Keys let you examine or modify the CPU registers
To use these commands press <REG> and press one A, B, C, D, E, F, 8 or 9 for choosing the
registers A, B, C, D, E, Flag H or L respectively. The flag register bits are
S Z X
AC X P X C
where S is the sign flag, Z is the zero flag, AC is the auxiliary carry flag, P is the plus flag and
C is the carry flag (X means dont care).
Page 18
EXERCISE:
1. Program to implement BCD to BINARY conversion.
2. Program to simulate THROW OF A DICE (one dice with six faces)..
*****
Electronics Lab II (PH311), 2015
Page 19
EXPERIMENT #7
AIM :
Simple interfacing exercises using INTEL 8085A microprocessor trainer kit.
APPARATUS /COMPONENTS REQUIRED:
Multimeter 1 Nos , Dyna85 Trainer kit (P8085- 1 Nos), Power Supply (SMPS 1 Nos),
Flat Ribbon Cable (FRC) 1 Nos, 7-Segment LED (MAN-74A- 2 Nos) , BCD-to-SevenSegment Decoder (74LS48P 1 Nos), LEDs -10 Nos
PREREQUISITE:
Knowledge of interfacing peripherals 8155A and 8255A (Ref: Appendix C & E) which are
parts of the 8085 Microprocessor kit.
PART A: To generate binary equivalent of sequence of hexadecimal numbers from 00H to
0FH and display the binary numbers by activating 8 LEDs using 8155A interfacing
peripherals.
DIAGRAM:
Fig.7.1
CONNECTION TABLE 7.1:
Pin Number
1
2
3
4
6
7
8
9
26
Signal Name
PA3
PA2
PA1
PA0
PA7
PA6
PA5
PA4
GND
Page 20
FOR 8155A
ADDRESS OF PORT A=09H, ADDRESS OF PORT B=0AH,
ADDRESS OF PORT C=0BH, ADDRESS OF CONTROL REGISTER=08H,
PORT A SPECIFICATION = OUTPORT, MODE 0, PORT B SPECIFICATION= OUTPORT , MODE 0
MEMORY MACHINE MNEMONICS
COMMENTS
ADDRESS
CODE
C000
3E, 03
MVI A, 03H
C002
D3, 08
OUT 08H
C004
3E, 06
MVI A, 06H
C006
C008
D3, 09
76
OUT 09H
HLT
PROCEDURE:
1. For learning about interfacing peripherals 8255 & 8155, refer the Appendix-C.
2. Understand the given program and load it in the specified memory locations. Here the
control word of 8155A is set in such a way that PORT-A is configured as OUTPUT
port (in memory location C000 to C003).
3. Connect the 26-Pin FRC to J2 connector of the P kit and the 8 LEDs as specified in
the table 7.1 and in Fig. 7.1.
4. Run the program and observe the LED status.
5. Change the program to display various sequences of number from 00H-0FH (in C005
memory location) and observe the output.
PART B: To activate a 7-Segment LED and display any decimal number from 0 to 8 using
8155A.
BACKGROUND:
7-Segment LED:
The 7segment LED display is a multiple segment LED display module. It can display all
decimal digits and some letters by activate appropriate LED segments. Each of the 7 LED
segments can be controlled separately. To display a digit or letter, the desired segments are
made ON as described in the figure below. Two types of 7segment LEDs available in the
market are called common cathode and common anode 7-segment LEDs.
Common Cathode: In this type, all the 7 cathodes of LEDs are tied together to the ground.
When a +5V signal is applied to any segment, corresponding diode emits light. Thus, applying
logic 1 i.e, positive logic, to desired segments, the desired letter or decimal number can be
displayed.
Common Anode: In this type, all the 7 anodes of LEDs are tied together and connected to a
+5 V supply. A particular segment will emit light when 0 logic is applied to it.
Electronics Lab II (PH311), 2015
Page 21
PIN DIAGRAM:
Fig.7.2a
Fig.7.2b
To display digit 1 using this common cathode seven segment LED, the segment b and c
should be turned on. Corresponding binary code should be:
CONNECTION TABLE 7.2:
Data Lines :
Bits
Segment
PA7
X
NC
PA6
0
g
PA5
0
f
PA4
0
e
PA3
0
d
PA2
1
c
PA1
1
b
PA0
0
a
=06H
Similarly, by changing the content of the data lines we can display different digits.
Page 22
FOR 8155A
ADDRESS OF PORT A=09H, ADDRESS OF PORT B=0AH,
ADDRESS OF PORT C=0BH, ADDRESS OF CONTROL REGISTER=08H,
PORT A SPECIFICATION = OUTPORT, MODE 0, PORT B SPECIFICATION= OUTPORT , MODE 0
MEMORY MACHINE MNEMONICS
COMMENTS
ADDRESS
CODE
C000
3E 03
MVI A, 03H
C002
D3 08
OUT 08H
C004
C006
C008
3E 06
D3 09
76
MVI A, 06H
OUT 09H
HLT
PROCEDURE:
1. Understand the given program and load it in the specified memory locations (say from
C000). Here the control word of 8155A is set in such a way that PORT-A is configured
as OUTPUT port (in memory location C000 to C003).
2. Connect the 26-Pin FRC to J2 connector of the P kit and the 8 LEDs as specified in
the table 7.2 and in Fig 7.2.
3. Run the program and observe the LED status.
4. Change the program to display various sequences of number from 0H-FH (in C005
memory location) and observe the output.
PART C: To activate a 7-Segment LED to display any decimal number from 0 to 8 using
BCD-to-Seven-Segment Decoder (74LS48P) and 8255A.
BACKGROUND: BCD-to-Seven-Segment Decoder (74LS48P) aspects a 4 digit BCD input
and decodes it to a 7 digits output, which is usually used for 7-Segment LED display.
Page 23
Connected to Signal
Remark
FOR 8255A
ADDRESS OF PORT A=10H, ADDRESS OF PORT B=11H,
ADDRESS OF PORT C=12H, ADDRESS OF CONTROL REGISTER=13H,
PORT A SPECIFICATION = INPORT, MODE 0, PORT B SPECIFICATION= OUTPORT , MODE 0
MEMORY MACHINE MNEMONICS
COMMENTS
ADDRESS
CODE
C000
3E 98
MVI A, 98H
C002
D3 13
OUT 13H
C004
C006
C008
3E 05
D3 11
76
MVI A, 05H
OUT 11H
HLT
PROCEDURE:
1. Connect the 26-Pin FRC to J3 connector of the P kit, decoder (74LS48P) and the
seven segments LED as specified in the table 7.3 and in Fig 7.3 by using a bread board
2. Understand the given program and load the same in the specified memory locations.
3. Run the program and observe the 7 Segment LED display status.
4. Change the program to display various number from 0- 8 and observe the output.
EXERCISE:
1. Fabricate a display panel with two 7-segment display units (each capable of displaying
hexadecimal numbers.
2. Build a display panel which display decimals 00 to 99 using two seven-segment display
units
*****
Electronics Lab II (PH311), 2015
Page 24
EXPERIMENT #8
AIM :
Interfacing of 8-bit Analog to Digital and Digital to Analog cards with INTEL
8085A microprocessor kit.
APPARATUS /COMPONENTS REQUIRED:
Dyna85 Trainer kit (P8085 1 No), ADC Card (Dynalog ADC-08 1 No), DAC Card
(Dynalog DAC-01 1 No), Flat Ribbon Cable (FRC) 2 Nos, Power Supply (SMPS 2 Nos),
LEDs 10 Nos
PART A:
To convert an analog signal to digital signal by interfacing ADC card with the 8085
microprocessor kit, store the data in accumulator and then reproduce the same analog signal by
using DAC card.
Page 25
Clower in the output ports. Port As PA0, PA1, PA2 are used to multiplex channel select. PB0
PB7 are used for 8-bit digital output from ADC card. PC1, PC2 and PC3 are used as Start of
Conversion (SOC), Enable (ALE) & Output enable (OE) signals. PC4 is used end of
conversion signal (EOC).
The DAC card is plugs into the 8155 IC via 26 Pin FRC Connector. Ports A and Port B are
configured as output port and Ports C as input port. Port Bs PB0 signal gives the allow data
flow signal to the DAC. Port As PA0 PA7 are used for 8-bit digital input to the DAC card.
ADDRESS of PORTS in DYNA85 Microprocessor Kit
8255 IC
8155 IC
Control Register 13H
Control Register
08H
Port A
10H
Port A
09H
Port B
11H
Port B
0AH
Port C
12H
Port C
0BH
PROCEDURE:
1. For details of ADC card, 26 pin Flat Ribbon Cable (FRC) Pin details, interfacing 8255
& 8155 etc., refer the Appendix C , -D & -E of this manual.
2. Before switching on the power supply, check the direction of 26 pin flat cable
connector at both ends. All supply connections +5V, +12V and -12V must be applied
simultaneously to the ADC & DAC cards.
3. Load the program in the P in the specified memory locations.
4. The value in the DE register pair (in location C02D and C02E in the program) will
define the sampling rate by producing a delay. This register pair can be 0000HFFFFH.
5. Input a sinusoidal signal with peak to peak voltage less then 5V and frequency less then
30 Hz from function generator. Sample it with various sampling frequency (as
described in the previous point). [A table containing information of various values of
DE resister pair and corresponding sampling frequency is provided in Appendix-G].
6. Trace both the original input analog signal and the re-constructed signal from DAC
output in the two channel of DSO.
7. Use a signal of a particular frequency (<30Hz) and re-construct it for three set of
different sampling frequencies.
8. Compare the fast Fourier transform (FFT) of the input signal and the reconstructed
signal for different sampling frequency. Analyse the effect of sampling frequency.
Electronics Lab II (PH311), 2015
Page 26
DATA
MNEMONIC
COMMENT
C000
3E 8A
MVI A, 8AH
C002
D3 13
OUT 13H
C004
3E 03
MVI A 03H
C006
D3 08
OUT 08H
C008
C00A
3E 01
D3 0A
MVI A 01H
OUT 0AH
3E 00
MVI A 00H
D3 10
OUT 10H
C010
C012
3E 06
D3 12
MVI A, 06H
OUT 12H
C014
3E 04
MVI A, 04H
C016
D3 12
OUT 12H
DB 12
E6 10
FE 10
C2 18 C0
IN 12H
ANI 10H
CPI 10H
JNZ LOOP
C021
C023
C025
3E 0B
D3 12
DB 11
MVI A, 08H
OUT 12H
IN 11H
C027
D3 09
OUT 09
C00C
C00D
C00E
C00F
C018
C01A
C01C
C01E
LEBEL
LOOP1
LOOP
Page 27
C029
CD 6E 03
CALL
MODIDT
C02C
11 FF FF
LXID FFFFH
C02F
CD F1 05
C032
C3 0C C0
CALL
DELAY
JMP LOOP1
Jump to C00C
C035
76
HLT
Stop
PART B:
To generate a square wave signal of any frequency between 1 Hz to 10 Hz using DAC Card.
PROCEDURE:
1. With the experience of driving the DAC card in the previous experiment, write a program
to generate square wave of any frequency between 1Hz to 10 Hz using a DAC card.
2. Before switching on the power supply, check the direction of 26 pin flat cable connector at
both ends. All voltages (+5, +12 and -12 V) must be applied simultaneously to the DAC.
3. Load the program in Microprocessor in the specified memory locations.
4. Connect the output of DAC card to Digital Storage Oscilloscope (DSO).
5. Trace the signal from the DSO.
EXERCISE:
1
2
Page 28
EXPERIMENT #9
AIM :
Interfacing a stepper motor with 8085A microprocessor kit and its control.
APPARATUS /COMPONENTS REQUIRED:
Dyna85 trainer kit (8085 P - 1 No), stepper motor controller card (STP-PIO 1 No) , stepper
motor ( 1 No) , power supply (SMPS - 1 Nos)
PROCEDURE:
1. To understand the working of the stepper motor controller card / 26 pin FRC pin details /
interfacing details of 8255 or 8155 to the P etc., refer Appendix-C, -D, -E & -F.
2. Feed and run the given program using the 8085 P kit. You can write your own program
to run the stepper motor in free running and step wise mode. Try to run the stepper motor
in continuous mode / step mode with different speed (rpm).
3. Perform the following operations: Activate the motor at desired rpm value, make it rotate
in both directions (clock-wise and anti clock-wise), interrupt it while in motion and
restart, set it for desired no. of revolutions, etc.
4. Excitation sequence of the stepper motor: Following hexadecimal numbers
(excitation Sequence) are to be entered in the specified memory locations
Memory Location
Excitation code
C0E0 to C0E4
06 0A 09 05 00
C1E0 to C1E4
05 09 0A 06 00
A)
Direction of rotation
For clock-wise movement
For anti clock-wise movement
Free running (continuous) mode: The motor will rotate continuously until the RST
button is pressed. Speed control can be implemented by calling a delay sub-routine after
each step of the rotation)
Program:
ADDRESS
D000
D002
D004
OPCODE
3E 80
D3 13
06 04
D006
21 E0 C1
D009
D00A
D00C
7E
D3 10
11 05 05
D00F
CD F1 05
LABEL
START
MNEMONICS
MVI A 80
OUT 13
MVI B, 04
LXI H, C1E0
BACK:
MOV A, M
OUT 10
LXI D, 0505
CALL 05F1
COMMENTS
: Configuring Control register
: Counts excitation sequence
: Initialize memory pointer
C1E0 for clock-wise, and
C0E0 for anti clock-wise
: Get the Excite code
: Send Excite code
:Calling system defined delay
routine to control speed (by
varying the lower order operand
between 00 and FF.
Page 29
D012
D013
D014
D017
D019
23
05
C2 09 D0
C3 04 D0
FF
INX H
DCR B
JNZ BACK
JMP START
RST 7
: Increment pointer
: Repeat 4 times
Load the program in the above mentioned memory locations and execute the program.
Change the direction of movement by changing the program at location D006.
Change the rotation speed by changing the lower order operands from 00 FF of the
LXI D instruction.
B) Step-wise operation mode: In this mode, the motor will make a defined number of steps
which can be implemented by adding an additional step variable (which defines number
of steps) and a decrement command followed by a jump on non-zero command in
program given above.
Load the program in the mentioned memory locations and execute the program.
To change the number of steps, change the operands of the MVI C instruction.
Change the direction of movement by changing the program at location D008.
Change the speed of rotation by changing the lower order operands from 00 FF of
the LXI D instruction.
Program:
ADDRESS
D000
D002
D004
D006
OPCODE
3E 80
D3 13
0E 0A
06 04
LABEL
D008
21 E0 C1
D00B
D00C
D00E
7E
D3 10
11 05 05
D011
CD F1 05
CALL 05F1
D014
D015
D016
D019
D01A
D01D
D020
23
0D
CA 20 D0
05
C2 0B D0
C3 06 D0
FF
INX H
DCR C
JZ END
DCR B
JNZ BACK
JMP START
RST 7
START
MNEMONICS
MVI A 80
OUT 13
MVI C 0A
MVI B, 04
LXI H, C1E0
BACK
END
MOV A, M
OUT 10
LXI D, 0505
COMMENTS
:Configuring control register
: Counts number of steps
:Counts excitation seq.
: Initialize memory pointer
C1E0 for clock-wise and
C0E0 for anti clock-wise
: Get the Excite code
: Send Excite code
:Calling system defined delay
routine to control the speed
(by varying the lower order
operand from 00 FF
: Increment pointer
: Check no of steps over? If
yes, then jump to END.
: Repeat 4 times
EXERCISE:
1. Write and test a program to simulate a car wiper using a stepper motor.
2. Design of a digital clock (seconds hand only) using 8085 P kit and the stepper motor.
******
Electronics Lab II (PH311), 2015
Page 30
A P P E N D I X A : BREAD BOARD
The breadboard consists of two terminal strips and two bus strips (often broken in the centre).
Each bus strip has two rows of contacts. Each of the two rows of contacts is a node. That is,
each contact along a row on a bus strip is connected together (inside the breadboard). Bus
strips are used primarily for power supply connections, but are also used for any node requiring
a large number of connections. Each terminal strip has 60 rows and 5 columns of contacts on
each side of the centre gap. Each row of 5 contacts is a node.
You will build your circuits on the terminal strips by inserting the leads of circuit components
into the contact receptacles and making connections with 22-26 gauge wire. There are wire
cutter/strippers and a spool of wire in the lab. It is a good practice to wire +5V and 0V power
supply connections to separate bus strips.
Fig. A-1 : Schematic diagram of a breadboard. The lines indicate connected holes.
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
ADC 0809 :
The ADC 0808 (or 0809) is an 8-bit A/D converter (ADC) with 8-channel multiplexer. It is
a monolithic CMOS chip manufactured by National Semiconductors. The ADC uses
successive approximation as the conversion technique. It does not require external zero
and full scale adjustments. There is no terminal available for sample and hold between the
multiplexer and comparator stages. Figures displayed below show the schematic diagram
and the timing diagram of ADC 0808/0809. The device operates with a single 5 V d.c.
supply. The conversion time is 100 ns at clock frequency 640 KHz. The resolution is 8
bits. Error 1 LSB.
Page 37
Page 38
Page 39
The hardware setup consists of a microprocessor trainer kit and stepper motor interface board.
The stepper motor interface consists of driver transistors (current amplifiers) for energizing
stepper motor windings and address decoding circuit. The microprocessor outputs the binary
sequence (programmed) through the data bus, which is converted in to current pulses by the
driver transistors and used for driving the stepper motor.
Fig. F-1
The STP-PIO card interfaces with the microprocessor kit and has the capability to drive 12 V
d.c., 5 A/phase stepper motor and has the choice of two rotating directions. The card can be
used for varying the rotation speeds in terms of 00H to FFH steps, which can be programmed.
The dynamic torque is mainly controlled by the drive circuit and the output transistors can give
up to 3 A current. The maximum working temperature of the stepper motor is 30 to 40 C
above the ambient. The schematic diagram of the stepper motor is shown as in Fig.F-2.
Page 40
Switching Logic 4
Input Sequence
Step
SW1
SW2
Ph-1
Ph-2
Hex Value
A1
B1
A2
B2
05
09
0A
06
05
The control s/w is in 8085 assembly language. The control word is written to the 8255 IC to
select speed, direction and motor ON/OFF states. The numbers of rotation steps can also be
programmed. After program execution, the motor starts and rotates in the selected direction
with the chosen speed. It stops after the specified number of steps. Stepper motors (four phase)
available in the lab require 12V DC and 5 A/phase. The step angle of the stepper motor is -1.8
with an error of up to 5% and their holding torque is 2 kg cm.
Page 41
TABLE G
Frequency(Hz)
250
225
200
175
150
125
100
75
50
25
20
15
10
5
Time
period(ms)
4.0000
4.4444
5.0000
5.7143
6.6667
8.0000
10.0000
13.3333
20.0000
40.0000
50.0000
66.6667
100.0000
200.0000
Value in Location
C02D
C02E
01
3C
82
DC
5E
05
05
A5
F9
F0
F0
F5
A2
F0
00
00
00
00
01
02
03
04
07
11
16
18
30
60
The Value in
DE-resister
pair
0001
003C
0082
00DC
01FE
0205
0305
04A5
07F9
11F0
16F0
18F5
30A2
60F0
*****
Page 42