0% found this document useful (0 votes)
5 views

Programmable Peripheral Interface device

Uploaded by

einsteinriyad223
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)
5 views

Programmable Peripheral Interface device

Uploaded by

einsteinriyad223
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/ 12

Programmable Peripheral Interface device

PPI and its characteristics:

• Control Register: Configures ports (A, B, C) as input/output and operational modes via
control word written by the microprocessor.
• I/O Ports: Three 8-bit ports:
Port A: Input/output.
Port B: Input/output.
Port C: 8-bit or two 4-bit ports, also handles handshake signals.
• Chip Select Logic: Enables selection of the 8255A from multiple peripherals using chip
select signal (CS) and address lines.
• Bidirectional Data Bus: 8-bit bus for data transfer between the microprocessor and I/O
devices.
• Control Logic: Manages data flow and configuration based on control word and port
mode.
• Handshake/Interrupt Signals: Provides synchronization using STB, ACK, and INTR
signals in modes 1 and 2 for data transfer.

Introduction to 8255A
• The 8255A programmable peripheral interface (PPI) implements a general purpose I/O
interface
• Connects peripheral equipment to a microcomputer system bus.
• External logic is not required to interface peripheral devices.
Pin diagram:
Block Diagram:

Description:

From the above pin diagram it is seen that -


• The 8255A has 24 pins such as PA7-PA0, PB7-PB0, and PC7-PC0. The first two groups
are grouped as 8 bit port named Port A and Port B. Port C is divided into two parts: Port
PC7-PC4 as Port C upper and PC3-PC0 as Port C lower.
• 8255A is an LSI peripheral device designed to permit easy implementation of parallel I/O
device in the 8088 and 8086 microprocessor system. It provides a flexible parallel
interface which includes features such as single bit, 4 bit and byte wise input/output parts,
level sensitive input, latch outputs and strobe bidirectional input/output.
• The left side of the block diagram represents the microprocessor interface. It includes 8
bit bidirectional data bus (D7-D0) through which command, status information and data
are transferred between input and 8255A. Timing of data is controlled by read/write
control signals.
• The source or destination within 8255A is selected by 2 bit register select code. The code
and corresponding port are given below:
A1 A0 Port
0 0 A
0 1 B
1 0 C
1 1 Control register

• Two other signals are RESET and 𝐶𝑆′ (Chip Select) inputs. It enables interface circuitry
for read/write operations. It is inactive low mode and requires 0 for operation. RESET is
used to initiate the device.
• The block diagram totally represents 24 I/O ports or 3 byte wide I/O ports known as port
A, port B and port C.
• Operating characteristics is under software control and it contains 8 bit internal register
(Control register) for the purpose.
• It has 8 bit bidirectional data bus.
• Vcc and GND switches are used for power supply.
• It has three operating mode: mode 0, mode 1 and mode 2.

Addressing 8255A using microprocessor interface:

For chip select, the signal at ̅̅


𝐶𝑆̅̅ must be 0. For the above diagram, A7=1, A6 to A2 is 0.
Therefore, A0 and A1 select one of the I/O ports and control register.

Here,

Port A7 A6 A5 A4 A3 A2 A1 A0 Address
Port A 1 0 0 0 0 0 0 0 80H
Port B 1 0 0 0 0 0 0 1 81H
Port C 1 0 0 0 0 0 1 0 82H
Control 1 0 0 0 0 0 1 1 83H
Register
Modes of Operation:

Mode-0 Mode-1 Mode-2


(Simple I/O) (Handshaking I/O) (Bidirectional
Handshaking I/O)
Port-A Data Transfer Data Transfer Data Transfer
Port-B Data Transfer Data Transfer Mode-1 or Mode-0
Port-C Data Transfer Used for Handshaking Used for Handshaking

Control word selection format: I/O mode:

D7=1, the mode of operation is selected by control word

=0, the mode of operation is selected by set/reset mode.

Operation mode of 8255A:


i) BSR mode (for port C, no effect on I/O mode)
ii) I/O mode
a) mode 0: Simple I/O for Port A, B, C
b) mode 1: Store I/O, handshake I/O for Port A, B, C
c) mode 2: Bidirectional data bus for Port A

Example-1:

Initialize 8255 for simple I/O as follows:

Port A as Mode 0 input

Port B as Mode 0 output

Port C upper as output

Port C lower as output

Solution:

Control word:

D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 0 0 0 0

Hence, the control word is 90H

Instruction:

MOV AL,90 H

OUT 83h, AL

Example-2:

Initialize 8255 for simple I/O as follows:

Port A as Mode 1 input

Port B as Mode 0 output

Port C upper as output

Port C lower as input

Solution:

Control word:

D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 1 0 0 0 1
Hence, the control word is B1H

Instruction:

MOV AL,0B1H

OUT 83h, AL

Example-3: Write down the mode and I/O configuration for port A, B and C of 8255 after its
control register is loaded with 82H.

Solution:

Here the control register= 82h

Hence, the equivalent binary:

D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 1 0

D7=1 the mode of operation of is I/O.


D6=0 The operating mode of port A is 0.
D5=0
D4=0 Port A is used as output
D3=0 The upper bit of port C is used as output
D2=0 The mode of port B is 0.
D1=1 Port B is used as input
D0=0 The lower bit of port C is used as output.

Control word selection format: BSR mode:


The Bit Set/Reset (BSR) mode is available on port C only. Each line of port C (PC7 - PC0) can
be set or reset by writing a suitable value to the control word register. BSR mode and I/O mode
are independent and selection of BSR mode does not affect the operation of other ports in I/O
mode.

• D7 bit is always 0 for BSR mode.


• Bits D6, D5 and D4 are don't care bits.
• Bits D3, D2 and D1 are used to select the pin of Port C.
• Bit D0 is used to set/reset the selected pin of Port C.

Selection of port C pin is determined as follows:

D3 D2 D1 Bit/pin of port C selected

0 0 0 PC0

0 0 1 PC1

0 1 0 PC2

0 1 1 PC3

1 0 0 PC4

1 0 1 PC5

1 1 0 PC6

1 1 1 PC7

Example-1:

Initialize PC5 to be set.

Solution:

D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 0 1 1
Here, the control word is= 0BH

Instruction:

MOV AL, 0BH

OUT 83, AL

You might also like