8255 Programmable Peripheral Interface

Download Report

Transcript 8255 Programmable Peripheral Interface

8255
Programmable Peripheral Interface
1
8255
• It is a programmable peripheral Interface
with three i/o ports
– A 8 bits
– B 8 bits
– C 4 bits upper and 4 bits lower
2
PA3
1
40
PB4
PA2
2
39
PB5
PA1
3
38
PB6
PA0
4
37
PB7
RD
5
36
WR
CS
6
35
RESET
GND
7
34
D0
A1
8
33
D1
A0
9
32
PC7
10
31
D2
3
D3
PC6
11
30
D4
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
Pin diagram 8255
3
3
8255 Block Diagram
Power
Supplies
Bidirectional
Data Bus
D7 - D0
RD
WR
A1
A0
RESET
CS
+ 5V Group
GND A
control
Data
bus
buffer
Read/
write
control
logic
Group
A
prot
A
(8)
8 - bit
Internal
data bus
Group
B
control
IO
PA7 - PA0
Group
A
prot C
Upper
(4)
IO
PC7 - PC4
Group
A
prot C
Lower
(4)
IO
PC3 - PC0
Group
B
prot
B
(8)
IO
PB7 - PB0
4
D7 - D0
A
B
C
A6
A5
A0
G1
G2A
G2B
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
Port C
A7
A3
A4
RD
PB0
WR
PB1
A0
PB2
A1
PB3
RESET PB4
CS
PB5
PB6
PB7
Port B
IORC
IOWC
A1
A2
RESET
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
Port A
D0
D1
D2
D3
D4
D5
D6
D7
5
PA, PB, PC
(Port A,B,C)
CS (Chip Select)
RD (Read)
WR (Write)
8 bit i/o ports
A low signal at this pin enables the chip
Read enable
D0-D7 (Data Bus)
Write enable
Bi-directional data lines
A0,A1 (Address)
Address select
6
8255
• 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)
7
D7 D6 D5 D4 D3 D2 D1 D0
1
Group B
Port C (lower)
1 = input
0 = output
Port B
1 = input
0 = output
Mode selection
00 = mode 0
01 = mode 1
1x = mode 2
Group A
Port C (upper)
1 = input
0 = output
Port A
1 = input
0 = output
Mode selection
00 = mode 0
01 = mode 1
1x = mode 2
Control Bytes for
I/O mode
8