Professional Documents
Culture Documents
Interface
8255 Programmable Peripheral Interface
Used to interface the peripherals devices with µp.
40 pin DIL package and operates with single +5V
DC supply
Three 8-bit namely PORT A,PORT B and PORT C
Port C subdivided into two 4 bit port
C upper(PC7-PC4) and C lower (PC3-PC0)
Two groups-
Group A: Port A and port C(upper)
Group B: Port B and port C(lower)
8255 Programmable Peripheral Interface
A1 A0 Selected
0 0 PORT A
0 1 PORT B
1 0 PORT C
1 1 Control register
Operation modes of 8255
BIT SET/RESET MODE:
The PORT C can be Set or Reset by sending OUT
instruction to the CONTROL registers.
I/O MODES:
•MODE 0(Simple input / Output):-In this mode , port A,
port B and port C is used as individually (Simply).
•MODE 1 :(Input/output with Hand shake):-In this
mode, input or output is transferred by hand shaking
Signals.
8255 Operation modes
MODE 2:bi-directional I/O data transfer:
• This mode allows bidirectional data transfer over a
single 8-bit data bus using handshake signals.
• This feature is possible only Group A
• Port A is working as 8-bit bidirectional.
• PC4-PC7 is used for handshaking purpose.
• Mode 0 : Simple I/O
• Any of A, B, CL and CH can be programmed as input or
output
• Mode 1: I/O with Handshake
• A and B can be used for I/O
• C provides the handshake signals
• Mode 2: Bi-directional with handshake
• A is bi-directional with C providing handshake signals
• B is simple I/O (mode-0) or handshake I/O (mode-1)
• BSR (Bit Set Reset) Mode
• Only C is available for bit mode access.
• Allows single bit manipulation for control applications
Control Word Format in I/O Mode
1 D6 D5 D4 D3 D2 D1 D0 GROUP B
PORT C (LOWER)
1=I/P, 0=O/P
PORT B
1=I/P, 0=O/P
MODE SELECTION
0 = MODE 0
1 = MODE 1
GROUP A
PORT C (UPPER)
1=I/P, 0=O/P
PORT A
1=I/P, 0=O/P
MODE SELECTION
00 = MODE 0
MODE SET FLAG 01 = MODE 1
1 = ACTIVE 1X = MODE 2
What will be the control word to intialise 8255
in following modes:
Port A-mode 0- input
Port B-mode 0-output
Port Cupper-mode 0-output
Port Clower-mode 0-input
Sol: 91H
What will be the control word to initialize 8255 in following
modes:
Port A-mode 0- input
Port B-mode 0-input
Port Cupper-mode 0-input
Port Clower-mode 0-input
Program:
MVI A,98H ; LOAD CONTROL
WORD
• Solution:
1 0 1 0 1 1 1 0
= AEH
Program:
MVI A,AEH ; LOAD CONTROL
WORD
BIT SELECT
0 1 2 3 4 5 6 7
0 1 0 1 0 1 0 1 B0
0 0 1 1 0 0 1 1 B1
0 0 0 0 1 1 1 1 B2