0% found this document useful (0 votes)
4 views60 pages

3. 82C55 final-Updated.pptx

The 82C55 programmable peripheral interface (PPI) is a versatile low-cost component used for various applications including keyboard interfacing and printer connections. It features 24 pins for I/O, operates in three modes (Mode 0, Mode 1, Mode 2), and allows for data transfer through control signals. The document provides detailed pin functions, connection diagrams, and operational modes for effective interfacing with microprocessors.

Uploaded by

Kunal Ray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views60 pages

3. 82C55 final-Updated.pptx

The 82C55 programmable peripheral interface (PPI) is a versatile low-cost component used for various applications including keyboard interfacing and printer connections. It features 24 pins for I/O, operates in three modes (Mode 0, Mode 1, Mode 2), and allows for data transfer through control signals. The document provides detailed pin functions, connection diagrams, and operational modes for effective interfacing with microprocessors.

Uploaded by

Kunal Ray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Basic I/O Interfacing

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.

The I/O pins can be programmed in groups of 12 pins.

There are three distinct modes of operation Mode 0, Mode 1 and


Mode 2.

Group A connections consists of Port A(PA0-PA7) and the upper


half of port C (PC4-PC7)
Group B connections consists of Port B (PB0-PB7) and the
lower half of port C (PC0-PC3)

6
Function of pins:
• Data bus(D0-D7):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 start.

• Write: This is Active Low signal, when it is


Low Write operation will start.
82C55
CS pin is used to select the device for reading or writing.
Control lines A0 and A1 are used to select the Port that requires
interaction.

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.

• PA0-PA7:It is the 8-bit bi-directional I/O


pins used to send the data to peripheral
or to receive the data from peripheral.

• PB0-PB7:Similar to PA

• PC0-PC7:This is also 8-bit bidirectional I/O pins.


These lines are divided into two groups.
PC0 to PC3(Lower Groups)
PC4 to PC7 (Higher groups)
These two groups working in separately using 4
data’s.
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
10
1 1 Command Registers
Click on Correct Answer
Data Bus 🡪 Port A
Data Bus 🡪 Port C
Data Bus 🡪 Control

Data Bus 🡪 Port C


Data Bus 🡪 Port C
Nothing Happen

Data Bus 🡪 Port A


Data Bus 🡪 Port C
Data Bus 🡪 Control

Date Bus 🡪 Port B


Date Bus 🡪 Port B
Date Bus 🡪 Control
11
Block Diagram
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 D0-D7


pins are connected in internally.

• The direction of data buffer is decided by


Read/Control Logic.
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 mode 1.
• PORT C:
• This is a 8-bit Unlatched buffer Input and an
Output latch.
• It is splitted into two parts.
• Support only mode 0
• It can be programmed by bit set/reset operation.
Mode

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

BIT SET/RESET FLAG


=0 Active
Operation modes:
BIT SET/RESET MODE:
• A pin of PORT C (PC0-PC7)can be Set or Reset by
sending OUT instruction to the CONTROL registers.
• Example:
• PC3 is Set then control register will be
0XXX0111.
• PC4 is Reset then control register will be
0XXX1000.
• X is a don’t care.
Bit Set-Reset Mode
Port A (8 bit)
0XXX0110
Control
Register Port B (8 bit)
Read 🡪 1
Write 🡪 0
MPU A0 🡪 0
8255
PC7
A1 🡪 1
0 Port C
Reset 🡪 0
Chip Select 🡪 0
PC0 000🡪0
001🡪1
010🡪2
PC5=101 011🡪3
100🡪4
0 X X X 1 0 1 0 101🡪5
Control Register 110🡪6 19
111🡪7
Bit Set-Reset Mode
Port A (8 bit)
0XXX0110 Control
Register
Read 🡪 1 Port B (8 bit)
Write 🡪 0
MPU A0 🡪 0
8255 PC
7 0
A1 🡪 1
Reset 🡪 0
Port C
Chip Select 🡪 0
PC0

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)

Port CLower (4 bit) Switches

24
• MODE 1 :(Input/output with Hand shake)
• In this mode, input or output is transferred by
hand shaking Signals.
11011011

5-Data will transfer


Keyboard DATA BUS Processor
1-0,3-1 STB
ACK 2-0, 6-1

2-1…4-0
Busy

• Handshaking signals is used to transfer data


between whose data transfer rate is not same.
• 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-1

Port A (8 bit)
Control Printer
Register

Port CUpper (Pin 3, 6, 7)


8255

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

Port CUpper (Pin 3, 4, 5, 6, 7)


8255

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)

Read Port B (8 bit)


Write
MPU A0
8255
A1 Port CUpper (4 bit)

Reset Control Port CLower (4 bit)


Chip Select Register

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)

Reset 🡪 0 Port CLower (4 bit) Switches


Chip Select 🡪 0

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)

Read Port B (8 bit)


Write 8 LED
MPU A0
8255
A1 Port CUpper (4 bit)

Reset Control Port CLower (4 bit) Switches


Chip Select Register

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)

Reset 🡪 0 Control Port CLower (4 bit) Switches


Register

1 0 0 0 1 0 0 1

38
Then IO operation

8 LED
Port A (8 bit)

Read Port B (8 bit)


Write 8 LED
MPU A0
8255
A1 Port CUpper (4 bit)

Reset Control Port CLower (4 bit) Switches


Chip Select Register

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)

Reset 🡪 0 Control Port CLower (4 bit) Switches


Register

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)

Reset 🡪 0 Control Port CLower (4 bit) Switches


Register

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)

Reset 🡪 0 Control Port CLower (4 bit) Switches


Register

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)

Reset 🡪 0 Control Port CLower (4 bit) Switches


Register

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

1010X11X Port A (8 bit)


Printer

Port CUpper (Pin 3, 6, 7)


MPU A0🡪1
8255
Port B (8 bit)
A1🡪1
Reset🡪0 Control Keyboard
Register
Port CLower (Pin 0, 1, 2)

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

Reset Control INTR


Register

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

Reset🡪0 Control INTR


Register

58
Handshaking I/O operation (IN)

Port A (8 bit)

PC7
PC6
PC5 IBF
MPU A0🡪0
8255 PC4
A1🡪0 PC3

Reset🡪0 Control INTR


Register

59
Thank you

Q&A

You might also like