Skip to main content
WACHEMO UNIVERSITY
DURAME CAMPUS
COMPILED BY SELAMU S.
COLLEGE OF ENGINEERING AND TECHNOLOGY
SCHOOL OF COMPUTING AND INFORMATICS
DEPARTMENT OF COMPUTER SCIENCE
INTRODUCTION TO MICROPROCESSOR
LECTURE_7
INTERFACE
Cont…;
 The general procedure for interfacing memory with 8086 is described as follows:-
1)Arrange the memory chips into two banks to get 16 bit word size. The higher order memory
block is known as odd bank and the lower order block is known as even bank.
2)Connect the necessary number of address lines of 8086 to the memory chips. (Calculate how
many address lines are required to interfacing the required memory)
3)Connect the RD and WR lines of 8086 with the memory chips.
4)The remaining address lines of the 8086 are used for decoding the required Chip Select signals
for the memory chips.
11/23/2024
Program Control Instructions 3
MEMORY DEVICES
Simple or complex, every microprocessor-based system has a memory system.
Almost all systems contain four common types of memory:
Read only memory (ROM)
Flash memory (EEPROM)
Static Random access memory (SRAM)
Dynamic Random access memory (DRAM)
Before attempting to interface memory to the microprocessor, it is essential to understand the
operation of memory components.
11/23/2024
Program Control Instructions 4
MEMORY PIN CONNECTIONS
Pin connections common to all memory devices are:
1)Address Connections:- All memory devices have address inputs that select a memory location within
the memory device. Address inputs are labeled from A0 to An.
2)Data Connections:- All memory devices have a set of data outputs or input/outputs. Today many of
them have bi-directional common I/O pins.
3)Selection Connections:- Each memory device has an input that selects or enables the memory device.
This kind of input is most often called a Chip Select (CS), Chip Enable (CE) or simply Select (S) input.
RAM memory generally has at least one CS or S input and ROM at least one CE.
If the CE, CS, S input is active the memory device perform the read or write.
If it is inactive the memory device cannot perform read or write operation.
If more than one CS connection is present, all most be active to perform read or write data.
11/23/2024
Program Control Instructions 5
CONT…;
4) Control Connections:-
A ROM usually has only one control input, while a RAM often has one or two control inputs.
The control input most often found on the ROM is the output enable (OE) or gate (G), this allows data to
flow out of the output data pins of the ROM.
A RAM memory device has either one or two control inputs. If there is one control input it is often called
R/W.
This pin selects a read operation or a write operation only if the device is selected by the selection input
(CS)
11/23/2024
Program Control Instructions 6
INTRODUCTION TO I/O INTERFACE
 Input-Output Interface is used as a method which helps in transferring of information between the
internal storage devices i.e. memory and the external peripheral device.
 A peripheral device is that which provide input and output for the computer, it is also called Input-
Output devices.
 For example:- A keyboard and mouse provide Input to the computer are called input devices while a
monitor and printer that provide output to the computer are called output devices.
 Just like the external hard-drives, there is also availability of some peripheral devices which are able
to provide both input and output.
 In micro-computer base system, the only purpose of peripheral devices is just to provide special
communication links for the interfacing them with the CPU.
11/23/2024
Program Control Instructions 7
CONT…;
11/23/2024
Program Control Instructions 8
FUNCTIONS OF INPUT-OUTPUT INTERFACE:-
1)It is used to synchronize the operating speed of CPU with respect to input-output devices.
2)It selects the input-output device which is appropriate for the interpretation of the I/O device.
3)It is capable of providing signals like control and timing signals.
4)In this data buffering can be possible through data bus.
5)There are various error detectors.
6)It converts serial data into parallel data and vice-versa.
7)It also convert digital data into analog signal and vice-versa.
11/23/2024
Program Control Instructions 9
THE PROGRAMMABLE PERIPHERAL INTERFACE
 PPI 8255 is a general purpose programmable I/O device designed to interface the CPU with its outside
world.
It can be used with almost any microprocessor. It consists of three 8-bit bidirectional I/O ports i.e. PORT
A, PORT B and PORT C.
8255 is a popularly used parallel, programmable input-output device.
It can be used to transfer data under various condition from simple input-output to interrupt input-output.
This is economical, functional, and flexible but is a little complex and general purpose I/O device that
can be used with almost any microprocessor.
There are 24 I/O pins which may be individually programmed in 2 groups of 12 and used in 3 major
modes of operation.
The high performance and industry standard configuration of the 82C55A make it compatible with the
8086. 11/23/2024
Program Control Instructions 10
Cont…;
 It has 24 pins that can be grouped in two 8-bit parallel ports: A and B called Port A (PA) and Port B
(PB) with the remaining eight known as Port C (PC).
 Port C can be further divided into groups of 4-bits ports named Cupper (Cu) and Clower (Cl).
 There are 40 pins and operates in +5 regulated power supply.
11/23/2024
Program Control Instructions 11
MODE OF OPERATION
The two operating modes of 8255 Programmable peripheral interface are:-
Bit Set Reset (BSR) Mode:-
If MSB of control word (D7) is 0, PPI works in BSR mode. In this mode only port C bits are used for
set or reset.
When MSB of the control register is Zero (0), 8255 works in Bit Set-Reset mode.in this only PC bit
are used for set and reset.
Input-Output Mode:-
If MSB of control word (D7) is 1, PPI works in input-output mode.
When MSB of the control register is One (1), 8255 works in Input-Output mode.
This is further divided into three modes:
11/23/2024
Program Control Instructions 12
Mode 0:- Basic Input/ Output
Mode 1:- Strobed Input/ Output
Mode 2:- Bi-directional Bus
MODE 0: BASIC INPUT/ OUTPUT
Simple input / output operations.
Two 8 bit ports and two 4 bit ports
Any port can be an input or output port
Outputs are latched
Inputs aren’t latched.
16 different input/output configurations are possible in this mode
11/23/2024
Program Control Instructions 13
MODE 1: STROBED INPUT/ OUTPUT
 It provides means for transferring I/O data to or from a specified port in conjunction with
strobes or handshaking signals.
 Port A and port B use the I/O lines, and port C for handshaking signals.
 There are two groups (group A, B)
 Each group contains one 8 bit data port and one 4 bit control data port.
 Both inputs and outputs are latched.
11/23/2024
Program Control Instructions 14
 It provides a means for communication with a peripheral device for both transmitting &
receiving data.
 Handshaking signals are provided to maintain a proper bus flow.
 Port A – 8 bit bidirectional bus port and port C used as control signals
Mode 2: Bi-directional Bus
CONTROL WORD FORMATS
 Control word is a part of control register in 8255 which specify an I/O function for each port.
 This is format of control word 8255.
11/23/2024
Program Control Instructions 15
 If the most significant bit of control word or D7 is 1 then 8255 works in I/O mode else, if its value is 0
it works in BSR mode.
11/23/2024
Program Control Instructions 16
11/23/2024
Program Control Instructions 17