You are on page 1of 16

LED interfacing in 8255

What is an LED?

Light-emitting diode

Semiconductor

Has polarity

Inside a Light Emitting Diode


1.

Transparent
Plastic Case

2.

Terminal Pins

3.

Diode

Working of an LED

A light-emitting diode (LED) is a two-lead


semiconductor light source.

It is a pn junction diode, which emits light when


activated.

When a suitable voltage is applied to the leads,


electrons are able to recombine with electron holes
within the device, releasing energy in the form of
photons

Polarity

How to Connect a LED:

Requires 1.5~2.5V and 10 mA

To prevent overloading, use resistor

LED ON OFF CONNECTION in


8255
320 ohms
Anode

Cathode

LED COUNTER CONNECTIONS


(PORT A)

8255

Ports in 8255

Port A

Port B

Port C

Each port is 8 bits long and can be configured in a


number of ways based on the control word.

Control word

Modes in 8255

Mode 0- Simple Input-Output.

Mode 1- Handshaking

Mode 2- Bidirectional Handshaking. Possible with port A


only.

Examples: Control Word Setting

Setting the control register with all port as output


mvi A, 80

(D7 D6 D5 D4 D3 D2 D1 D0)-> (1 0 0 0 0 0 0 0)

out 03 // Contents copied to control register

With port A only as input


mvi A,90

(D7 D6 D5 D4 D3 D2 D1 D0)-> (1 0 0 1 0 0 0 0)

out 03

With port B as input


mvi A,82

(D7 D6 D5 D4 D3 D2 D1 D0)-> (1 0 0 0 0 0 1 0)

out 03

With port C as input both upper and lower


mvi A,89
out 03

(D7 D6 D5 D4 D3 D2 D1 D0)-> (1 0 0 0 1 0 0 1)

Copy contents to port A, B or C

For port A

For port B

out 00

out 01

For Port C

out 02

FRC CABLE- PIN DIAGRAM


INTERFACING WITH 8255

Thank you

You might also like