Professional Documents
Culture Documents
8255 Ppi
8255 Ppi
Pin Diagram
PA3
40
PB4
PA2
39
PB5
PA1
38
PB6
PA0
37
PB7
RD
36
WR
CS
35
RESET
GND
34
D0
A1
33
D1
A0
32
31
D2
3
D3
30
D4
PC7
10
PC6
11
PC5
12
29
D5
PC4
13
28
D6
PC0
14
27
D7
PC1
15
26
VCC
PC2
16
25
PB7
PC3
17
24
PB6
PB0
18
23
PB5
PB1
19
22
PB4
PB2
20
21
PB3
8255A
Ports
There are four ports which can be configured
as either input or output.
Port A is an indivisible 8-bit port. Port B is an
indivisible 8-bit port. Port C (upper) is an
indivisible 4-bit port. Port C (lower) is an
indivisible 4-bit port.
PORT A
This is a 8-bit buffered I/O latch, can be
programmed as input or output port.
It can also be an 8-bit bidirectional port.
It can be programmed by mode 0 , mode 1,
mode 2 .
PORT B
This is a 8-bit buffer I/O latch, can be
programmed as in input or output port.
It can be programmed by mode 0 and mode 1
It cannot be used as an 8-bit bi-directional
port.
PORT C
It is splitted into two parts. Port C can also be
either an input or an output port.
Each 4 bit port can be either an input or an
output port.
It can be programmed by bit set/reset
operation.
Operation modes
BSR mode
I/O mode
I/O mode is of 3 types
Mode 0: Simple I/O
Mode 1: Handshaking I/O
Mode 2: Bidirectional I/O
Example
Write a program to initialize 8255 in following
configuration.
Port A: Simple input
Port B: Simple input
Port C(Lower): Output
Port C(Upper): input
Assume address of control word register o 8255 is
83H
The 8255A latches the data on the port using the STB/
signal to enable its input latches.
After latching the data the 8255A asserts the IBF signal
to tell the peripheral it has read the data and that the
input latches are full.
The IBF signal remains asserted until the processor
reads the data stored in the port latches.
On receiving the IBF signal from the 8255A, the
peripheral de-asserts the STB/ signal.
If the INTE bit of the port is set (accomplished by bit set facility on
port C) then when both IBF and STB/ are logic 1 an interrupt is
generated on the ports INTR line.
With this line connected to one of the 8085As interrupt input pins
and with processor interrupts enabled then when INTR goes high an
interrupt service routine will be executed.
The ISR is required to read the data from the 8255A input port.
When the data has been read from the port, the 8255A de-asserts
its IBF control signal telling the peripheral device that the data has
been read by the processor and that it is free to send new data.
Example
Write a program to initialize 8255 in following
configuration.
Port A: Output with handshake
Port B: input with handshake
Port C(Lower): Output
Port C(Upper): input
Assume address of control word register o 8255 is
23H
D7
D6
D5
D4
D3
D2
D1
D0
MVI A, AEH
OUT 23H
Mode 2 - Sequencing