Electronics Lab Manual
Electronics Lab Manual
Contents
Instructions to students 03
Expt. #2: Half Adder, Half Subtractor, Full Adder, Multiplexer and Demultiplexer 06
Expt. #3: NAND latch, J-K Flip-flop, shift register and ripple counter 09
Expt. #8. Interfacing of 8-bit A/D and D/A cards with 8085A P kit 28
Expt. #9. Interfacing and control of a stepper motor with 8085A P kit 32
Appendix 35
Department of Physics
Indian Institute of Technology Guwahati
July - November 2010
2
AIM :
a) To verify the universality of NOR gate.
b) Verify De’ Morgan’s Laws.
a) CIRCUIT DIAGRAM:
7402 7402 7402 7402
A
Y Y A
7402
7402
Y
7402
7402
A
7402
7402
Y
7402
b) CIRCUIT DIAGRAM:
(i) A . B = A + B A
(ii) A + B = A . B 7432
7400 Y = A+ B
A
B Y = A.B 7404
B
A
7402
A 7404 7408
Y = A+ B
B Y = A.B
7404
B
3
TYPICAL TRUTH TABLE:
PROCEDURE:
• Wire up the circuits (for pin diagram of the ICs, refer the Appendix-B of this manual).
• Apply inputs A & B.
• And generate the truth table for each of the circuits (0 Volts ‘0’, 5 Volts ‘1’ ).
EXERCISE:
*****
4
AIM :
Design and testing of Half Adder, Half Subtractor, Full Adder, 2-to-1
Multiplexer and 1-to-2 Demultiplexer.
Power Supply (1 No.), Multimeter (1 No.), NOT (IC 7404), XOR (IC 7486), AND (IC 7408),
OR (IC 7432) two each, NOR (IC 7402) and LEDs.
PROCEDURE:
• Wire up the circuits (for pin diagram of the ICs, refer the Appendix-B of this manual).
• Apply inputs A & B.
• And generate the truth table for each of the circuits [0 Volts ‘0 ’, 5 Volts ‘1’].
TRUTH TABLE:
5
b) CIRCUIT DIAGRAM: HALF SUBTRACTOR
TRUTH TABLE:
INPUT OUTPUT (Y)
A B BORROW DIFFERENCE
VOLT LOGIC VOLT LOGIC
0 0
0 1
1 0
1 1
TRUTH TABLE:
INPUT OUTPUT (Y)
A B C CARRY SUM
VOLT LOGIC VOLT LOGIC
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
6
d) CIRCUIT DIAGRAM: 2 TO 1 MULTIPLEXER
EXERCISE:
1. Full Substractor.
2. Adder cum Substractor.
*****
7
AIM :
Design and test a NAND latch and JK flip-flop and use the latter to construct
4-segment shift register and ripple counter.
PROCEDURE :
7400
PROCEDURE:
8
• Momentarily disconnect the SW2 (so as to ensure clock=0) and then release it (making
Clock=1) to enable the flip-flop.
• Verify the truth table for enabled condition of the flip-flop (of step 1 and 2).
• Repeat step 3 for all possible combinations of input J and K to generate the truth table.
• Replace power supplies V1 and V2 with the signal from the function generator. For
clock frequency use TTL signal from the function generator. Set the frequency to ~10
KHz. Display J and K inputs and the output on the DSO. For various combinations of
inputs (all the rows of the truth table) you may be required to use a NOT gate.
• Record the output for all the combinations. Trace the wave forms or record the data.
PROCEDURE:
9
Fig 3.3.
PROCEDURE:
1. Assemble the circuit of Fig 3.4. Connect the out put of all the flip-flops to LEDs via 1
kΩ resistances.
2. Set the Function Generator for square waveform with period of 10 (or 5) second.
Connect function generator output to clock input of the Shift Register Circuit.
3. Enable the circuit.
4. Manually apply an input of “logic 1” into the first flip-flop when clock is in high state.
Circuit will take input only when High to Low transition of clock state takes place (as
in the previous experiment). This can be observed by displaying the clock pulse
simultaneously on DSO and observing the ON-OFF sequence of the first LED.
5. Once the circuit takes the input as “logic 1”, bring the input to “logic 0”. Then check
the serial shift of this bit through the shift register for each High to Low transition of
clock state by observing the LEDs and verify this circuit’s behavior.
6. Display the three Shift Resister output & the Clock on the DSO and repeat step 4 above
7. You may also repeat step 4 and 6 above by displaying the output of all four shift
register on the DSO.
10
Fig. 3.4
EXERCISE:
1. MOD counters.
2. Up-Down counter
*****
11
AIM :
Design and test comparator, encoder and decoder circuits.
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.).
.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 out put (using LED and multi-meter) by using all possible combinations of
inputs.
Fig. 4.1
12
TRUTH TABLE 4.1:
INPUT OUTPUT
A1 A0 B1 B0 A>B A=B A<B
VOLT LOGIC VOLT LOGIC VOLT LOGIC
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
PROCEDURE :
• Analyze and wire up the circuits as shown in the circuit diagram (Fig. 4.2).
• Test the Out put (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.
13
LOGIC DIAGRAM: ENCODER
Fig. 4.2
INPUT OUTPUT
Y1 Y2 Y3 Y4 Y5 Y6 Y7 A B C
VOLT LOGIC VOLT LOGIC VOLT LOGIC
1 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 1
14
PART B: DESIGN AND IMPLEMENTATION OF DECODER
PROCEDURE :
• Analyze and wire up the circuits as shown in the figure below.
• Test the out put (using LED and multi-meter) by using all the possible combinations of
inputs.
Fig. 4.3
EXERCISE:
Design and demonstrate a sequence generator circuit.
*****
15
AIM :
Perform addition / subtraction, using 4-bit adder, store the result in static
RAM and retrieve the stored result from the RAM.
APPARATUS/COMPONENTS REQUIRED:
Power Supply (1 No.), Multimeter (1 No.), 4-bit parallel adder (IC 7483 – 2Nos), 4-bit static
4K RAM (IC 2114 – 1 Nos), LEDs
PROCEDURE:
• 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 (A and B) to the adder circuit and store the result in static
RAM. The following steps will explain the procedure to store and retrieve data in/from
the RAM.
• Disconnect the data inputs I/O4 - I/O1 from input lines and connect them to output lines
to read the 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.
1. Store any 10 consecutive adder results in 10 consecutive locations in static RAM. Then
retrieve the data by reading the 10 locations.
2. Modify the adder circuit to a subtractor circuit using IC 7483 adder. Repeat the process for
storing and retrieving 10 results.
16
PIN DIAGRAMS:
17
PIN & LOGIC DIAGRAMS:
EXERCISE:
1. Perform other arithmetic operations and store in/ retrieve from static RAM.
*****
18
AIM :
Programming exercises using a 8085A microprocessor trainer kit.
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 key-
pad 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 don’t care).
19
To enter a program, follow the following sequence:
<RES>
<SET> C000
XX ! first hex instruction is entered in the place of XX
<INR> ! this command increments address to C001
.
! enter the entire program by keying one 8 bit no. in hex
. in each location and moving to next by pressing <INR>
<INR> 76 ! last instruction in the program
It is usually desired that the result of a computation is readily available after the execution of
the program. The subroutine called MODIDT which resides in the EPROM at the address
(036E)16 can be used to display the contents of register A (Accumulator) to the data fields of
the display units. In order to use this to display the result of any computation use following
sequence instructions:
<move result to register A>
<move zero into register B>
CALL MODIDT ! Key in the address 03 6E in the place of MODIDT
It should be remembered that the CALL MODIDT commands changes the state of all CPU
registers and all flags and hence be careful & use this only towards the end of the program.
EXERCISE:
*****
20
AIM :
Simple Interfacing exercises using 8085A microprocessor trainer kit.
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-Seven-
Segment 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 decimal numbers from 0 to 15 and display the
binary numbers by activating 8 LEDs using 8155A interfacing peripherals.
DIAGRAM:
Fig.7.1
21
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 Control word to initialize I/O PORTs of 8155: Ports
A and B are configured as output and Port C as
input port.
C002 D3, 08 OUT 08H Writing Control Word to control register of 8155,
whose address is 08 in Dyana85 P kit.
C004 3E, 06 MVI A, 06H Get 01 into accumulator as we want to display
binary equivalent of 06.
C006 D3, 09 OUT 09H Send 05 to Port A whose address is 09H
C008 76 HALT Stop
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 0H-FH (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 7–segment 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 7–segment 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.
22
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:
Data Lines : PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
Bits X 0 0 0 0 1 1 0 =06H
Segment NC g f e d c b a
Similarly, by changing the content of the data lines we can display different digits.
23
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 Control word to initialize I/O PORTs of 8155: Ports
A and Port B are configured as output and Port C as
input modes.
C002 D3 08 OUT 08H Writing Control Word to control resister of 8155,
whose address is 08 in Dyna85 P kit
C004 3E 06 MVI A, 07H Get 06 in accumulator as we want to display 1.
C006 D3 09 OUT 09H Send 06 to Port A whose address is 09H
C008 76 HLT Stop
PROCEDURE:
1. 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).
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.
Fig.7.3
24
CONNECTION TABLE 7.3:
Pin Number Connected to Signal Remark
74LS48P
1 PB1 Signal from 8255A Pin No 19 of FRC Cable
2 PB2 Signal from 8255A Pin No 20 of FRC Cable
3 NC
4 NC
5 NC
6 PB3 Signal from 8255A Pin No 21 of FRC Cable
7 PB0 Signal from 8255A Pin No 18 of FRC Cable
8 GND Signal from 8255A Pin No 26 of FRC Cable
9 Pin 1 of Seven Segment LED e
10 Pin 2 of Seven Segment LED d
11 Pin 4 of Seven Segment LED c
12 Pin 6 of Seven Segment LED b
13 Pin 7 of Seven Segment LED a
14 Pin 10 of Seven Segment LED g
15 Pin 9 of Seven Segment LED f
16 +5V D.C
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 Control word to initialize I/O PORTs of 8255 : PORT A as an
Input PORT & Mode 0, PORT B as an Output PORT & Mode
0 PORT Cupper as an input PORT and PORT Clower as an
output PORT
C002 D3 13 OUT 13H Writing Control Word to control resister of 8255, whose
address is 13 in Dyana85 Microprocessor Kit
C004 3E 05 MVI A, 05H Get 05 in accumulator as we want to display 5.
C006 D3 11 OUT 11H Send 05 to Port B whose address is 11H
C008 76 HLT Stop
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
as shown in Fig.7.3.
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 with two 7-segment display units (each capable of displaying
hexadecimal numbers.
2. Propose a scheme for displaying two digit numbers using two seven-segment display
units
*****
25
AIM :
Interfacing of 8-bit Analog to Digital and Digital to Analog cards with 8085A
microprocessor kit.
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.
BACKGROUND:
In this experiment, you will learn to connect ADC & DAC cards to 8085 P through PPI
devices 8255 and 8155. The input analog signal will be applied to Channel 0 of ADC card and
the necessary control signal will be supplied by the P. The digital output will be temporarily
stored in the Accumulator and then will be applied to the digital Inputs of DAC card. Finally,
the analog output will be displayed in the DSO and compared with the original input.
The ADC 08 card plugs into the 8255 IC via 26 Pin FRC Connector. Information’s on 8255 IC
interface is given in the Appendix. Ports B and Cupper are defined as input and Ports A and
Clower in the output ports. Port A‘s PA0, PA1, PA2 are used to multiplex channel select. PB0 –
26
PB7 are used for 8-bit digital output from ADC card. PC1, PC2 are used as Start of
Conversion, Enable & output enable signals. PC4 is used end of conversion signal.
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 B’s PB0 signal gives the allow data
flow signal to the DAC. Port A’s PA0 – PA7 are used for 8-bit digital input to the DAC card.
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 0000H–FFFFH.
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 will be provided to you].
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.
27
PROGRAM TO DRIVE ADC AND DAC CARDS
ADDRESS LEBEL DATA MNEMONIC COMMENT
C000 3E 8A MVI A, 8AH Control word to initialize I/O PORTs of 8255: Ports B
and Cupper are defined as input mode and Ports A and
Clower in the output mode
C002 D3 13 OUT 13H Writing Control Word to control register of 8255,
whose address is 13 in Dyana85 Microprocessor Kit
C004 3E 03 MVI A 03H Control word to initialize I/O PORTs of 8155: Ports A
and Port B are configured as output mode and Ports C in
input mode.
C006 D3 08 OUT 08H Writing Control Word to control resister of 8155, whose
address is 08 in Dyana85 Microprocessor Kit
C008 3E 01 MVI A 01H PB0 high signal gives the allow data flow signal to the
C00A D3 0A OUT 0AH D/A Converter
C00C LOOP1 3E 00 MVI A 00H Loading first Accumulator with ' 00'and then PORT A
C00D whose address is 10. These instruction does two jobs :
1. Sets SOC PIN of 0809 to Low state.
C00E D3 10 OUT 10H 2. Sets Pins 23, 24, 25 of 0809 to Low state. (By setting
C00F these three pins low or high or combination of low and high
state, one can select different multiplexed channels (Ch- 0 to
Ch-7) of the ADC. By setting all three pins to low Ch-0 is
selected (as in this case).
C010 3E 06 MVI A, 06H Loading Accumulator with ' 06'and then sending it to
C012 D3 12 OUT 12H PORT C. These instructions direct 0809 to start
conversion by making SOC and ALE PINs of 0809 to
High state
C014 3E 04 MVI A, 04H Loading Accumulator with ' 04'and then sending it to
C016 D3 12 OUT 12H PORT C. These instructions direct 0809 to start
conversion by making SOC and ALE PINs of 0809 to
Low state.
C018 LOOP DB 12 IN 12H Check for End-of-Conversion Pin status. If Conversion
C01A E6 10 ANI 10H is over then status of SOC Pin of 0809 will be High. If
conversion is over then IN instruction changes MSB of
C01C FE 10 CPI 10H Accumulator to 1 otherwise 0. If conversion is over
C01E C2 18 C0 JNZ LOOP then RAL instruction sets the CARRY flag. If CARRY
flag is not set then JNZ instruction takes program
control to previous IN instruction i.e. to C018 for
further checking and it continues until the EOC pin is
high. If conversion is over i.e. EOC pin is high, then
program proceeds ahead.
C021 3E 0B MVI A, 0BH Enable output
C023 D3 12 OUT 12H
C025 DB 11 IN 11H This instruction scans for the contents of PORT B and
loads it in Accumulator.
C027 D3 09 OUT 09 This instruction sends the contents of Accumulator to
Port A of 8155.
28
C029 CD 6E 03 CALL Calling the Monitor Program stored at location 036E .
MODIDT This instruction will display the contents of
Accumulator in system’s LED monitor.
C02C 11 FF FF LXID FFFFH Load FFFFH in DE register pair. The content of DE
register pair decides the scanning rate.
C02F CD F1 05 CALL Calling the delay sub-routine in location 05F1.
DELAY
C032 C3 0C C0 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:
******
29
AIM :
Interfacing a stepper motor with 8085A microprocessor kit and its control.
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 the Appendix-C, -D, -E & -F.
2. Feed and run the given program using 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 variable rpm.
3. Perform following operations: activate the motor at desired rpm value, make it rotate in
both directions, interrupt while in motion and restart, set it for desired no. of revolutions.
MNEMONIC
ADDRESS OPCODE LABEL COMMENTS
S
D000 06 04 UP5: MVI B, 04
ADDRESS ‘ C1EO ‘
FOR CLOCKWISE
LXI H, ADDRESS ‘ C0EO ‘
D002 21 E0 C1
C1EO FOR ANTI
CLOCKWISE
30
D01C D3 13 OUT 13
D01E 3E FF MVI A FF
D020 D3 10 OUT 10
D022 3E FF MVI A FF
D024 D3 12 OUT 12
D026 C9 RET
These inputs to be entered at the following memory locations. These are step variables
COEO 06 0A 09 05 00 For Clockwise
movement
05 09 0A 06 00 For Anti Clockwise
C1EO
movement
• Load the program in the above mentioned memory locations and execute the
program. Change the direction of movement by changing the program at the memory
location D003.
Here the direction and speed of rotation, number of steps to move can be programmed.
The following parameters have to input in specified memory locations.
31
E014 21 E0 C0 LXI H, C0E0
E017 E5 UP6: PUSH H
E018 7E UP1: MOV A, M
E019 D3 10 OUT 10
E01B 3A 32 C2 LDA C232
E01E 4F MOV C, A
E01F 3A 33 C2 LDA C233
E022 47 MOV B, A
E023 CD 60 E0 CALL DELAY
E026 23 INX H
E027 7D MOV A, L
E028 FE E4 CPI E4
E02A C2 3B E0 JNZ DN4
E02D 3A 30 C2 LDA C230
E030 FE 00 CPI 00
E032 CA 49 E0 JZ DN5 Call delay
E035 21 E0 C0 LXI H, C0E0
E038 C3 3B E0 JMP DN4
E03B 15 DN4: DCR D
E03C C2 18 E0 JNZ UP1
E03F 00 00 00 NOP
E042 76 HLT
E043 21 E0 C1 DN3: LXI H, C1E0
E046 C3 17 E0 JMP UP6
E049 21 EO C1 DN5: LXI H, C1EO
E04C C3 3B E0 JMP DN4
Delay routine :
E060 0B UP: DCX B
E061 78 MOV A, B
E062 B1 ORA C
E063 C2 60 E0 JNZ UP
E066 C9 RET
• Load the program in the above mentioned memory locations and execute the
program.
EXERCISE: Design of a Clock using 8085 µP kit and the stepper motor.
*****
32
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.
33
34
35
36
PROGRAMMABLE PERIPHERAL INTERFACE
Intel 8255 is a programmable peripheral interface (PPI). It has three 8-bit ports namely Port A,
Port B and Port C. The Port C further divided into two 4-bit ports, namely, Port C upper
(Cupper) and Port C lower (Clower). Thus a total 4 ports are available, two 8-bit ports and two 4-
bit ports. Each port can be programmed either as an input port or output port sending control
word signal from microprocessor. In our experiment we will configure the ports of 8255 as per
following status:
The control word bits for the above definition of the ports are shown in the following figure:
37
8155 Programmable Peripheral Interface:
Intel 8155 is a programmable peripheral interface (PPI). It has two 8-bit ports namely Port A,
Port B and one 6-bit port namely Port C upper (Cupper). Each port can be programmed either as
an input port or output port sending control word signal from microprocessor.
38
ADC0809 & DAC0800
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.
39
Some important characteristics of ADC 0809 are as follows:
Electrical Characteristics-
Minimum Start Pulse Width 100 ns
Minimum ALE Pulse Width 100 ns
Clock Frequency 10 to 1280 KHz
Conversion Time 100 nS at 640 KHz
Resolution 8 bits
Error ± 1 LSB
Ref. (+) should not be more positive than supply. Ref. (-) should not be more
negative than ground.
Supply 5 V d.c.
Logical "I" Input Voltage Min Vcc-1.5
Logical "0" Input Voltage Max. 1.5 V
Logical "I" Output Voltage Min. : Vcc-O.4
Logical "0" Output Voltage Max. : 0.45 V
DAC 0800 :
The DAC 0800 is a simple monolithic 8-bit D/A converter (DAC). Pin diagram and interfacing
connections of the DAC are shown below. It has fast settling time (~100 ns). It can be directly
interfaced to TTL, CMOS, PMOS and others. It operates at 4.5 V to +18 V supply. The supply
V+ may be either +5 V or +12 V. V- is kept at -12 V, being easily available on standard power
supply units.
40
P i n - o u t c o n f i g u r a t i o n o f J 2 / J 3 Connector of Dyna85 µP Kit
41
STEPPER MOTOR CONTROLLER CARD
Stepper motors have immense applications in printing, industrial robotics, precision tool
motions in drilling, cutting and shaping machines, lathe etc. The aim of experiment #9 is to
demonstrate interfacing of stepper motor to 8085 microprocessor and to run it in continuous or
stepped motion in forward or reverse direction in a programmable manner using 8085
microprocessor.
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.
42
Fig.F-2: The schematic diagram of the stepper motor
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 Amps/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.
*****
43