Birla Institute of Technology and Science Pilani, Dubai Campus
Dubai International Academic City
CS/ECE/INSTR/EEE F241
MICROPROCESSORS AND INTERFACING
LABORATORY MANUAL
II Semester 2023-24
Name:……………………..
ID No:……………….…….
MICROPROCESSORS AND INTERFACING LABORATORY MANUAL
List of Experiments
Exp. No. Name of the Experiment
7 Hardware Design and Simulation using PROETUS Software -
7 Segment LED
8 Hardware Design and Simulation using PROETUS Software -
Stepper Motor Interfacing
9 Hardware Design and Simulation using PROETUS Software -
Memory Interfacing
10 Hardware Design and Simulation using PROETUS Software -
Digital to Analog Converter
EXPERIMENT-7
HARDWARE DESIGN AND SIMULATION USING PROTEUS
7-Segment Led Interfacing
Aim: To Interface a 7-Segment LED to 8086 Microprocessor through 8255
Programmable Peripheral Controller using PROTEUS.
What is Proteus Design Suite?
Proteus combines ease of use with powerful features to help you design, test and
layout professional PCBs like never before. With nearly 800 microcontroller variants
ready for simulation straight from the schematic, one of the most intuitive professional
PCB layout packages on the market and a world class shape-based auto router
included as standard, Proteus Design Suite 8 delivers the complete software package
for today and tomorrow's engineers.
The Proteus simulation products all use the schematic capture module as the
electronic circuit and our customized mixed-mode SPICE engine to run the
simulation. Proteus VSM then allows the microcontroller to also be simulated on the
schematic while Proteus IoT Builder enables the design and test of the remote user
interface for the circuit. For embedded engineers, Proteus VSM bridges the gap in
the design life cycle between schematic capture and PCB layout. It enables you to
write and apply your firmware to a microcontroller component on the schematic (PIC,
AVR, ARM, 8051, etc.) and then co-simulate the program within a mixed-mode
SPICE circuit simulation.
The Block diagram of interfacing is shown below in Figure 1
Figure 1 Interfacing block diagram.
Here you will be simulating the schematic of above interfacing, which is shown in the
next page Figure 2. This schematic entry is done in the Proteus design suite.
Corresponding assembly program also shown below.
Figure 2 Schematic Entry
Assembly Program:
DATA SEGMENT
PORTA EQU 00H
PORTB EQU 02H
PORTC EQU 04H
PORT_CON EQU 06H
DATA ENDS
CODE SEGMENT
MOV AX, DATA
MOV DS, AX
ORG 0000H
START:
MOV DX, PORT_CON
MOV AL, 10000000B
OUT DX, AL
MOV SI, 0
MOV DI, 0
L0: MOV CX, 1FFFH
L1: MOV AL, S1[SI]
MOV DX, PORTA
OUT DX, AL
LOOP L1
INC SI
CMP SI, 16
JL L0
MOV DX, PORT_CON
MOV AL, 10000000B
OUT DX, AL
JMP START
ORG 1000H
S1 DB 11000000B
DB 11111001B
DB 10100100B
DB 10110000B
DB 10011001B
DB 10010010B
DB 10000010B
DB 11011000B
DB 10000000B
DB 10010000B
DB 10001000B
DB 10000011B
DB 11000110B
DB 10100001B
DB 10000110B
DB 10001110B
CODE ENDS
END
Procedure:
Step 1: Double click on the Proteus 8 Professional
Step 2: Click on the New Project on the following screen.
Step 3: Enter the Project name and click on the Next button.
Step 4: Select the design template DEFAULT and click on the Next button.
Step 5: Click on Create Firmware Project radio button, Select 8086 in Family, 8086
in Controller and MASM32 in Compiler. Then click Next.
Step 6: Then Click Finish
Step 7: You will get the following screen and Click on Schematic Capture.
Step 8: Now draw the schematic as shown in Figure 2 as follows.
Component required:
Double click on 8086 Microprocessor, in popup window change the Internal
Memory Size to 0x10000
Step 9: Enter the assembly program in Source Code Menu as shown below.
Step 10: Click on the Build and Build Project
You can see the Build message in the bottom as shown.
Step 11: Now in Schematic Capture tab click on Debug and Run Simulation
You can observe LED will be displaying 0 to F continuously.
EXPERIMENT - 8
HARDWARE DESIGN AND SIMULATION USING PROTEUS
Stepper Motor Interfacing
Aim: To Interface a Stepper Motor to 8086 Microprocessor through 8255
Programmable Peripheral Controller using Proteus
Stepper Motor Interfacing
The Block diagram of interfacing is shown below in Figure 1.
ADDRESS/DATA BUS
74HC373
8086 8255
Microprocesor PPI
Port C L293D
Figure 3 Interfacing block diagram.
Here you will be simulating the schematic of above interfacing, which is shown in the
next page Figure 2. This schematic entry is done in the Proteus design suite. The
corresponding assembly program is also given below.
Figure 4 Schematic Entry
Assembly Program:
DATA SEGMENT
PORTA EQU 00H
PORTB EQU 02H
PORTC EQU 04H
PORT_CON EQU 06H
DATA ENDS
CODE SEGMENT
MOV AX, DATA
MOV DS, AX
ORG 0000H
START:
MOV DX, PORT_CON
MOV AL, 10000000B
OUT DX, AL
MOV SI, 0
MOV DI, 0
LL0:MOV CX, 2FFFH
LL1:MOV AL, S2[DI]
MOV DX, PORTC
OUT DX, AL
LOOP LL1
INC DI
CMP DI, 4
JL LL0
JMP START
ORG 1000H
S2 DB 1101B
DB 1011B
DB 0111B
DB 1110B
CODE ENDS
END
Procedure:
Step 1: Double click on the Proteus 8 Professional
Step 2: Click on the New Project on the following screen.
Step 3: Enter the Project name and click on the Next button.
Step 4: Select the design template DEFAULT and click on the Next button.
Step 5: Click on Create Firmware Project radio button, Select 8086 in Family, 8086
in Controller and MASM32 in Compiler. Then click Next.
Step 6: Then Click Finish
Step 7: You will get the following screen and Click on Schematic Capture.
Step 8: Now draw the schematic as shown in Figure 2 as follows.
Component required:
Double click on 8086 Microprocessor, in popup window change the Internal
Memory Size to 0x10000
Step 9: Enter the assembly program in Source Code Menu as shown below.
Step 10: Click on the Build and Build Project
You can see the Build message in the bottom as shown.
Step 11: Now in Schematic Capture tab click on Debug and Run Simulation
You can observe the stepper motor rotating.
EXPERIMENT - 9
HARDWARE DESIGN AND SIMULATION USING PROTEUS
Memory Interfacing: Read Data from Rom and Display
Aim: To Interface a Memory (ROM) to 8086 Microprocessor through 8255
Programmable Peripheral Controller using Proteus and display the memory
address and content.
Memory Interfacing
The Block diagram of interfacing is shown below in Figure 1.
ADDRESS/DATA BUS
Memory
PORT A Content
74HC373 Display
ROM
27512
8086 8255
Microprocesor PPI
Address
Display
Figure 5 Interfacing block diagram.
Here you will be simulating the schematic of above interfacing, which is shown in the
next page Figure 2. This schematic entry is done in the Proteus design suite. The
corresponding assembly program is also shown below.
Figure 6 Schematic Entry
Assembly Program:
;memory interfacing
DATA SEGMENT
PORTA EQU 00H
PORTB EQU 02H
PORTC EQU 04H
PORT_CON EQU 06H
DATA ENDS
CODE SEGMENT
MOV AX,DATA
MOV DS,AX
ORG 0000H
START:
MOV DX,PORT_CON
MOV AL,10000000B
OUT DX,AL
MOV AL,00H
MOV CX,01FH
UP:
PUSH CX
MOV DX,PORTA
OUT DX,AL
INC AL
MOV CX,0DF36H
DOWN: LOOP DOWN
POP CX
LOOP UP
JMP START
CODE ENDS
END START
Procedure:
Step 1: Double click on the Proteus 8 Professional
Step 2: Click on the New Project on the following screen.
Step 3: Enter the Project name and click on the Next button.
Step 4: Select the design template DEFAULT and click on the Next button.
Step 5: Click on Create Firmware Project radio button, Select 8086 in Family, 8086
in Controller and MASM32 in Compiler. Then click Next.
Step 6: Then Click Finish
Step 7: You will get the following screen and Click on Schematic Capture.
Step 8: Now Draw the schematic as shown in Figure 2 as follows.
Components required :
Double click on 8086 Microprocessor, in popup window change the Internal
Memory Size to 0x10000
Step 9: Enter the assembly program in Source Code Menu as shown below.
Step 10: Click on the Build and Build Project
You can see the Build message in the bottom as shown below.
Step 11: Open a notepad and insert the number to be stored in the ROM as follows
and save it as ‘[Link]’ in a folder created by you.
Data corresponding to address 00 in ROM
Data corresponding to address 01 in ROM
Data corresponding to other continuous address in the
ROM
Step 12: Double click on the ROM IC 27512 and in Edit component menu click on
the Image file icon as shown and select the file ‘[Link]’
Step 13: In Image file section where the file path and file name is seen enter following
as a continuation and then press OK
C:\Documents\FolderName\[Link],ASCHEX
Step 14: Now in Schematic Capture tab click on Debug and Run Simulation
You can observe address and corresponding data is displayed on the display
continuously, check the data with the [Link] file.
EXPERIMENT - 10
HARDWARE DESIGN AND SIMULATION USING PROTEUS
Digital to Analog Converter
Aim: To design Digital to Analog Converter using 8086 Microprocessor in
Proteus and display the Output waveform.
Digital to Analog Converter
The Block diagram of interfacing is shown below in Figure 1
Figure 7 Interfacing block diagram.
Here you will be simulating the schematic of above interfacing, which is shown in the
next page Figure 2. This schematic entry is done in the Proteus design suite. The
corresponding assembly program is also given below.
Figure 8 Schematic Entry
Assembly Program:
;memory interfacing
CODE SEGMENT
PORTA EQU 00H ;Address of Port A = 00H
Config EQU 06H ;Address of Config. Word = 06H
ORG 100H
MOV DX, Config
MOV AL, 10000000B; port C=output, port A=output in mode 0, PORT B=output in mode 0
OUT DX, AL
START:
MOV AL, 00000000B; All pins of port A will be (0)
MOV DX, PORTA
OUT DX,AL
;--------------------
MOV CX, 0ffh ; Small Delay
loopy1:
loop loopy1
;--------------------
MOV AL, 11111111B; All pins of port A will be (1)
MOV DX, PORTA
OUT DX,AL
;--------------------
MOV CX, 0ffh ; Small Delay again
loopy2:
loop loopy2
;--------------------
JMP START ; Loop forever
CODE ENDS
END
Procedure:
Step 1: Double click on the Proteus 8 Professional
Step 2: Click on the New Project on the following screen.
Step 3: Enter the Project name and click on the Next button.
Step 4: Select the design template DEFAULT and click on the Next button.
Step 5: Click on Create Firmware Project radio button, Select 8086 in Family, 8086
in Controller and MASM32 in Compiler. Then click Next.
Step 6: Then Click Finish
Step 7: You will get the following screen and Click on Schematic Capture.
Step 8: Now Draw the schematic as shown in Figure 2 as follows.
Components required :
R1=5k, R2=5k, R3=1k, R4=1k, R5=5k, C1=100nF
Double click on 8086 Microprocessor, in popup window change the Internal Memory
Size to 0x10000
Step 9: Enter the assembly program in Source Code Menu as shown below.
Step 10: Click on the Build and Build Project
You can see the Build message in the bottom as shown below.
Step 11: Now in Schematic Capture tab click on Debug and Run Simulation
You can observe one Oscilloscope window pop-up.
Note down the amplitude and frequency of both waveforms.
Observations:
1) Signal 1
Amplitude =
Frequency =
2) Signal 2
Amplitude =
Frequency =