3. 82C55 final-Updated.pptx
3. 82C55 final-Updated.pptx
8255 or 82C55
1
The programmable peripheral Interface
The 82C55 programmable peripheral interface (PPI) is a very
popular low-cost interfacing component that is used found in
many applications.
Applications range from 7-segment display, stepper motor
connection, counters to key pad management.
This device is still in use today and is used to interface and detect
key presses on modern keyboards, parallel printers and other
interfacing chipsets.
For those of you who are doing computer interfacing course you
will be extensively using this device to interface various devices
with the PC.
2
Pin Diagram 8255
3
Connection Diagram
8 bit
Date and Address Bus
Control Port A (8 bit)
Register
Read (Active low)
Port B (8 bit)
Write (Active low) I/O
MPU A0
8255 devices
A1 Port CUpper (4 bit)
Reset (Active high) Port CLower (4 bit)
Chip Select (Active low)
A1 A0 Function
0 0 Port A
0 1 Port B
1 0 Port C
4
1 1 Command Registers
Connection Diagram
8 bit
Date and Address Bus
Control Port A (8 bit)
Register
Port CUpper (4 bit) Group A
Read (Active low)
Write (Active low)
MPU A0
8255
Port B (8 bit)
A1
Reset (Active high) Port CLower (4 bit) Group B
Chip Select (Active low)
5
82C55
This devices has 24 pins for I/O.
6
Function of pins:
• Data bus(D0-D7):These are 8-bit
bi-directional buses, connected to 8085 data
bus for transferring data.
A1 A0 Function
0 0 Port A
0 1 Port B
1 0 Port C
1 1 Command Registers
8
• RESET: This is used to reset the device. That means
clear control registers.
• PB0-PB7:Similar to PA
A1 A0 Function
0 0 Port A
0 1 Port B
1 0 Port C
10
1 1 Command Registers
Click on Correct Answer
Data Bus 🡪 Port A
Data Bus 🡪 Port C
Data Bus 🡪 Control
16
FOR BIT SET/RESET MODE:
• This is bit set/reset control word format.
D7 D6 D5 D4 D3 D2 D1 D0
X X X BIT SET/RESET
1=SET
Don’t care 0=RESET
Bit select
0 1 2 3 4 5 6 7
B0
0 1 0 1 0 1 0 1
0 0 1 1B10 0 1 1
0 0 0 0B21 1 1 1
PC7=111
0 X X X 1 1 1 0
20
Control Register
Bit Set-Reset Mode
Port A (8 bit)
Control
Register
Port B (8 bit)
8255
PC7
0
Port C
PC0
21
Click on Correct Answer
PC7 Set
01110100🡪 PC2 Reset
Both are wrong answer
01010XXX
We want to PC5 set🡪 0XXX1010
0XXX1011
PC0 Set
00000000🡪 PC7 Reset
Both are wrong answer
PC2 Set
01010101🡪 PC2 Reset
In I/O Mode 22
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-0
8 LED
Port A (8 bit)
00001111 Control
Register
Port B (8 bit)
8 LED
8255
Port CUpper (4 bit)
24
• MODE 1 :(Input/output with Hand shake)
• In this mode, input or output is transferred by
hand shaking Signals.
11011011
2-1…4-0
Busy
Port A (8 bit)
Control Printer
Register
27
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-biy bidirectional IO.
• PC3-PC7 is used for handshaking purpose.
• The data is sent by CPU through this port, when it
is required.
Mode-2
1 1 X X X 0 0 1
Port A (8 bit)
Control Touch
Register Screen
29
• FOR I/O MODE:
The format of control word
D7 D6 D5 D4 D3 D2 D1 D0
Group A Group B
Port C Upper
1=Input Port C Lower
Mode set
0=Output 1=Input
flag=1=Active
Port A 0=Output
1=Input Port B
0=Output 1=Input
Mode selection 0=Output
00=mode 0 Mode selection
01=mode 1 0=mode 0
1x=mode 2 1=mode 1
Control word format
Group-A Group-B
Bit Set-reset/
IO Operation
1
Port-Cupper Port-Clower
Mode-1
Port-A Port-B
Mode
31
Details connections of 82C55
8-bit data 8-bit buffered
bus buffer I/O latch
Port A (8 bit)
8-bit Unlatched
buffer Input and
an Output latch
32
Writing to Control word for
Mode-0
8 LED
Port A (8 bit)
10001001 Control
Register
Read 🡪 1 Port B (8 bit)
Write 🡪 0 8 LED
MPU A0 🡪 1
8255
A1 🡪 1 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
33
Control Register
Writing to Control word for
Mode-1
Port A (8 bit)
1010X11X Control Printer
Register
Read 🡪 1
Write 🡪 0 Port CUpper (Pin 3, 6, 7)
MPU A0 🡪 1
8255
Port B (8 bit)
A1 🡪 1
Reset 🡪 0 Keyboard
Chip Select 🡪 0
Port CLower (Pin 0, 1, 2)
1 0 1 0 X 1 1 X
34
Control Register
Writing to Control word for
1. Control Register configure
2. Input from Keyboard Mode-2
3. Print that to touch screen
4. Also read from touch screen
Port A (8 bit)
Control Touch
Register Screen
Read 🡪 0
Write 🡪 1 Port CUpper (Pin 3, 4, 5, 6, 7)
MPU A0 🡪 0
8255
Port B (8 bit)
A1 🡪 0
Reset 🡪 0 Keyboard
Chip Select 🡪 0
Port CLower (Pin 0, 1, 2)
A1 A0 Function
0 0 Port A
0 1 Port B 1 1 X X X 1 1 X
35
1 0 Port C Control Register
1 1 Command Registers
I/O Operation in Mode-0
8 LED
Port A (8 bit)
37
First write to the control register
to configure
8 LED
Port A (8 bit)
10001001
Port B (8 bit)
8 LED
MPU A0 🡪 1
8255
A1 🡪 1 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
38
Then IO operation
8 LED
Port A (8 bit)
39
First write to the control register
to configure
8 LED
Port A (8 bit)
10001001
Port B (8 bit)
8 LED
MPU A0 🡪 1
8255
A1 🡪 1 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
40
IO operation (in this cycle:
MPU🡪Port A)
8 LED
Port A (8 bit)
11110000
Port B (8 bit)
8 LED
MPU A0 🡪 0
8255
A1 🡪 0 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
41
IO operation (in this cycle:
MPU🡪Port B)
8 LED
Port A (8 bit)
data
Port B (8 bit)
8 LED
MPU A0 🡪 1
8255
A1 🡪 0 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
42
IO operation (in this cycle: Port
C🡪MPU)
8 LED
Port A (8 bit)
data
Port B (8 bit)
8 LED
MPU A0 🡪 0
8255
A1 🡪 1 Port CUpper (4 bit)
1 0 0 0 1 0 0 1
43
Writing to Control word for
Mode-1
Port A (8 bit)
1010X11X Control Printer
Register
Read 🡪 1
Write 🡪 0 Port CUpper (Pin 3, 6, 7)
MPU A0 🡪 1
8255
Port B (8 bit)
A1 🡪 1
Reset 🡪 0 Keyboard
Chip Select 🡪 0
Port CLower (Pin 0, 1, 2)
1 0 1 0 X 1 1 X
44
Control Register
Write to the control register
1 0 1 0 X 1 1 X
45
Handshaking OUT operation
with Port A
Port A (8 bit)
data
PC7
PC6
INTR
PC3
MPU A0 🡪 0
8255
Port B (8 bit)
A1 🡪 0
Reset 🡪 0 Control PC2
Register PC1
PC0
46
Handshaking IN operation with
Port B
Port A (8 bit)
data
PC7
PC6
PC3
MPU A0 🡪 1
8255
Port B (8 bit)
A1 🡪 0
Reset 🡪 0 Control PC2
Register PC1 IBF
PC0
INTR
47
Programming 8255
❑ Mode 1:
— Ports A and B are programmed as input or output
ports
— Port C is used for handshaking
PA[7: PA[7:
PC 0]
STB PC 0]
OBF A
PC
4 IBF PC
7 ACKA
A
PC
5 INTR PC
6 INTR
A
825 3 APB[7: 825 3 APB[7:
5 PC 0]
STB 5 PC 0]
OBF
PC
2 IBF PC
2 ACKB
B B
PC
1 INTR PC
1 INTR
B
0
PC6, B
0
PC4, B
7 5
11-48
Handshaking out operation with
Port A
Port A (8 bit)
data 1 3 6 7
PC7 4 6
PC6 5 7
1 3 PC3 INTR 2 8
MPU A0 🡪 0
8255
Port B (8 bit)
A1 🡪 0
Reset 🡪 0 Control PC2
Register PC1
PC0
50
52
53
Handshaking in operation with
Port B
Port A (8 bit)
6 7 data
PC7
5 7 PC6
PC3
MPU A0 🡪 1
8255
Port B (8 bit)
A1 🡪 0 1 3
Reset 🡪 0 Control PC2 1 3
Register PC1 2 8 IBF
PC0
4 6 INTR
54
Mode-2
❑ Mode 2:
— Port A is programmed to be bi-directional
— Port C is for handshaking
— Port B can be either input or output in mode 0
or mode 1 PA[7:
PC 0]
OBF A
PC
7 ACKA
6
PC STB
825 PC
4 IBF
A
5 PC
5 INTR
A
PC
3 A In STBB
0
PC Out OBFB
PC
0 In IBFB
0 PB[7: Out ACKMode
B
0] InMode INTR1B
1. Can you design a decoder for an 8255 chip such 0 that its base address is 40H?
2. Out INTR
Write the instructions that set 8255 into mode 0, port A as input, portBB as output,
PC0-PC3 as input, PC4-PC7 as output ?
11-55
Handshaking I/O operation
Port A (8 bit)
PC7
PC6
PC5 IBF
MPU A0
8255 PC4
A1 PC3
56
Timing diagram is a combination of the Mode 1 Strobed
Input and Mode 1 Strobed Output Timing diagrams.
Handshaking I/O operation
(OUT)
Port A (8 bit)
PC7
PC6
PC5 IBF
MPU A0🡪0
8255 PC4
A1🡪0 PC3
58
Handshaking I/O operation (IN)
Port A (8 bit)
PC7
PC6
PC5 IBF
MPU A0🡪0
8255 PC4
A1🡪0 PC3
59
Thank you
Q&A