0% found this document useful (0 votes)
20 views

LECTURE 7 Interface

Uploaded by

Amanuel Tamirat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

LECTURE 7 Interface

Uploaded by

Amanuel Tamirat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

WACHEMO UNIVERSITY

DURAME CAMPUS

COLLEGE OF ENGINEERING AND TECHNOLOGY


SCHOOL OF COMPUTING AND INFORMATICS
DEPARTMENT OF COMPUTER SCIENCE

MICROPROCESSOR AND ASSEMBLY LANGUAGE PROGRAMMING

Course Code: CoSc 3025

Selamu S. (MSC)
LECTURE_7

INTERFACE
Introduction
 Memory Interfacing occurs when we need the microprocessor to access the memory
for reading instruction codes and the data stored in the memory.

 I/O Interfacing indicates the various communication devices like the keyboard, mouse,
printer.

 Interface acts as a communication between user and a computer.

 It is an integrated circuit which helps in performing basic functions of the CPU.

 Interfacing is classified into two types, memory interfacing and I/O interfacing.
 The general procedure for memory interfacing 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.
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.
 Electronically Erasable Programmable Read-only Memory (EEPROM) is
memory space that programmers can use to store long-term information.

 Static Random-Access Memory (SRAM) is a type of random-access memory


(RAM) that uses latching circuitry (Flip-flop) to store each bit.

 SRAM is volatile memory; data is lost when power is removed.

 Dynamic Random-Access Memory (DRAM):- When your computer is running and


the main memory is being used, the capacitors that make up your DRAM are being
refreshed constantly, typically every 64 milliseconds
Memory PIN CONNECTIONS
 Memory Pin Connections shows a general form of ROM and RAM pins.
 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 (𝐶𝑆), Chip Enable (𝐶𝐸) or simply
Select (𝑆)ҧ input.
 RAM memory generally has at least one 𝐶𝑆 or 𝑆ҧ input and ROM at least one 𝐶𝐸.
 If the 𝐶𝑆, 𝐶𝐸, 𝑆ҧ 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 𝐶𝑆 connection is present, all most be active to perform read or write
data.
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 (𝑂𝐸) or gate (𝐺),
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)
𝐺ҧ
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.
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.
THE PROGRAMMABLE PERIPHERAL INTERFACE
 Microprocessor based system design involves interfacing of the processor with one or
more peripheral devices for the purpose of communication with various input and output
devices connected to it.They are also programmable devices.
 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.
 Peripheral devices can broadly be classified into two categories
 Special purpose peripherals
 General purpose peripherals
Special Function Peripherals
 These are devices that may be used for interfacing a microprocessor to a specific type of
I/O device.
 These peripherals are more complex and therefore, relatively more expensive than general
purpose peripherals.
The functioning of these devices varies depending on the type of I/O device they are
controlling.
The special function peripherals are:-
General Function Peripherals
 General purpose peripheral devices that perform a task but may be used for interfacing a
variety of I/O devices to microprocessor.
 The general purpose devices are given below:
 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 I/O 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.
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.
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:  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
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.
MODE 2: BI-DIRECTIONAL BUS
 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
 Any port programmed as an output port is initialized to all zeros when the control word is
written.
 The modes for Port A and Port B can be separately defined, while Port C is divided into
two portions as required by the Port A and Port B definitions.
 For instance: Group B can be programmed in Mode 0 to monitor simple switch closings
or display computational results,
 Group A could be programmed in Mode 1 to monitor a keyboard or tape reader on an
interrupt-driven basis.
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.


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.
ANALOG TO DIGITAL (ADC) AND DIGITAL TO ANALOG (DAC)

 An analog to digital converter (ADC, A to D) is a device that converts a continuous


physical quantity (usually voltage) to a digital number that represents the quantity's
amplitude.
 The process of analog to digital conversion is a slow process, and the microprocessor has to
wait for the digital data till the conversion is over.
 After the conversion is over, the ADC sends end of conversion EOC signal to inform the
microprocessor that the conversion is over and the result is ready at the output buffer of the
ADC.
 DAC 0808 is an 8 bit Digital to Analog Converter. It can convert an 8 bit digital data
input into an analog voltage output.
 The DAC is a device, that is widely used for converting digital pulses to analog signals.
 As microprocessor only understand digital signal, so real world analog signal should be
converted into digital to process it by microprocessor.

You might also like