Saint Louis University School of Engineering and Architecture Department of Electrical Engineering
Saint Louis University School of Engineering and Architecture Department of Electrical Engineering
Saint Louis University School of Engineering and Architecture Department of Electrical Engineering
8255 Microprocessor
Form the above block diagram it is noticed that any kind of I/O devices could be
connected with three ports like Port A, Port B, Port C. due to this features buffer and
latch devices are not needed for particular input or output application so, user has
flexibility to use same ports as input or output application. Another 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 word and
status word also transferred through this data bus buffer.
Read write control logic- The function of this block is to manage all the internal and
external transfers of both data and control or status word. This block also handles user
information regarding operational mode selection, configuration of ports as an input or
output; all of this information stored in 8-bit control word register (CWR). The details of
each pin connected with this block are described below,
̅̅̅̅
𝐶𝑆(Chip Select)- 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 below-
̅̅̅̅ 𝑎𝑛𝑑 𝑊𝑅
𝑅𝐷 ̅̅̅̅̅ - A “LOW” on this pin enable 8255 to send data or status information to MPU
via data bus (i.e. read operation) or enable MPU to write data and control word register
value to 8255 via data bus (i.e. write operation).
RESET -A “HIGH” on this pin clears the control word register and all ports (A,B,C) are
set to input mode.
Ports A, B and C
The 8255A contains three 8-bit ports (A, B and C). All can be configured in a
wide variety of functional characteristics by the system software but each has its own
special features to enhance the power and flexibility of the 8255A. The major function of
each ports has 8-bit Input or Output, buffer or latch and only Port C can be configured
as double 4-bit latch, it is used for control signal output and status signal inputs in
conjunction with ports A and B.
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. The
format of CWR is shown below
Mode 1 – Strobed or Handshaking Input/ Output
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 so, both of the devices should be fully devoted in this throughout process to
successfully exchanging the data. This scenario may cause slow performance on
device other task execution speed except data exchanging task, it is very effective issue
for microprocessor rather than I/O devices task execution policies; where various task
are executed serially. To resolve this problem & minimize the data lost rate 8255A made
a strobe or handshaking data exchanging facilities into it.
This mode has some advantage over mode-0 respect to the task execution
priorities of microprocessor as follows:
1. During exchanging the data with slow devices, μp can perform another task
without scanning the port in a timely manner.
2. Data overwrites (during read or write operation) in a port can be resolved by a
special status signal.
• Three ports divided into two groups (Group A•& Group B); where portC split into
two parts for the following groups.
• Each group contains one 8-bit data port & one 4-bit control port
• 8-bit data port can be used as input or output. Both of the cases data are
latched.
• The 4-bit port is used for control or status of the 8-bit port.
• After selection of two groups port bits, remaining bits of portC may used as a
simple input or output.
Input control signal definition:
𝑺 𝑻 𝑩 (Strobe Input) : a “Low” on this input denotes that an input device loads data
into the input latch (portA or portB) & after completing its task this signal remain in
“High”.
IBF (Input Buffer Full) : it is an output of a flip flop (“High”) indicated to the input
devices that input latch is now full & no data cannot be received yet until μp reads
the data from latch. It will reset after read the data by CPU & thereafter input devices
can send data again.
INTR (Interrupt Request) : it is an output signal (“High”) used for interrupt the CPU to
read the received data from input latch. This signal occurred when 𝑺 𝑻 , IBF & INTE
are all in logic “High”. After getting this signal CPU finishes its current execution &
generates a 𝑅 𝐷 signal to read the corresponding data & it is reset by falling edge of
𝑅 𝐷.
NTEA & INTEB is controlled by bit set/reset of PC4 & PC2 respectively
This mode is enabled by resetting the D7 bit of control word register (CWR) &
after choosing this bit the format of CWR is completely changed from I/O mode
structure. The format of CWR in BSR mode is shown below –
Any of the 8-bit of portC is selected by the combination of group of bits (D3, D2,
D1) as shown in fig.11 and selected portC bit is control by D0 bit of CWR to ensure set
or reset operation of the following bit.
A comparative ALP programming is depicts the simplicity of BSR modes respect
to the I/O modes of operation. Major confusing part of these two modes of operation is
accessing the address of CWR and portC which is clearly mentioned in above two
comparative statements by following “bold” text line.
Reference: http://sdprofile.weebly.com/uploads/2/8/0/1/28011053/ppi_chip-_8255.pdf