0% found this document useful (0 votes)
16 views59 pages

8255 PPI Interfacing Techniques Guide

Uploaded by

sivalaigarnel
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)
16 views59 pages

8255 PPI Interfacing Techniques Guide

Uploaded by

sivalaigarnel
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

UNIT-III

PROGRAMMABLE PERIPHERAL
INTERFACE

PRESENTED BY
[Link] GANESH M.E-CAD/CAM
RAMCO INSTITUTE OF TECHNOLOGY
SYLLABUS

Introduction – Architecture of 8255

Keyboard interfacing,
LED display –interfacing

ADC and DAC interface

Temperature Control –
Stepper Motor Control

Traffic Control interface


INTRODUCTION

• 8085/8051 has limited number of I/O ports


• One solution is to add parallel interface chip(s)
• 8255 is a Programmable Peripheral Interface PPI
• Add it to 8051 to expand number of parallel ports
• 8051 I/O port does not have handshaking
capability
• 8255 can add handshaking capability to
8051/8085
SYLLABUS
INTRODUCTION

• The 82C55 is a popular interfacing component, that can


interface any TTL-compatible I/O device to a microprocessor.

• It is used to interface to the keyboard and a parallel printer


port in PCs (usually as part of an integrated chipset).

• PPI has 24 pins for I/O that are programmable in groups of


12 pins and has three distinct modes of operation.

SYLLABUS
OPERATING MODES

• 8255 should be operated in two modes


1. BSR mode (Bit Set Reset mode)
2. IO mode
a. Mode 0: Simple Input Output
b. Mode 1: Input Output with Handshake
c. Mode 2: Bi directional IO data transfer

SYLLABUS
IO MODE

Port A- It can be programmed in three modes: mode


0, mode 1 and mode 2
Port B- It can be programmed in mode 0 and mode 1
Port C- It can be splitted into two parts and each can
be used as control signals for ports A and B in the
handshake mode. It can be programmed for bit
set/reset operation

SYLLABUS
IO MODE

Mode 0: Simple Input Output


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

SYLLABUS
IO MODE

Mode 1: Input Output with Handshake


Two groups each of 12 pins are formed. Group
A consists of Port A and upper part of Port C while
Group B consist of Port B and lower part of Port C.
Port A and B can be programmed as 8-bit Input or
Output ports with three lines of Port C in each group
is used for handshaking

SYLLABUS
IO MODE

Mode 2: Bi directional IO data transfer


Only Port A can be used as bidirectional port.
Handshaking signals are provided on five lines of
Port C (PC3-PC7). Port B can be used in Mode 0 or
Mode 1

SYLLABUS
ARCHITECTURE OF 8255 PPI

SYLLABUS
PIN DIAGRAM OF 8255 PPI

SYLLABUS
PIN DIAGRAM OF 8255 PPI

SYLLABUS
PIN DIAGRAM OF 8255 PPI

SYLLABUS
BSR MODE
Control Word Format for Bit SET/RESET
Mode
A BSR Word is to be written for each bit that is to be set or reset.
For example, if bit PC3 is to be set and bit PC4 is to be reset, then
appropriate BSR words to be loaded into the control register will
be 0XXX0111 and 0XXX1000, respectively, where X is don’t care

SYLLABUS
BSR MODE
Control Word Format for IO Mode

SYLLABUS
KEYBOARD INTERFACING 8255 PPI

Getting meaningful data from a keyboard, it


requires the following three major tasks:
–Detect a keypress.
–Debounce the keypress.
–Encode the keypress

Three tasks can be done with hardware,


software, or a combination of two,
depending on the application.

SYLLABUS
KEYBOARD INTERFACING 8255 PPI

Matrix of keys interface

SYLLABUS
KEYBOARD INTERFACING 8255 PPI
KEYBOARD
Flow Chart
ZERO TO ALL ROWS
OUTPUT ZERO TO
ROWS

READ ALL COLUMNS READ ALL COLUMNS

YES NO
ALL KEYS KEY
ENCODE
OPEN? FOUND?

NO YES

NO CONVERT TO HEX
KEY
PRESSED

YES RETURN

WAIT 20mS
SYLLABUS
KEYBOARD INTERFACING 8255 PPI
Idea to identify key pressed SYLLABUS

If R1=1, R2=0, R3=0, R4=0


C1=1, C2=0, C3=0, C4=0 => SW1 Pressed
C1=0, C2=1, C3=0, C4=0 => SW2 Pressed
C1=0, C2=0, C3=1, C4=0 => SW3 Pressed
C1=0, C2=0, C3=0, C4=1 => SW4 Pressed
If R1=0, R2=1, R3=0, R4=0
C1=1, C2=0, C3=0, C4=0 => SW5 Pressed
C1=0, C2=1, C3=0, C4=0 => SW6 Pressed
C1=0, C2=0, C3=1, C4=0 => SW7 Pressed
C1=0, C2=0, C3=0, C4=1 => SW8 Pressed
If R1=0, R2=0, R3=1, R4=0
C1=1, C2=0, C3=0, C4=0 => SW9 Pressed
C1=0, C2=1, C3=0, C4=0 => SW10 Pressed
C1=0, C2=0, C3=1, C4=0 => SW11 Pressed
C1=0, C2=0, C3=0, C4=1 => SW12 Pressed
If R1=0, R2=0, R3=0, R4=1
C1=1, C2=0, C3=0, C4=0 => SW13 Pressed
C1=0, C2=1, C3=0, C4=0 => SW14 Pressed
C1=0, C2=0, C3=1, C4=0 => SW15 Pressed
C1=0, C2=0, C3=0, C4=1 => SW16 Pressed
LED DISPLAY INTERFACING 8255 PPI

SYLLABUS
LED DISPLAY INTERFACING 8255 PPI

R1 R2 R3 R4 R5 R6 R7 C1 C2 C3 C4 C5
R1
0 1 1 1 1 1 1 0 1 1 1 1
R2
Delay 1mSec
R3
1 0 0 0 1 0 0 1 0 1 1 1
Delay 1mSec R4

1 0 0 0 1 0 0 1 1 0 1 1 R5
Delay 1mSec R6
1 0 0 0 1 0 0 1 1 1 0 1
R7
Delay 1mSec
C1 C2 C3 C4 C5
0 1 1 1 1 1 1 1 1 1 1 0
Delay 1mSec

SYLLABUS
LED DISPLAY INTERFACE

SYLLABUS
ADC INTERFACE

The analog to digital converter chips 0808 and


0809 are 8-bit CMOS devices with an 8 channel
multiplexer.

FEATURES

8-bit successive approximation ADC


Easy interface to all microprocessors
It operates on 5V DC supply
Adjusted voltage reference
0V to 5V input range with single 5V power supply

SYLLABUS
ADC INTERFACE
SYLLABUS

The conversion delay is 100micro seconds at a


clock frequency of 640kHz.
ADC INTERFACE
SYLLABUS

The conversion delay is 100micro seconds at a


clock frequency of 640kHz.
ANALOG I/P ADDRESS LINES
SELECTED
C B A
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1

4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
ADC INTERFACE
SYLLABUS
ADC INTERFACE

SYLLABUS
DAC INTERFACE

The digital to analog converters convert binary


numbers into their analog equivalent voltages or currents.

Some common technique are given below

Weighted resistor network


R-2R ladder network
Current output D/A converter

SYLLABUS
DAC INTERFACE
FEATURES

Settling time around 100ms.


Operate at a range between 4.5V to 18V. Usually
the supply voltage is 5V to 12V.

SYLLABUS
DAC INTERFACE

SYLLABUS
DAC INTERFACE

PROGRAM FOR SAW TOOTH WAVE FORM

MOV A, 00
OUT 00
INR A
JNZ Again
JMP start

SYLLABUS
TEMPERATURE CONTROLLER

Temperature control system involved interfacing


successive approximation ADC and typical method of
measuring and controlling the temperature using
microprocessor.

Typical sensors include devices like thermocouples,


thermostats, RTD’s and other sensors.

8255 is interfaced with 8085 in I/O

SYLLABUS
TEMPERATURE CONTROLLER
SYLLABUS
STEPPER MOTOR INTERFACING
Stepper motor is a widely used device that
translates electrical pulses into mechanical movement.

Stepper motor is used in applications such as disk


drives, dot matrix printer, robotics etc.

SYLLABUS
STEPPER MOTOR INTERFACING
It has a permanent magnet rotor called the shaft
which is surrounded by a stator.

The stator is a magnet over which the electric coil


is wound.

SYLLABUS
STEPPER MOTOR INTERFACING
STEP ANGLE
Step angle is defined as the minimum degree of
rotation with a single step.
No of steps per revolution = 360o/step angle
Steps per second = (rpm x steps per
revolution)/60
• Step angle = degree of motor rotation / pulse
• 1.8⁰ 1 pulse
• 360⁰ ? pulses
So 360⁰ / 1.8⁰ = 200 pulses
That means it requires 200 pulses to be applied to 1.8o
stepper motor to complete one revolution.
Step angle = 360 / number of pulses
SYLLABUS
STEPPER MOTOR INTERFACING
Types by Construction
By construction there are 3 different
types of (rotors)stepper motors:

• Permanent magnet stepper,


• Variable reluctance stepper and
• Hybrid synchronous stepper motor.

SYLLABUS
STEPPER MOTOR INTERFACING
Permanent magnet stepper

The Permanent Magnet


stepper has a permanent
magnet rotor which is driven
by the stators windings. They
create opposite polarity poles
compared to the poles of the
rotor which propels the rotor.

SYLLABUS
STEPPER MOTOR INTERFACING
Variable Reluctant stepper
The next type, the
Variable Reluctant stepper
motor uses a non-magnetizes
soft iron rotor. The rotor has
teeth that are offset from the
stator and as we active the
windings in a particular order
the rotor moves respectively
so that it has minimum gab
between the stator and the
teeth of the rotor
SYLLABUS
STEPPER MOTOR INTERFACING
Hybrid Synchronous Stepper
The Hybrid Synchronous
motor is combinations of the
previous two steppers. It has
permanent magnet toothed
rotor and also a toothed
stator. The rotor has two
sections, which are opposite
in polarity and their teeth are
offset as shown here.

SYLLABUS
STEPPER MOTOR INTERFACING
SYLLABUS
Hybrid Synchronous Stepper

This is a front view of a


commonly used hybrid
stepper motor which has 8
poles on the stator that are
activated by 2 windings, A
and B. So if we activate the
winding A, we will magnetize
4 poles of which two of them
will have South polarity and
two of them North polarity.
STEPPER MOTOR INTERFACING
COMPARISON

SYLLABUS
STEPPER MOTOR INTERFACING

Driving Modes
Four types of driving modes
1. Wave drive or Single coil excitation
2. Full Step Drive
3. Half Step Drive
[Link]

SYLLABUS
STEPPER MOTOR INTERFACING
SYLLABUS
Wave drive or Single coil excitation
The first one is the Wave Drive or A B A’ B’
Single-Coil Excitation. In this 1 0 0 0
mode we active just one coil at a 0 1 0 0
time which means that for this 0 0 1 0
example of motor with 4 coils,
0 0 0 1
the rotor will make full cycle in 4
steps.
STEPPER MOTOR INTERFACING
Full Step Drive SYLLABUS
Next is the Full step drive mode A B A’ B’
which provides much higher torque
1 0 0 1
output because we always have 2
active coils at a given time. 1 1 0 0
However this doesn’t improve the 0 1 1 0
resolution of the stepper and again 0 0 1 1
the rotor will make a full cycle in 4
steps.
STEPPER MOTOR INTERFACING
SYLLABUS A B A’ B’

Half Step Drive 1 0 0 0


For increasing the resolution of the stepper 1 1 0 0
we use the Half Step Drive mode. This mode 0 1 0 0
is actually a combination of the previous two
modes. Here we have one active coil 0 1 1 0
followed by 2 active coils and then again 0 0 1 0
one active coil followed by 2 active coils and 0 0 1 1
so on. So with this mode we get double the
0 0 0 1
resolution with the same construction. Now
the rotor will make full cycle in 8 steps. 1 0 0 1
STEPPER MOTOR INTERFACING
SYLLABUS
Micro stepping
However the most common method of controlling
stepper motors nowadays is the Microstepping. In this
mode we provide variable controlled current to the
coils in form of sin wave. This will provide smooth
motion of the rotor, decrease the stress of the parts
and increase the accuracy of the stepper motor.
STEPPER MOTOR INTERFACING
FULL STEP SYLLABUS

TWO PHASE ON
STEP# A B C D
1 1 0 0 1
2 1 1 0 0
3 0 1 1 0
4 0 0 1 1

ONE PHASE ON
STEP# A B C D
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
STEPPER MOTOR INTERFACING
HALF STEP

TWO PHASE ON
STEP# A B C D
1 1 0 0 1
2 1 0 0 0
3 1 1 1 0
4 0 1 0 0
5 0 1 1 0
6 0 0 1 0
7 0 0 1 1
8 0 0 0 1

SYLLABUS
STEPPER MOTOR INTERFACING

SYLLABUS
TRAFFIC LIGHT INTERFACING
Nowadays Microprocessor are used to implement
the traffic control system.
The various control signals such as red, green,
yellow, forward arrow, right arrow and left arrow are
used in this scheme

SYLLABUS
TRAFFIC LIGHT INTERFACING
North

West East

SYLLABUS
South
TRAFFIC LIGHT INTERFACING

SYLLABUS
TRAFFIC LIGHT INTERFACING
Switching Schedule for Traffic Lights
SYLLABUS
ON/OFF Status of Traffic Lights
SWITCHING PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 PC0 PC1 PC2 PC3
SCHEDULE NR NY NG NFR NFL SR SY SG SFR SFL ER EY EG EFR EFL WR WY WG WFR WFL
SCHEDULE – I 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0

SCHEDULE - II 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0

SCHEDULE - III 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0

SCHEDULE - IV 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0

SCHEDULE – V 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0

SCHEDULE - VI 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0

SCHEDULE - VII 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0

SCHEDULE - VIII 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0

SCHEDULE - IX 1 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0

SCHEDULE - X 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0

SCHEDULE – XI 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0

SCHEDULE - XII 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 1
TRAFFIC LIGHT INTERFACING
Switching Schedule for Traffic Lights
SYLLABUS
ON/OFF Status of Traffic Lights
SWITCHING PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 PC0 PC1 PC2 PC3
SCHEDULE NR NY NG NFR NFL SR SY SG SFR SFL ER EY EG EFR EFL WR WY WG WFR WFL
SCHEDULE – I

SCHEDULE - II

SCHEDULE - III

SCHEDULE - IV

SCHEDULE – V

SCHEDULE - VI

SCHEDULE - VII

SCHEDULE - VIII

SCHEDULE - IX

SCHEDULE - X

SCHEDULE – XI

SCHEDULE - XII
TRAFFIC LIGHT INTERFACING
Flow Chart for Traffic Light Control
Main Program

SYLLABUS
TRAFFIC LIGHT INTERFACING
Flow Chart for Traffic Light Control
SYLLABUS
Sub Program
TRAFFIC LIGHT INTERFACING
Step 1: Initialize all ports of the 8255 as output
ports

Step 2: Determine the status of port A, port B and


port C of 8255 for north to south movement.

Step 3: Call delay subroutine-1

Step 4: Before starting east to west traffic


movement, north to south traffic movement will be ready
to stop.

Step 5: Call delay subroutine-2

Step 6: same as step 2


SYLLABUS
TRAFFIC LIGHT INTERFACING

SYLLABUS

You might also like