Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
• 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.
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.
• PB0-PB7:Similar to PA
8
Data Bus buffer:
• It is a 8-bit bidirectional Data bus.
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.
11
Mode 1: Input or Output with Handshake
12
Mode 2: Bidirectional Data Transfer
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.
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