0% found this document useful (0 votes)
18 views34 pages

ch5

The document discusses programmable interface devices, focusing on the 8255 programmable peripheral interface, which facilitates communication between microprocessors and peripheral devices. It outlines the types of interfacing (memory and I/O), the modes of operation for the 8255, and the classification of peripherals into general and special purpose. Additionally, it details the pin functions, control word formats, and the operational modes of the 8255, including simple I/O, handshake I/O, and bidirectional I/O modes.

Uploaded by

meysewkassa100
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)
18 views34 pages

ch5

The document discusses programmable interface devices, focusing on the 8255 programmable peripheral interface, which facilitates communication between microprocessors and peripheral devices. It outlines the types of interfacing (memory and I/O), the modes of operation for the 8255, and the classification of peripherals into general and special purpose. Additionally, it details the pin functions, control word formats, and the operational modes of the 8255, including simple I/O, handshake I/O, and bidirectional I/O modes.

Uploaded by

meysewkassa100
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/ 34

SEng3231

Set by :
Molla K..
Chapter-5
Programmable Interface Devices
Programmable Interface Devices
 A programmable peripheral interface is a multiport device.
 The ports may be programmed in a variety of ways as
required by the programmer.
 The device is very useful for interfacing peripheral devices.
 Interface is the path for communication between two components.
 Two types of Interfacing :
o Memory Interfacing and
o I/O Interfacing.
 When we are executing any instruction, we need the microprocessor to
access the memory for reading instruction codes and the data stored in
the memory.
Programmable Interface Devices
 Interfacing enables the transfer of data between different
devices and a computer.
 This function includes the transmission of digital data, analog
signals, or a combination of both.

A hardware interface is a physical connection or set of


protocols that allows communication between different
hardware devices or between hardware and software.
It defines how signals and data are exchanged between the
components, enabling them to work together effectively.
Programmable Interface Devices

 It is an I/O port chip used for interfacing I/O devices with


microprocessor system.
 It is device used to implement parallel data transfer between
processor and slow peripheral devices like ADC, DAC, keyboard,
7-segment display, etc.
 A microprocessor is a programmable device that accepts binary data
from an input device, processes the data according to the
instructions stored in the memory and provides results as output.
Programmable Peripheral Interface
o 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.
o They are also programmable devices.
o 8255 is a popularly used parallel, programmable input-output device.
o It can be used to transfer data under various condition from
simple input-output to interrupt input-output.
o Peripheral devices can broadly be classified into two categories:
o General purpose peripherals
o Special purpose peripherals
a. General Purpose 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:

o Programmable Peripheral Interface……8255


o Programmable Interrupt Controller…….8259
o Programmable DMA Controller………...8237/8257
o Programmable Communication Interface……8251
o Programmable Interval Timer……………….8253/8254
b. Special Function Peripherals
o 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 special function
peripherals are:-
o Programmable CRT Controller
o Programmable Floppy Disc Controller
o Programmable Hard Disc Controller
o Programmable Keyboard and Display
Interface
 The functioning of these devices varies depending on the type of I/O
device they are controlling
8255- A programmable parallel IO device

o Designed to support the compatible with 8085.


 PORT A

8255A has three ports:  PORT B

 PORT C

o Port A and Port B are 8 bit parallel ports.

o Port C can be split into two parts, i.e. PORT C lower (PC0_PC3) and PORT C upper

(PC7_PC4) by the control word

 These three ports are further divided into two groups,


i.e. Group A includes PORT A and upper PORT C.
Group B includes PORT B and lower PORT C
 These two groups can be programmed in three different modes.
I/O Interfacing using 8255
Modes of Operation of 8255
• Two operating modes:
 I/O mode( Mode 0, Mode 1, Mode2)
 Bit Set/Reset Mode [ BSR]

o Features
 Outputs are latched , Inputs are buffered not latched.
 Ports do not have Handshake or interrupt capability.
 To increase the capacity of I/O interface.
 It is designed to work with various CPUs like 8085, 8086.
 8255 has three 8- bit bidirectional IO ports.
BIT SET/RESET Mode
o This is bit set/reset control word format.
o The PORT C can be Set or Reset by sending OUT instruction to the
CONTROL registers.
 PC0-PC7 is set or reset as per the status of D0.
 A BSR word is written for each bit.
Example:
 PC3 is Set then control register will be 0XXX0111.
 PC4 is Reset then control register will be
0XXX01000.
 X is a don’t care.
I/O Modes
 MODE 0(Simple IO ): In this mode , port A, port B and port C is used
as individually (Simply).

o Three operating modes :


o Mode-0(simple I/O port)
o Mode-1(Handshake I/O port)
o Mode-2(Bidirectional I/O port)
Mode 0
o In this mode, Port A and B is used as two 8-bit ports
and Port C as two 4-bit ports.
o Each port can be programmed in either input mode or
output mode where outputs are latched and inputs are
not latched.
o Ports do not have interrupt capability.
o Ports in Mode 0 is used to interfaces LEDs, Hexa
keypad and 7 segment LEDS to the processor.
Mode 1
o In this mode, Port A and B is used as 8-bit I/O
ports.
o They can be configured as either input or
output ports.
o Each port uses three lines from port C as
handshake signals.
o Inputs and outputs are latched
MODE 1 :(Input output with Handshake)
o In this mode, input or output is transferred by
hand shaking Signals.

o Handshaking signals is used to transfer data between


whose data transfer is not same.
Example:
o The computer send the data to the printer large speed
compared to the printer.
o When computer send the data according to the printer
speed at the time only, printer can accept.
o If printer is not ready to accept the data then after sending
the data bus , computer uses another handshaking signal to
tell printer that valid data is available on the data bus.
o Each port uses three lines from port C as handshake signal.
Mode 2
o In this mode, Port A can be configured as the
bidirectional port and Port B either in Mode 0 or
Mode 1.
o Port A uses five signals from Port C as handshake
signals for data transfer.
o The remaining three signals from Port C can be
used either as simple I/O or as handshake for port
B.
Mode 2 : Bi-directional I/O Data Transfer
o This mode allows bidirectional data transfer over a single 8-bit data bus
using handshake signals.
o This feature is possible only Group A Port A is working as 8-bit
bidirectional. PC3-PC7 is used for handshaking purpose.
o The data is sent by CPU through this port , when the peripheral request it.

 Control Word Formats:


o In the INPUT mode , When RESET is High all 24 pins (3-ports) be a
input mode. i.e all flip flops are cleared and the interrupts are rest.

o This condition is maintained even after RESET goes low.


o This can be avoid by writing single control word to the control registers ,
when required.
8255-Pin Diagram
Function of Pins
o Data bus(D0-D7):These are 8-bit bi-directional buses,
connected to 8085 data bus for transferring data.
o CS: This is Active Low signal. It stands for Chip Select.
o A LOW on this input selects the chip and enables the
communication between the 8255 and the CPU.
o Read: This is Active Low signal, when it is Low the
microprocessor reads data from a selected I/O port of
8255A.
o Write: This is Active Low signal, when it is Low the
microprocessor writes data into a selected I/O port .
Con’t
o Address (A0-A1):This is used to select the ports.
A1 A0 Select

0 0 PA

0 1 PB

1 0 PC

1 1 Control reg.
Con’t

o RESET: This is used to reset the device. That means clear control
registers.
oPA0-PA7:It is the 8-bit bi-directional I/O pins used to send the data to
peripheral or to receive the data from peripheral.
o PB0-PB7:Similar to PA
o PC0-PC7:This is also 8-bit bidirectional I/O pins. These lines are divided
into two groups.
• PC0 to PC3(Lower Groups)
• PC4 to PC7 (Higher groups)
o These two groups working in separately using 4 data’s.
Block Diagram-8255
Functions
 Data Bus Buffer: It has bidirectional data bus D0-D7
 D0-D7 is interfaced with system data bus of CPU.
 Read Write Control Logic Block: It has different terminal.
 8255 read and write data as per control signal RD and WR connected with
microprocessor.
 RESET will reset 8255.
 A1 and A0 used to select port and control word.
 CS is used to select chip of 8255.
Group A and Group B Control
 Group A Control is used to control PORT A [PA0-PA7] and upper PORT
C[PC7-PC4] .
 Group B Control is used to control PORT B [PB0-PB7] and Lower PORT
C[PC3-PC0] .
 It takes control signals from control word and forwards it on respective
ports.

o Port A , B and Port C Mode 0 Mode 1 Mode 2 BSR Mode

o There are 8 bit IO ports yes yes yes No

and works as follows: yes yes No No


yes No(HS) No(HS) yes
Control Word & Mode of 8255
o 8255 has 8 bits of control word.
o It defines working of IO ports A, B and C.
Control Word and Mode of 8255
o BSR [Bit Set Reset] Mode of 8255: BSR mode works only with PORT C.
Modes of 8255
o There are three 8 bits IO ports and works as follows:
Port Mode 0 Mode 1 Mode 2 BSR Mode
Port A yes yes yes No

Port B yes yes No No

Port C yes No(HS) No(HS) yes


o Here, mode 0 is simple IO mode
 Output are latched and input are not latched
 Port do not have interrupt handling capacity.
o Here, mode 1 is IO mode with handshake
 Here each port uses interrupt lime from port C Handshake signals
 Here, input and output are latched. Interrupt handling is supported
o Here, Mode 2 is Bidirectional IO mode with handshake
 Here port A uses five lines from Port C as handshake signal
 Interrupt handling is supported
Chaw
Any Q

You might also like