Unit Iii Ppi
Unit Iii Ppi
Unit Iii Ppi
INTERFACE
Introduction – Architecture of 8255, Keyboard
Interfacing, LED display – Interfacing, ADC and
DAC Interface, Temperature Control – Stepper
Motor Control – Traffic Control Interface.
Introduction.
To communicate with the outside world,
etc.,
• Output devices – CRT, Printers, LEDs etc.,
•Peripherals are connected to the
microprocessors through electronic circuit
known as interfacing circuits.
Some of the general purpose interfacing
devices
• I/O ports
• Programmable peripherals interface (PPI)
• DMA controllers
• Interrupt controller
Some of the special purpose interfacing
devices
• CRT controller
• Keyboard
• Display
• Floppy Disc controllers
Programmable peripheral
interface 8255
PPI 8255 is a general purpose programmable I/O device
designed to interface the CPU with its outside world such as
ADC, DAC, keyboard etc.
We can program it according to the given condition.
It can be used with almost any microprocessor.
It consists of three 8-bit bidirectional I/O ports i.e. PORT A,
PORT B and PORT C.
We can assign different ports as input or output functions.
Programmable peripheral interface
8255
The functions of the 8255 are classified according to 2 modes,
(i) Bit Set/Reset (BSR) Mode.
(ii) I/O Mode.
(i) Bit Set/Reset Mode — The BSR Mode is used to set or reset
the bits in port C.
ii) I/0 Mode — The I/O mode is further divided into three
modes:
(i) Mode 0— Simple I/O ports.
(i) Mode 1 - I/O ports with handshake.
(iii) Mode 2 — Bi-directional I/O data transfer.
FEATURES OF 8255 .
The 8255 is a widely used, programmable, parallel I/O
device.
It can be programmed to transfer data under various
conditions from simple I/O to interrupt I/O.
It is compatible, with all Intel and most other
microprocessors.
Its bit set/reset mode allows setting and resetting of
individual bits of port C.
The 8255 can operate in 3 I/O modes
(i)Mode 0 (i) Mode 1 and (iii) Mode 2.
It is completely TTL compatible.
Programmable peripheral
interface 8255
Programmable peripheral
interface 8255
It consists of 40 pins and operates in +5V regulated power
supply.
Port C is further divided into two 4-bit ports i.e. port C lower
and port C upper and port C can work in either BSR (bit set
rest) mode or in mode 0 of input-output mode of 8255.
Port B can work in either mode 0 or in mode 1 of input-output
mode.
Port A can work either in mode 0, mode 1 or mode 2 of input-
output mode.
Programmable peripheral
interface 8255
It has two control groups, control group A and control group
B.
Control group A consist of port A and port C upper.
Control group B consists of port C lower and port B.
Depending upon the value if CS’, A1 and A0 we can select
different ports in different modes as input-output function or
BSR.
This is done by writing a suitable word in control register
(control word D0-D7).
Programmable peripheral
interface 8255
Group A and Group B Controls
The Group A and Group B Control Blocks receives control
words from the CPU and issues appropriate commands to the
ports associated with it.
The Group A Control block controls port A and PC7 - PC4
while the Group B Control block controls Port B and PC3 –
PC0.
Programmable peripheral
interface 8255
Port A: It has an 8-bit latched and buffered output and an 8-bit
input latch.
It can be programmed in three modes; Mode 0, Mode 1 and
Mode 2.
Port B: It has an 8-Bit data I/O latch/buffer and an 8-bit data
input buffer.
It can be programmed in Mode 0 and Mode 1.
Port C: It has one 8-Bit unlatched input buffer and an 8-bit
output latch/buffer.
Port C can be separated into two ports and each can be used as
control signals for port A and B in the handshake mode.
It can be programmed for bit set/reset operation.
Programmable peripheral
interface 8255
Data Bus Buffer
It is a tri-state bi-directional buffer used to interface the
internal data bus of 8255 to the system data bus.
The instruction executed by the microprocessor can read the
data from the buffer or write the data into the buffer.
Similarly, the control registers and the status registers all
passed through the buffer.
Programmable peripheral
interface 8255
Control Logic
The control logic block accepts control bus
0 0 0 PORT A
0 0 1 PORT B
0 1 0 PORT C
Control word
0 1 1
Register
Programmable peripheral
interface 8255
RESET (Reset): This is an active high
signal; it clears the control register and sets
all ports in the input mode.
CS (Chip Select): It is a Chip Select Signal.
latched.
This mode also has the interrupt handling
latched.
The control register is looking like below in
this mode:
Bits Function
D7 1 for IO mode and 0 for BSR mode
These are used to set port A
mode. for 00, it is m0 mode, for
D6 & D5
01, it is m2 mode and 10 or 11, it
is m2 mode.
1 when port A is taking input, 0
D4
when port A is sending output.
1 when higher nibble of port C is
D3 taking input, and 0 when higher
nibble is sending output.
It tells the mode of Port B. For 0, it
D2 is m0 mode, and for 1, it is m1
mode.
1 when port B is taking input, 0
D1
when port B is sending output.
1 when lower nibble of port C is
D0 taking input, and 0 when lower
nibble is sending output.
Interfacing a Microprocessor To
Keyboard
When we press a key on your computer, we are
activating a switch.
There are many different ways of making these switches.
Mechanical key switches:
In mechanical-switch keys, two pieces of metal are
arranged as below
Interfacing Seven Segments
LED Display
It can be used to represent numbers from 0 to 8 with a
decimal point.
It have eight segments in a Seven Segment LED
Architecture of
ADC
ANALOG-TO-DIGITAL
CONVERTER (ADC) INTERFACING
ANALOG-TO-DIGITAL
CONVERTER (ADC) INTERFACING
Interfacing ADC with 8085 Microprocessor
To interface the ADC with 8085, we need 8255 Programmable
Peripheral Interface chip with it.
Let us see the circuit diagram of connecting 8085, 8255 and
the ADC converter.
ANALOG-TO-DIGITAL
CONVERTER (ADC) INTERFACING
ANALOG-TO-DIGITAL
CONVERTER (ADC) INTERFACING
ANALOG-TO-DIGITAL
CONVERTER (ADC) INTERFACING