Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

Complex Engineering Problem Report

Microprocessor Programming and Interfacing


Third Year Bio Medical Engineering
Batch: 2020

Group Members:

Ms. Nayab Mubashir (BM-20003)


Ms. Mehak Fatima (BM-20019)
Ms. Eman Shah Imran (BM-20020)

Submitted to: Dr. Saad Qasim Khan


Submission Date: 19/1/2023

Table of Contents
S. No. Description Pg. No.

1 Abstract 2

2 Schematic Diagram of 8086/88 complete system 3

3 Modules and Interconnections 4

4 Assembly language Program 5

5 Simulation Results 6

6 Conclusion 7

7 Any added information (optional) 8

ABSTRACT:
The microprocessor can communicate with a wide range of digital and analogue devices. A
microprocessor is a complete CPU on a single chip that is compact and powerful and is used
in a variety of applications. To perform the interfacing, the required circuitry and software are
required. Before connecting a circuit or device to a microprocessor, the terminal
characteristics of the microprocessor and its associated interfacing components must be
understood. In a microprocessor, interfacing is simply an integrated circuit that performs the
fundamental functions of the central processing unit. It enables the user to interact with the
computer. Microprocessors come in a variety of configurations. The number of bits that their
ALU can work with is a common way of categorising microprocessors. The number of bits
their ALU can work with at one time is a common way of categorizing microprocessors.
A 16-bit microprocessor is a microprocessor with a 16-bit ALU. A classic example of a 16-
bit microprocessor is the 8086 microprocessor. The interfacing of a multiplexed seven
segment display with the 8086 Microprocessor is the state of the art presented in this paper.
The assembly language programme was created and designed to display the the decimal
values from 0 till 9 on the 7 segment cathode display in a loop that means it will continue
repeating it's values again and again.

Achievement:
The interfacing of the 7 segment cathode display with the 8086 microprocessor was done on
both the hardware and software basis. On the software, proteus simulation was performed
that involved the 8086, 74HC373 and 7 segment cathode display showing the working of the
interfacing. For more practical achievement, we designed a hardware including 8086, 8 bit
latch 74373, 8284 clock of 5mhz, buffer 74244, 74245, 8255A programmable I/O, Capacitor
of 10 micro farad and 22 pico farad, quartz crystal and 7 segment cathode display.

Schematic Diagram of 8086/88 system:


MODULES AND INTERCONNECTIONS:
Clock 8284A:

PIN Configuration:
 Pin 9 GND is grounded.
 Pin 18 VCC is connected to 5V.
 Pin 1 CSYNC is also grounded.
 Pin 8 CLK provide clock to 8086.
 Pin 30 F/C (bar) is also grounded.
 Pin 17 and 16 X1, X2 is connected to the 15 MHz quartz crystal through 2 capacitors
of 22 pF.
 Pin 11 RES(bar) to the RESET circuitry.
 Pin 10 RESET is connected to 8086 RESET.
8086 Microprocessor:
It consist of 40 pins.
 VCC – Pin number 40 – At this pin, the external power supply of + 5V is provided to

the processor.

 GND – Pin number 1 and 20 – These two pins acts as the ground. This pin directs the

extra current of the microprocessor to ground.

 AD0 – AD15 – Pin number 2 to 16 and 39 – These are the multiplexed address and

data bus.

 A16/S3, A17/S4, A18/S5 and A19S6 – Pin number 35 to 38

 BHE’ / S7 – Pin number 34

 MN/MX’ – Pin number 33 RD’ – Pin number 32

 CLK – Pin number 19 NMI – Pin number 17

 TEST – Pin number 23 INTR – Pin number 18

 READY – Pin number 22 RESET – Pin number 21

Pins in Minimum mode

 INTA’ – Pin number 24 ALE – Pin number 25

 DEN’ – Pin number 26 DT/R’ – Pin number 27


 M/IO’ – Pin number 28 WR’ – Pin number 29

 HOLD – Pin number 31 HLDA – Pin number 30

74373 (Latch):

It is a 20 pin D-Latch, in which there are 8 input pins and 8 output pins.

The IC 74LS373 is a transparent latch consists of a eight latches with three state

outputs for bus organized systems applications.It is a 20 pin IC comprises of eight

input data lines (D0-D7) and eight output lines (O0-O7). The OE pin was meant for

Output enable and LE pin for Latch enable

74245 (buffer)
Pin configuration

1 Direction Control (DIR): This pin decides the direction of the Data.

2 to 9 Data Input/output (A0-A7): These 8 pins can be used as 8-bit Input or 8-bit Output

pins based on the state of DIR pin.

10 Ground (GND): Connected to the ground of the system

11 to 18 Data Input/output (B0-B7): These 8 pins can be used as 8-bit Input or 8-bit Output

pins based on the state of DIR pin

19 Output Enable (OE): Active Low pin – Used to Enable/Disable Input

20 Supply Voltage (Vcc): connected to 5 volts

74138 (Decoder)
 Pin1 (A): Address input pin
 Pin2 (B): Address input pin
 Pin3 (C): Address input pin
 Pin4 (G2A’/E1’): Active low enable pin
 Pin5 (G2B’/E2’): Active low enable pin
 Pin6 (G1’/E3’): Active high enable pin
 Pin7 (Y7): Output pin
 Pin8 (GND): Ground pin
 Pin9 (Y6): Output pin 6
 Pin10 (Y5): Output pin 5
 Pin11 (Y4): Output pin 4
 Pin12 (Y3): Output pin 3
 Pin13 (Y2): Output pin 2
 Pin14 (Y1): Output pin 1
 Pin15 (Y0): Output pin 0
 Pin16 (VCC): Power supply pin

2816 (EEPROM):

1 A7 - Address Input
2 A6 - Address Input

3 A5 - Address Input

4 A4 - Address Input

5 A3 - Address Input

6 A2 - Address Input

7 A1 - Address Input

8 A0 - Address Input

9 I/O0 - Data Input/Output 0

10 I/O1 - Data Input/Output 1

11 I/O2 - Data Input/Output 2

12 GND - Ground

13 I/O3 - Data Input/Output 3

14 I/O4 - Data Input/Output 4

15 I/O5 - Data Input/Output 5

16 I/O6 - Data Input/Output 6

17 I/O7 - Data Input/Output 7

18 CE - Chip Enable

19 A10 - Address Input

20 OE - Output Enable
21 WE - Write Enable

22 A9 - Address Input

23 A8 - Address Input

24 Vcc - Positive Power Supply

8255A (PPI)

 PA0-PA7 portA pins

 PB0-PB7 port B pins

 PCO-PC7 port C pins


 D0-D7 data pins

 CS bar chip select

 RD bar read

 WR bar write

 RESET reset pin conneced to 8284 rest

 GND -- ground

 VCC -- 5 volts

7 segment cathode display

 GND ground

 ABO - AB7 connected with a-g pins of 7 segment

 COM ground
ASSEMBLY LANGUAGE PROGRAM:

;7 segment display Interfacing 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
JMP XX
XX:
MOV AL, 00111111B ; displaying 0
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay0:loop Delay0
MOV AL, 00000110B ; Displaying 1
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay1:loop Delay1

MOV AL, 01011011B ;Displaying 2


MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay2:loop Delay2
MOV AL, 01001111B ; Displaying 3
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay3:loop Delay3
MOV AL, 01100110B ; Displaying 4
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay4:loop Delay4
MOV AL, 01101101B ;Displaying 5
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay5:loop Delay5
MOV AL, 01111101B ;Displaying 6
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay6:loop Delay6
MOV AL, 00000111B ;Displaying 7
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay7:loop Delay7
MOV AL, 01111111B ;Displaying 8
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay8:loop Delay8
MOV AL, 01101111B ; Displaying 9
MOV DX, PORTA
OUT DX,AL
MOV CX,0DF36H; Delay
Delay9:loop Delay9
JMP XX
JMP START
CODE ENDS
END

CODE EXPLAINATION:
 In the Data segment we define our ports with their addresses for example
 port A= 00H
 port B= 02H
 port C= 04H
 port CON= 06H
 In code segment we start to perform our coding for example
 MOV AX,DATA this tells us that to move our data which is defined above as
ports into AX register.
 MOV DS, AX in this instruction we move our data from AX into DS (data
segment)
 ORG 0000H indicates the origin of our code and START instruction is given to
start from the origin.
 MOV DX, PORT_CON is the instruction given to move the address of port
CON (06H) into the DX register.
 MOV AL, 10000000H is given to move 10000000H into the AL register.
 JMP XX is the instruction given to Jump directly into the XX portion of the
code.
 In XX we display our values from 0-9 with delay.
 JMP START instruction is given to jump back to the start point so the code
starts to re-execute.
 CODE END indicates the end of the code
 END indicates the end of the assembly language program.

SIMULATION RESULTS:

We found from our simulation


CONCLUSION:

The interfacing of the 7 segment cathode display with the 8086 microprocessor was done on
both the hardware and software basis. On the software, proteus simulation was performed
that involved the 8086, 74HC373 and 7 segment cathode display showing the working of the
interfacing. For more practical achievement, we designed a hardware including 8086, 8 bit
latch 74373, 8284 clock of 5mhz, buffer 74244, 74245, 8255A programmable I/O, Capacitor
of 10 micro farad and 22 pico farad, quartz crystal and 7 segment cathode display.

You might also like