0% found this document useful (0 votes)
21 views28 pages

8255 Final - 1-4-2020

The document provides an overview of the 8255 Programmable Peripheral Interface (PPI), detailing its architecture, modes of operation, and control mechanisms. It describes the 24 I/O pins divided into three ports (A, B, and C) and outlines the various modes including Bit Set/Reset (BSR), Mode 0, Mode 1, and Mode 2. Each mode has specific functionalities for data transfer and control, emphasizing the importance of proper initialization through the Control Word Register (CWR).
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)
21 views28 pages

8255 Final - 1-4-2020

The document provides an overview of the 8255 Programmable Peripheral Interface (PPI), detailing its architecture, modes of operation, and control mechanisms. It describes the 24 I/O pins divided into three ports (A, B, and C) and outlines the various modes including Bit Set/Reset (BSR), Mode 0, Mode 1, and Mode 2. Each mode has specific functionalities for data transfer and control, emphasizing the importance of proper initialization through the Control Word Register (CWR).
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/ 28

Lecture On Microprocessor (EE306)

Introduction to 8255
01/4/2020
8255 PPI contd..
• The 8255 has 24 I/O pins divided into 3 groups of
8 pins each. The groups are denoted by port A,
port B and port C respectively. Every one of the
ports can be configured as either an input port or
an output port.
• Advantage of this chip, that it can be operated in
three different modes which are basically not
included in simple I/O interfacing; these different
types of operation extended the data transfer
policies.
Functions of each block and pins:
• Data Bus Buffer- The tri-state bidirectional 8 bit buffer is used to
interface the 8255A to the microprocessor data bus (D0-D7). Data is
transmitted or received by buffer upon the execution of input or
output instructions by the CPU.

• Control logic- has 6 lines


• RD(bar)- when s/g is low, mpu reads data from selected i/o ports of
the 8255A.
• WR(bar)- when s/g is low, mpu writes data into selected i/o ports of
the 8255A.
• Reset- active high. Clears the control register and sets all ports in
input mode.
• (Chip Select) (Bar)- A “Low” on this input pin enables the
communication between the 8085 and MPU.
• A0 and A1 - These are the address lines of 8255 which are directly connected
to the MPU lower address lines (A0, A1). In conjunction with chip select,
control the selection of one of the three ports or the control word register has
been made. The bit combination of these signals are shown bellow-

• Group A control- port A and Port C upper (PC4 – PC7)


• Group B control – Port B and Port C lower (PC0 – PC3)
I/O port Addressing
A7
A6 Port A=80H
A5
A4 CSb
A3
8255 Port C=82H
A2 A1 A1
A0 A0

IORb RDb Port B=81H


IOWb WRb Reset

Reset
CSb A1 A0 HEX Address Port
A7 A6 A5 A4 A3 A2 A1 A0
1 0 0 0 0 0 0 0 = 80H A
0 1 =81H B
1 0 =82H C
1 1 =83H Control Register
Control Word Register
Control Word Register contd..
• 8255A has 2 modes- Bit set/Reset (BSR)mode and I/O mode.
The BSR mode is used to set and reset the bits in port C. The
I/O is further divided into 3 modes: Mode 0, Mode 1 and
Mode 2.
• Using D7 bit, if D7 =0, port C operates in Bit set/reset modes.
• Using D7 bit, if D7 =1, bits D6-D0 determines I/O functions in
various modes.
• There are three basic I/O modes of operation that can be
selected by the system software after properly sets the
control word register format as per the requirements.
• Mode 0 – Basic Input/ Output
• Mode 1 – Strobe or Handshaking Input/ Output
• Mode 2 – Bi-directional Bus
• In Mode 0 all ports (A, B and C) can be used as 8-bit I/O ports and
configured by the control word registers. When the RESET input
goes “high” all ports will be set to input mode and after revoked of
this signal all ports remain in same mode until any initialization
established.
• In Mode 1 only Port A and B configured as I/O while the upper 4-bit
of port C used as strobe signal for port A and lower 4-bit of port C
used as strobe signal for port B.
• Mode 2 is available only for port A while port B can be used as
simple I/O mode and bit’s of port C used as strobe signal. Except of
these three modes of operation 8255A offers single Bit Set/ Reset
(BSR) features of port bits, which is limited to port C only. All of
these operations are maintained by a 8-bit single register called
Control Word Register (CWR).
• Before using this PPI chip user must be initialize all of these 8 bit
ports as input or output with proper modes of operation according
to the circuitry where it will be placed. This initialization can be
done by CWR register.
BSR MODE
• In this mode of operation, any of the 8-bits of
portC can be set or reset using a single OUT
instruction.
• This mode is enabled by resetting the D7 bit
=0 of control word register (CWR).
• Any of the 8-bit of port C is selected by the
combination of group of bits (D3, D2, D1) as
shown in fig.
MODE 0
• In this mode, D7= 1 and ports A and B are used as two
simple 8 bit ports and Port C as two 4 bit ports(half
port in C can be output/Input).
• Outputs are latched and input are not latched.
• Ports do not have handshake or interrupt capability.
• Disadvantage- In Mode-0, 8255A used as a receiver &
transmitter to exchange the data in between of
microprocessor & input/output devices. But in this
scheme exchange data may be lost by the both of
devices due to unknown timing of data throwing in
between them .
Example is as follows- write a program to read DIP switches and display the reading
from port B at port A and from port CL at port Cu.
MODE- 1
• In Mode -1, handshake signals are exchange between
MPU and peripherals prior to data transfer.
• Two ports (A and B) functions as 8 bit I/O ports.
• Each port uses 3 lines of port C as handshake signals.
The remaining two lines of port C can be used as I/O
ports.
• Input and output ports both are latched.
• Interrupt logic is supported.
• Advantages-To minimize the data lost rate 8255A made
a strobe or handshaking data exchanging facilities into
it.
Mode 1 (Input operation)
Let input device is connected to port PA0 to PA7 and red box is like 8 bit data which is to be
transferred to MPC.. First strobe signails(STB bar) is made low then data is transferred to input
device to 8255.
MODE- 1

Let input device is connected to port PA0 to PA7 and red box is like 8 bit data which is to be
transferred to MPC.. First strobe signails(STB bar) is made low then data is transferred to input
device to 8255. Then after data is with 8255 makes the IBF signals as high ,also STB Bar is made
high.
Mode 1 contd.

Let input device is connected to port PA0 to PA7 and red box is like 8 bit data which is to be
transferred to MPC.. First strobe signails(STB bar) is made low then data is transferred to input
device to 8255. Then after data is with 8255 makes the IBF signals as high ,also STB Bar is made
high. When data is with 8255 , an interrupt request is generated by 8255, by making INTR as high
Mode 1(input operation) contd

Fig 15.8 shows the control word to set port A and port B as input ports in mode 1. Fig 15.8 (c)
shows the status word, which will placed in accumulator if port C is read.
Mode 1 (Output operation)
Mode 1 (Output Operation)
Mode 1 (Example)
• Assignment- Problem 15.1.6 page no. 476 of
gaonkar in next class.
• P1- interface the circuit using 8255 in mode 1.
Port A acts as input port for keyboard with
interrupt I/O interuppt and Port B as output
port for printer with status check I/O.
Mode 2
• Only portA is used as a 8-bit bi-directional I/O
bus.
• Handshaking signal for communication is
provided by 5-bits of portC [PC3 to PC7].
• PC0 to PC2 is used as a simple input or output,
is set by mode-0 operation.
• PortB can be programmed either in mode-0 or
mode-1 configuration with PC0-PC2 used as a
handshaking signal where it is applicable.
Mode 2 Contd…
Reference
• 8085 by Ramesh Gaonkar chapter 15- General
Purpose Programmable Peripheral Devices.

You might also like