8255 presentaion.ppt

2,869 views 30 slides May 23, 2023
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

8255 controller presentaion


Slide Content

8255 PROGRAMMABLE
PERIPHERAL INTERFACE (PPI)
Features:
•It is an I/O port chip used for interfacing I/O
devices with microprocessor
•It is a programmable device.
•3 ports-Port A, Port B and Port C.
•Port C composed of two independent 4-bit ports-
PC7-4 (PC Upper) and PC3-0 (PC Lower)
•Improved dc driving capability

P A 3
P A 2
P A 1
P A 0
RD
CS
GND
A1
A0
P C 7
P C 6
P C 5
P C 4
P C 0
P C 1
P C 2
P C 3
P B 0
P B 1
P B 2
P B 4
P B 5
P B 6
P B 7
WR
R E S E T
D0
D1
D2
D3
D4
D5
D6
D7
V C C
P B 7
P B 6
P B 5
P B 4
P B 3
1
3
2
4
5
6
7
3
3
9
8
10
12
13
11
14
15
16
17
19
20
18
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
8255A Pin diagram8255

Pin Diagram
Bi-directional
Port A pins
Port C
lower pins
Port C
upper pins
Bi-directional
Data pins
Address
pins
Bi-directional
Port A pins
Bi-directional
Port B pinsBi-directional
Port B pins
Chip select
Read input Write input
Reset 8255

Function of pins:
•Data bus(D
0-D
7):These are 8-bit bi-directional
buses, connected to 8085 data bus for
transferring data.
•CS: This is Active Low signal. When it is low,
then data is transfer from 8085.
•Read: This is Active Low signal, when it is Low
read operation will be start.
•Write: This is Active Low signal, when it is Low
Write operation will be start.

•RESET: This is used to reset the device. That
means clear control registers.
•PA
0-PA
7:It is the 8-bit bi-directional I/O pins
used to send the data to peripheral or
to receive the data from peripheral.
•PB
0-PB
7:Similar to PA
•PC
0-PC
7:This is also 8-bit bidirectional I/O pins.
These lines are divided into two groups.
1.PC
0to PC
3(Lower Groups)
2.PC
4to PC
7(Higher groups)
These two groups working in separately using 4
data’s.

•Address (A
0-A
1):This is used to select the
ports. like this
A1 A0 Select port
0 0 Port A
0 1 Port B
1 0 Port C
1 1
Control
register

Block Diagram of 8255 PPI

Data Bus buffer:
•It is a 8-bit bidirectional Data bus.
•Used to interface between 8255 data bus
with system bus.
•The internal data bus and Outer pins D
0-
D
7pins are connected in internally.
•The direction of data buffer is decided by
Read/Control Logic.

Read/Write Control Logic:
•This block get the input signals from
control bus and Address bus of CPU
•Control signal are RD and WR.
•Address signals are A0,A1,and CS.
•8255 operation is enabled or disabled
by CS.

Group A and Group B control:
•Group A and B get the Control Signal from
CPU and send the command to the individual
control blocks.
•Group A send the control signal to port A and
Port C (Upper) PC7-PC4.
•Group B send the control signal to port B and
Port C (Lower) PC3-PC0.
•PORT A:
•This is a 8-bit buffered I/O latch.
•It can be programmed by mode 0 , mode 1,
mode 2 .

PORT B:
•This is a 8-bit buffer I/O latch.
•It can be programmed by mode 0 and
mode1.
•PORT C:
•This is a 8-bit Unlatched buffer Input and an
Output latch. splitedinto two parts. PC
U,PC
L
•programmed by bit set/reset operation.
•Can be used as 1) simple I/O 2) handshake
signals 3) status signals

8255 –Modes of Operation
Programmable Peripheral Interface (PPI)
Modes
BSR
BIT SET-REST
I/O MODE
MODE 0
Basic I/O Mode
MODE 1
Strobed I/O Mode
MODE 2
Strobed Bidirectional
I/O

8255 operating modes
•The 8255 can work in 2 modes
that are I/O mode and BSR mode
•i/o mode is further divided in to
1. Mode 0 (Basic I/O)
2. Mode 1 (Strobe I/O)
3. Mode 2 (Bi -Conditional Bus)

There are 2 control words in 8255
Mode Definition (MD) OR I/O Control word and
Port C Bit Set / Reset (PC BSR) Control Word
I/O control word configures the ports of 8255
-as i/p or o/p in Mode 0, 1, or 2
PCBSR control word is used to set to 1 or reset to 0
any one selected bit of Port C
14
8255 operating modes

Port A can work in Mode 0, Mode 1, or Mode 2
Port B can work in Mode 0, or Mode 1
Port C can work in Mode 0 only, if at all
Port A, Port B and Port C can work in Mode 0
Port A and Port B can work in Mode 1
Only Port A can work in Mode 2
15
8255 PORTS

Operation modes:
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).
•Features:
•Outputs are latched , Inputs are buffered not
latched.
•Ports do not have Handshake or interrupt capability.

•MODE 1 :(Input/output with Hand shake)
•In this mode, input or output is transferred by
hand shaking Signals.
•Handshaking signals is used to transfer data
between whose data transfer is not same.
Computer
Printer
DATA BUS
STB
ACK
Busy

•Example:
•The computer send the data to the printer
large speed compared to the printer.
•When computer send the data according to
the printer speed at the time only, printer can
accept.
•If printer is not ready to accept the data then
after sending the data bus , computer uses
another handshaking signal to tell printer that
valid data is available on the data bus.
•Each port uses three lines from port C as
handshake signals

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 in Group A
•Port A is working as 8-biT bidirectional.
•PC3-PC7is used for handshaking purpose.
•The data is sent by CPU through this port ,
when the peripheral request it.

CONTROL WORD FORMATS:
•The control word for both mode is same.
•Bit D7 is used for specifying whether word
loaded in to Bit set/reset mode or Mode
definition word.
•D7=1=Mode definition mode.
•D7=0=Bit set/Reset mode.

•FOR I/O MODE:
The mode format for I/O as shown in figure
D7D6D5D4D3D2D1D0
Group A
Port C Upper
1=Input
0=Output
Port B
1=Input
0=Output
Mode
selection
00=mode 0
01=mode 1
1x=mode 2
Group B
Port C Lower
1=Input
0=Output
Port B
1=Input
0=Output
Mode selection
0=mode 0
1=mode 1
Mode set
flag=1=Active

8255 I/O Control word
Control port having Mode Definition (MD) control word
1M2AM1AI/P AI/P C
UM1BI/P BI/P C
L
Means Mode
Definition
control word
1 -PC
U as input
0 -PC
U as output
1 -PAas input
0 -PA as output
1 -PC
L as input
0 -PC
L as output
1 -PBas input
0 -PB as output
1 –Port Bin Mode 1
0 –Port B in Mode 0
M2AM1A
0 0Port A in Mode 0
0 1Port A in Mode 1
1 0/1Port A in Mode 2
22

Ex. 1: Configure Port A as i/p in Mode 0, Port B as o/p in
mode 0, Port C (Lower) as o/p and Port C (Upper) as i/p
ports.
Required MD control word:
10011000=98H
MD control PC Lower as o/p
PA in Mode 0 PB as o/p Reqd. instrns.
PA as i/p PB in Mode 0MOV AL, 98H
PC Upper as i/pOUT 7FH, AL
23
8255 I/O Control word

Ex. 2: Configure Port A as i/p in Mode 1, Port B as o/p in
mode 1, Port C7-8 as i/p ports. (PC5-0 are handshake lines,
some i/p lines and others o/p. So they are shown as X)
Required MD control word:
1011110X=BCH or BDH
MD control PC3-0 as don’t care
PA in Mode 1 PB as o/p Reqd. Instrns.
PA as i/p PB in Mode 1 MOV AL,BCH
PC Upper(C7-8) as i/pOUT 7FH, AL
24
8255 I/O Control word

Ex. 3:Configure Port A in Mode 2, Port B as o/p in mode 1.
(PC5-0 are handshake lines for Port A and PC2-0 are
handshake signals for port B)
Required MD control word:
110XX10X=C4H / C5H..
MD control PC3-0 as handshake
PA in Mode 2 PB as o/p Reqd. instrns.
PA bidirectionalPB in Mode 1MOV AL, C4H
PC7-0 as handshakeOUT 7FH, AL
25
8255 I/O Control word

FOR BIT SET/RESET MODE:
•This is bit set/reset control word format.
X X X
Don’t care
Bit select
B0
B1
B2
D7D6D5D4D3D2D1D0
01234567
01010101
00110011
00001111
BIT SET/RESET
1=SET
0=RESET
BIT SET/RESET FLAG
=0 Active

8255 PCBSR Control word
Control port having Port C Bit Set / Reset control word
0XXXSB2SB1SB0S/R*
PC bit set
/ reset
control
word
Select bit of PC
to be set / reset
1 -Set to 1
0 -Reset to 0Don’t
cares 000Bit 0 of Port C
001Bit 1 of Port C
:
:
111Bit 7 of Port C
27

8255 PCBSR Control word contd.
Ex. 2: Reset to 0 bit 6 of Port C
0XXX1 1 0 0= 0CH,…
PC bit set
/ reset
control
word
Bit 6 of PC
Reset to 0
Don’t
cares Required instructions
MOV AL, 0CH
OUT 7FH, AL
28

8255 PCBSR Control word contd.
Ex. 1: Set to 1 bit 4 of Port C
0XXX1 0 0 1= 09H,…
PC bit set
/ reset
control
word
Bit 4 of PC
Set to 1
Don’t
cares Required instructions
MOV AL, 09H
OUT 7FH, AL
29

•PC0-PC7is set or reset as per the status of D0.
•A BSR word is written for each bit
•Example:
•PC3is Set then control register will be
0XXX0111.
•PC4is Reset then control register will be
0XXX01000.
•X is a don’t care.