0% found this document useful (0 votes)
37 views11 pages

8255 Peripheral Interface

The document discusses the 8255 programmable peripheral interface. It describes the ports, control word formats, modes of operation and how to communicate with the 8255. An example is given to read switch inputs on port A and output to LEDs on port B.

Uploaded by

Sumanth Reddysr
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)
37 views11 pages

8255 Peripheral Interface

The document discusses the 8255 programmable peripheral interface. It describes the ports, control word formats, modes of operation and how to communicate with the 8255. An example is given to read switch inputs on port A and output to LEDs on port B.

Uploaded by

Sumanth Reddysr
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/ 11

8255 PROHGRAMMABLE PERIPHERAL INTERFACE

What for? UNIT V


• Any application of Microprocessor Based system requires the
transfer of data between external circuitry to the Microprocessor
and Microprocessor to the External circuitry. User can give
information (i.e. input) to the Microprocessor using keyboard and
DIRECT MEMORY ACCESS
user can see the result or output information from the
Microprocessor with the help of display.
• Hence interfacing is used to exchange information between two
different applications/devices. 8255 is one such programmable
interface.
8255 BLOCK DIAGRAM DESCRIPTION
D0-D7 (Data Bus)
▪ These are bidirectional, tri-state data bus lines connected to the system
data bus. They are used to transfer data and control word from
microprocessor (8086) to 8255 or receive data or status word from 8255
to the 8086.
PA0-PA7 (Port A)
▪ These are 8 Bit bidirectional I/O pins used to send data to output device
and to receive data from input device. It functions as an 8 Bit data output
latch/buffer when used in output mode and as an 8 Bit data input
latch/buffer when used in input mode.
PB0-PB7 (Port B)
▪ These are 8 Bit bidirectional I/O pins used to send data to output device
and to receive data from input device. It functions as an 8 Bit data output
latch/buffer when used in output mode and as an 8 Bit data input
latch/buffer when used in input mode.
PC0-PC7 (Port C)
▪ These are 8 bit bidirectional I/O pins divided into two groups PCL (PC3-
PC0) and PCU (PC7-PC4). These groups can individually transfer data in or
out when programmed for simple I/O, and used as handshake signals
when programmed for handshake or bidirectional modes.
__
RD : When this pin is low, the CPU can read data from the ports through the data
bus buffer.
__
WR: When this pin is low, the CPU can write data on the ports or in the control
register through the data bus buffer.
__
CS: When this pin is low, the 8255 will be selected by the CPU for read or write
operation.

RESET: This pin is used to reset 8255.i.e control register gets cleared and all the
ports are set to the input mode.

A1-A0: The selection of port and control register is done by using A0 and A1 pins
In conjunction with RD and WR pins as below.
__ __ __
A1 A0 RD WR CS Operations
0 0 0 1 0 PORT A TO DATA BUS

0 1 0 1 0 PORT B TO DATA BUS

1 0 0 1 0 PORT C TO DATA BUS

0 0 1 0 0 DATA BUS TO PORT A

0 1 1 0 0 DATA BUS TO PORT B

1 0 1 0 0 DATA BUS TO PORT C

1 1 1 0 0 DATA BUS TO CONTROL REGISTER


x x x x 1 DATA BUS TRI STATED

1 1 0 1 0 ILLEGAL CONDITION

x x 1 1 0 DATA BUS TRI STATED


8255 MODES OF OPERATION

8255 modes

Basic I/O mode Bit Set Reset (BSR) mode

Mode 0 Mode 1 Mode 2


Mode 0:
▪ In this mode port A, port B and port C can be used individually either as
input or as output.
Mode 1:
▪ In this mode port A, port B can be used individually either as input or as
output.
▪ Port C is used as handshake lines for port A and port B.
Mode 2:
▪ In this mode port A is used as bidirectional data bus.
▪ Port B is used either as input or as output either in mode 0 or in mode 1.
▪ Port C is used as handshake lines for port A and port B.
BSR mode:
▪ This mode is applicable only for port C
▪ Each bit in port C can be set or reset individually
▪ This is used for On/Off applications.
8255 CONTROL WORD FORMAT
1) I/O Control Word Format
2) BSR Control Word Format
COMMUNICATING WITH 8255
To communicate with peripherals using 8255
#1 Need to determine the address of port A, B, C and control register
#2 Need to determine the suitable control word
#3 Write the control word into the control register
#4 Use IN/OUT instructions in the program to communicate with peripherals
Example:
An 8255 is interfaced with 8 number of switches at port A, and 8
number of LEDs at port B, as shown in the Figure below. It is required
to read the status of the switches and display it in the LEDs. Determine
a suitable control word and develop a program to perform the
requirement. Assume that the address of Port A,B,C and control
register is FFE0,FFE2,FFE4 and FFE6 respectively

Control word: 1 0 0 X 0 0 0 0 X=80H

Program:
MOV DX, FFE6
MOV AL, 10000000B
OUT DX,AL
MOV DX, FFE0
IN AL, DX
MOV DX, FFE2
OUT DX,AL

You might also like