You are on page 1of 11

MICROPROCESSOR 8085

LECTURE 27
8255 PROGRAMMABLE PERIPHERAL INTERFACE
Sukantho Sikder
PROGRAMMABLE PERIPHERAL
INTERFACE
• PPI IC is the supporting IC of the microprocessor which is used to interface
I/O device with microprocessor.
• Since, microprocessor has fixed number of data and address bus lines and
none of the lines are dedicated for I/O interfacing.

Port A
Input

device
Port B Output
8055 8255
device
Port C
Input
device
IC 8255
BLOCK DIAGRAM OF 8255
CONTROL REGISTER AND PORT ADDRESS

𝐶𝑆 A1 A0 Selected
0 0 0 Port A

0 0 1 Port B

0 1 0 Port C

0 1 1 Control

Register
1 X X 8255 is
not
selected
CONTROL WORD
• Contents of the control register are called the control word and they
specify an I/O function for each port.
• This register can be accessed to write a control word when A0 and
A1
are at logic 1.
• This register is not accessible for read operation.
• There are two types of control word for PPI IC
• BSR Mode – Bit Set Reset Mode
• I/O mode- Input output mode
 Mode 0 - Simple Input or Output
 Mode 1 - Handshake Input or Output
 Mode 2 - Bidirectional Input or Output
CONTROL WORD
D7 D6 D5 D4 D3 D2 D1 D0
0 1

BSR MODE
For PORT C I/O
No effect on PORT Mode
A and PORT B

MODE MODE MODE


0 1 2
Simple Input Strobed Bidirectional data bus
or Output for I/O for for Port A
Port A, B Port A Port B: Either in Mode
and C and/or B 0
or 1
CONTROL WORD FORMAT FOR I/O MODE
D D D D D D D D
Group B
7 6 5 4 3 2 1 0
Port C Lower, 1 = Input, 0 =
Output
Port B, 1 = Input, 0 = Output
Mode Selection, 0=Mode 0, 1 =
Mode 1
Group A
Port C Upper, 1 = Input, 0 = Output
Port A, 1 = Input, 0 = Output
Mode Selection, 00=Mode 0, 0 1 =
Mode 1
1X= Mode 2

1 = I/O Mode, 0 = BSR Mode


MODE 0
• Ports A and Port B are used as two simple 8 bit I/O ports and
Port C as two 4 - b i t ports.
• Each port (or half port, as in C) can be programmed to
function
simply as input port or output port.

MODE 1
• Port A and Port B both are designed to operate in this mode of
operation.
• When Port A and B are programmed in Mode 1 and are
configured as input ports, then, Port A uses the upper three
signals of Port C: PC3, PC4, PC5 where as Port B uses the lower
MODE 2
• This is a bidirectional mode of operation.
• Port A can be programmed to operate as a bidirectional port.
• Mode 2 operation is only for Port A.
• When Port A is programmed as Mode 2, Port B can be used
either as Mode 0 or 1.
BSR
MODE
• This mode is concerned only with the eight bits of Port C, which
can be set/reset by writing appropriate control word.
D7 D6 D5 D4 D3 D2 D0
0 X X X Set/Rese
D1 t
Bit Select 1 = Set
000= Bit 0 0 = Reset

BSR 001= Bit 1


mode Not used, 010= Bit 2
Generally set to 011= Bit 3
0
100= Bit 4
101= Bit 5
110= Bit 6
111= Bit 7

You might also like