Sei sulla pagina 1di 26

8255 PPI

• PPI
Programmable Peripheral
Interface

1
Intel 8255 PPI
PPI – Programmable Peripheral Interface
It is an I/O port chip used for interfacing I/O
devices with microprocessor
Very commonly used peripheral chip

2
82C55 : Pin Layout
Pin Diagram

4
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 be start.

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


operation will be start.

5
• Address (A0-A1):This is used to select the
ports. like this

A1 A0 Select

0 0 PA

0 1 PB

1 0 PC

Control
1 1
reg.

6
• RESET: This is used to reset the device.

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


send the data to peripheral or
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.
1. PC0 to PC3(Lower Groups)
2. PC4 to PC7 (Higher groups)
These two groups working in separately using 4
data’s.
7
Block Diagram

8
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 internally.

• The direction of data buffer is decided by


Read/Control Logic.
Operation modes:
BIT SET/RESET MODE:
• The PORT C can be Set or Reset by sending OUT
instruction to the CONTROL registers.
I/O MODES:
• MODE 0, MODE 1, MODE 2,

10
Mode 0: Simple Input or Output

In this mode, ports A, B are used as two simple 8-bit I/O ports
port C as two 4-bit ports.
Each port can be programmed to function as simply an input port or
an output port.

Ports don’t have handshake or interrupt capability.

11
Mode 1: Input or Output with Handshake

In this mode, handshake signals are exchanged between


the MPU and peripherals prior to data transfer.
The features of the mode include the following:

1. Two ports (A and B) function as 8-bit I/O ports.


They can be configured as either as input or output ports.

2. Each port uses three lines from ort C as handshake signals.


The remaining two lines of Port C can be used for simple I/O operations.

12
Mode 2: Bidirectional Data Transfer

This mode is used primarily in applications such as data transfer


between two computers.

In this mode, Port A can be configured as the bidirectional port


Port B either in Mode 0 or Mode 1.

Port A uses five signals from Port C


as handshake signals for data transfer.

The remaining three signals from port C can be used either


as simple I/O or as handshake for port B.

13
8255 Control Word
8255 MD Control word Contd.
Ex. 1: Configure Port A as i/p in Mode 0, Port B as o/p in
mode 0, Port C (Lower) as o/p and Port C (Upper) as i/p
ports.
Required MD control word:
1 0 0 1 1 0 0 0 = 98H
MD control PC Lower as o/p
PA in Mode 0 PB as o/p Reqd. instrns.
PA as i/p PB in Mode 0 MVI A, 98H
PC Upper as i/p OUT 7FH

15
8255 MD Control word Contd.
Ex. 2: Configure Port A as Mode 2, Port B as o/p in mode 1,
Port C7-8 as i/p ports. (PC5-0 are handshake lines, some
i/p lines and others o/p. So they are shown as X)
Required MD control word:
1 1 X X X 1/ 0 X = BCH or BDH
0
MD control PC3-0 as don’t care
PA in Mode 1 PB as o/p Reqd. Instrns.
PA PB in Mode 1/0 MOV AL,BCH
PC Upperhandshake OUT 7FH, AL
16
8255 PCBSR Control word
Control port having Port C Bit Set / Reset control word
0 X X X SB2 SB1 SB0 S/R*
Select bit of PC 1 - Set to 1
PC bit set
Don’t to be set / reset 0 - Reset to 0
/ reset
cares 0 0 0 Bit 0 of Port C
control
word 0 0 1 Bit 1 of Port C
:
:
1 1 1 Bit 7 of Port C

17
8255 PCBSR Control word contd.
Ex. 2: Reset to 0 bit 6 of Port C
0 X X X 1 1 0 0 = 0CH,…
Reset to 0
PC bit set
Don’t Bit 6 of PC
/ reset
cares Required instructions
control
word MVI A, 0CH
OUT 7FH

18
8255 PCBSR Control word contd.
Ex. 1: Set to 1 bit 4 of Port C
0 X X X 1 0 0 1 = 09H,…
Set to 1
PC bit set
Don’t Bit 4 of PC
/ reset
cares Required instructions
control
word MVI A, 09H
OUT 7FH

19
A/D Interfacing
• In most of the cases, the 8255 is used for interfacing the
analog to digital converters with microprocessor
through its ports.

• The analog to digital converters is treated as an input


device by the microprocessor, that sends an initializing
signal to the ADC to start the analogy to digital data
conversation process.

• The process of analog to digital conversion is a slow


process, and the microprocessor has to wait for the
digital data till the conversion is over.
A/D Interfacing

• After the conversion is over, the ADC sends end of


conversion EOC signal to inform the microprocessor
that the conversion is over and the result is ready at
the output buffer of the ADC.

• These tasks of issuing an SC pulse to ADC, reading EOC


signal from the ADC and reading the digital output of
the ADC are carried out by the CPU using 8255 I/O
ports.
A/D Interfacing
• The time taken by the ADC from the active edge
of SOC pulse till the active edge of EOC signal is
called as the conversion delay of the ADC.
• Successive approximation techniques and dual
slope integration techniques are the most
popular techniques used in the integrated ADC
chip.
• The analog to digital converter chips 0808 and
0809 are 8-bit CMOS, successive approximation
converters.
ADC 0804

8/21/2019 Deepak.P
Analog to Digital Converter

CLK

PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7

ANALOG INPUT
8255 8-BIT
8-BIT ADC
Data Bus
Microprocessor
PC0
START
PC7
EOC

24
• Port A =I/P
• Port B =o/P
• Port C-Upper =I/P (PC7)
• Port C-lower =O/P (PC0)
• Port A = 80H
• Port B = 81H
• Port C = 82H
• Control Register= 83H

25
ADC PROGRAM
• MVI A,98h
• OUT 83H
• MVI A,01H
• OUT 82H
• Loop: IN 82H
• RAL
• JNC Loop
• IN 80H
• STA 9000H
• HLT 26

Potrebbero piacerti anche