0% found this document useful (0 votes)
121 views32 pages

Unit - IV 8255 PPI: - Programmable Peripheral Interfacing

The document discusses the 8255 Programmable Peripheral Interface (PPI) chip. It describes how the PPI has three ports (A, B, and C) that can be programmed for input or output in different modes. Mode 0 allows independent programming of each port, while modes 1 and 2 divide the ports for specific control functions. The address mapping and control word register are explained. Examples of initializing the control register and interfacing the 8255 to an 8086 CPU are provided.

Uploaded by

yagnasree_s
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views32 pages

Unit - IV 8255 PPI: - Programmable Peripheral Interfacing

The document discusses the 8255 Programmable Peripheral Interface (PPI) chip. It describes how the PPI has three ports (A, B, and C) that can be programmed for input or output in different modes. Mode 0 allows independent programming of each port, while modes 1 and 2 divide the ports for specific control functions. The address mapping and control word register are explained. Examples of initializing the control register and interfacing the 8255 to an 8086 CPU are provided.

Uploaded by

yagnasree_s
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 32

Unit - IV

8255 PPI

- Programmable Peripheral
Interfacing
PPI cont…

 Control register controls the overall operation of 8255


 All three ports A, B and C are grouped into two

Group A Group B

Port A Upper C Lower C Port B


PPI cont..

 it can operate in two basic modes


 Bit set/reset mode (BSR)
 I/O Mode:
mode 0,
mode 1,
mode 2

 Bit 8 of Control register decides between 3-


mode operation or bit set/reset operation
Operation modes

 8255 has three modes:


- mode 0: basic input-output
- mode 1: strobed input-output
- mode 2: strobed bidirectinal bus I/O
 In mode 0
- two 8-bit ports and two 4-bit ports
- any port can be input or output
- Outputs are latched, inputs are not latched
Mode 0

Port A Upper C Lower C Port B


Operation mode 1

 In mode 1:
-three ports are divided into two groups
-each group contains one 8-bit port and one 4-bit control/data
port
- 8-bit port can be either input or output and both latched
- 4-bit port used for control and status of 8-bit data port
Mode 1

Group A Group B

Port A Upper C Lower C Port B


Operation mode 2

 In mode 2
- only port A is used
- port A becomes an 8-bit bidirectional bus
- port C acts as control port (only pins PC3-PC7 are used)
Mode 2

Port A C7-C3 Port B


Address mapping of ports and control register

8255 PPI

Port A  $106C
Port B  $106D
Port C  $106E
8255 control register  $106F
Block Diagram of 8255
Pin Diagram
Control word register :
Control register

7 6 5 4 3 2 1 0
D7 D6 D5 D4 D3 D2 D1 D0
Group B
Port C(L) – 1 Input
0 output
Port B – 1 Input 0 output
Mode select: 0 mode 0; 1 mode 1

Port C(U) – 1 Input 0 output


Port A – 1 Input 0 output
Mode select: 00 mode 0;
01 mode 1; 0x mode 2
1 – mode select
Group A
0 – bit set/reset
Initialising Control Register

 Control word: Port A input and port B output and both port in mode 0
A B

7 6 5 4 3 2 1 0
1 0 0 1 x 0 0 x
Programming 8255
 Mode 0:
— Ports A, B, and C can be individually programmed as input or output ports
— Port C is divided into two 4-bit ports which are independent from each other

 Mode 1:
— Ports A and B are programmed as input or output ports
— Port C is used for handshaking

PA[7:0] PA[7:0]
PC4 STBA PC7 OBFA
PC5 IBFA PC6 ACKA
PC3 INTRA PC3 INTRA
8255 PB[7:0] 8255 PB[7:0]
PC2 STBB PC2 OBFB
PC1 IBFB PC1 ACKB
PC0 INTRB PC0 INTRB
PC6, 7 PC4, 5
Input Control signals:
Output Control Signals:
Programming 8255
 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:0]
PC7 OBFA
PC6 ACKA
PC4 STBA
8255 PC5 IBFA
PC3 INTRA
PC0 In Out STBB OBFB
PC0 In Out IBFB ACKB
PC0 In Out INTRB INTRB
PB[7:0]
Mode 0 Mode 1
1. Can you design a decoder for an 8255 chip such that its base address is 40H?
2. Write the instructions that set 8255 into mode 0, port A as input, port B as output,
PC0-PC3 as input, PC4-PC7 as output ?
Control signals:
Timing diagram is a combination of the Mode 1 Strobed Input
and Mode 1 Strobed Output Timing diagrams.
Interfacing 8255 to 8086 in I/O mapped I/O

D0-D7
D0-D7
Port A

A1 A0

A2 A1
Port B

M/IO RD Port C
RD
A0
WR
WR RST CS
A7
A6
A5
A4
A3
Interfacing 8255 to 8086 in Memory mapped I/O

D0-D7
D0-D7
Port A

A1 A0

A19 Port B
A2 A1

M/IO RD Port C
RD
A0

WR
WR RST CS
A7
A6
A5
A4
A3
Example Program
 Write a program for this traffic signal problem.

Port A 0 -
8255- 1 R

MC68HC11-
2
3
+
4
based P 5
6 -
7 G
+
Summary

 8255 has very friendly programming features


 Data can be sent and read to and from outer world via ports A,B
and C
 Suitable for advanced applications

You might also like