7 SEGMENTS LAMP with PARALLEL PORT
Parallel Port

PARALLEL PORT INTERFACING

 

Control of a 7 segments lamp with Parallel Port

 

[file:///C:/Documents and Settings/Juan Carlos.JCGR/Escritorio/globunetlocal/PP3/blog_htm_en.htm]

 

A lamp of 7 segments is an optoelectronic device that allows to illuminate 7 segments (and in some types a point decimal) of independent form. Illuminated selectively these segments, it is possible to form all the numbers, and some characters of the alphabet. These lamps must externally be fed, since every  segment needs 20 mA current (total 140 mA). It is sufficient to use the data register to control a lamp.

Description of the 7 segments lamp

7 segmens lamp for Parallel Port

Fig.  7 segments lamp

 

References

Pin Description

1 Cathode E

2 Cathode D

3 common Anode

4 Cathode C

5 Cathode of the Dp. (Point decimal)

6 Cathode B

7 Cathode A

8 common Anode

9 Cathode F

10 Cathode G

 

Feeding and operation

This lamp works with 5 volts and 20 mA by segment. The 5 volts to feed this circuit can be obtained directly from the PC Power Supply, USB Port, or from the port of games.

 

 

suggested circuit for a 7 segments lamp

Fig. suggested circuit for a 7 segments lamp

 

 

Operation

The lamp of 7 segments has a pin by each segment and two common anodes. When to 5 volts between any pin of certain segment and the anodes are applied, this segment ignites. In order to form any combination of segments it is necessary  to apply the 5 volts to the pins that are desired.

The following algorithm allows to activate any segment of the lamp of 7 segments.

/* beginning *

To define what segments will be illuminated.

Since each segment corresponds with a bit of the state register, then a table of segments is created/bits

Segment

Bit of the control registry

value decimal

A

D0

1

B

D1

2

C

D2

4

D

D3

8

E

D4

16

F

D5

32

G

D6

64

Dp

D7

128

 

Si se quiere iluminar el segmento A, entonces se debe escribir en el registro de datos del puerto paralelo el valor 1 (valor de la tabla)

Port[dir_base]:=1

Si se quiere iluminar más de un segmento, entonces se debe escribir en el registro de datos del puerto paralelo la suma de los valores de cada segmento. Ej.:

La letra C corresponde con los segmentos A, D, E, F.

Entonces: A=1, D= 8, E=16, F=32.

La suma es 1+8+16+32=57

Luego, se debe escribir:

Port[dir_base]:=57

Si se quiere escribir un texto, se coloca cada letra y luego un retardo de n milisegundos. Ej. :

Escribir: LULU

La letra L corresponde con los segmentos D, E, F.

La suma es 8+16+32=56

La letra U corresponde con los segmentos B, C, D, E, F.

La suma es 2+4+8+16+32=62

Luego, se debe escribir:

Port[dir_base]:=56; /* L */

Delay(1000);

Port[dir_base]:=62; /* U */

Delay(1000);

Port[dir_base]:=56; /* L */

Delay(1000);

Port[dir_base]:=62; /* U */

Delay(1000);

/* Fin */

 

Home

 

 

Google