Searching \ for 'Driving LEDs (was: Suggestions for new PIC person)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=leds
Search entire site for: 'Driving LEDs (was: Suggestions for new PIC person)'.

Truncated match.
PICList Thread
'Driving LEDs (was: Suggestions for new PIC person)'
1996\06\06@001125 by Byron A Jeff

face picon face
>
> > The "hello world" of the PIC is to blink an LED tied to a pin.  I have
watched
> > several people implement this and have one warning:
> > If you can't see the LED blinking, check with a 'scope.  PICs aren't very
good
{Quote hidden}

Hmmm, I was having a discussion about bipolar LED's driven by PIC pins in
one of my classes I'm teaching this summer just this morning. The objective
was to drive 6 bi-polar LEDS (2 pin) using as few PIC port pins as possible.
Each LED should be able to show red,green,yellow, and off.

The design I hit upon after thinking a bit revolved around multiplexing
the 6 LEDs utilizing a common pin on one side. Something like:

Port pin---+-[220ohm]--+---[LED]------  Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin

And so on. One led can be selected by tristating all but one port pin
on the right side. The selected LED's color can be picked by twiddling
with the left port pin and the one non-tristated port pin.

The question that popped into my mind during this design discussion was
the relevance of the position of the resistor. Does it matter if the resistor
is on the anode or the cathode side of an LED. Is putting the resistor on
the anode side simply a convention or is there some other reason that justifies
its placement. Should a bi-polar have resistance on both sides (I've done this
in previous designs)?

THe above configuration would be ideal because the left port pin could be
tied to the common terminal of a resistor pack somewhat simplifing the
wiring.

Thanks for any advice,

BAJ

1996\06\06@005341 by Steve Hardy

flavicon
face
{Quote hidden}

justifies
> its placement. Should a bi-polar have resistance on both sides (I've done this
> in previous designs)?
>

It makes no electrical difference which side the R is on.  Two 2-pin
devices in series may be used in any order.

BTW, the above circuit can also drive any 2 LEDs to arbitrary polarity
so long as consistent brightness isn't a problem.  How about 3 or more?
Have to think about that...

Regards,
SJH
Canberra, Australia

1996\06\06@084308 by Rick Miller

picon face
Byron!!
Byron A Jeff wrote:

It *DOES* make a difference where you put the resistor,
since programmers invariably make *mistakes*.  With only
one resistor, it would be possible to burn out the left-hand
port pin if you were to drive too many of the right-hand
pins to the opposite polarity *simultaneously*.  That's all.

If you're careful, *really* careful, not to do that, then
all is well with only one resistor.  It makes absolutely
no difference which side of the LED you put the resistor
on, unless you want to use the roughly 1.3 V drop for some
sort of measurement purposes.

Use one "file" to hold bits to be driven during the "RED"
cycle and another to hold bits to be driven during the
"GREEN" cycle.  Yellow gets a bit in both.  Then cycle
through both files, one bit at a time.  That way you
can be pretty certain you're not going to drive more than
one LED at a time.

How 'bout loading the flag file into the data output
latches and then rotating the TRIS file with one bit
cleared?  :-)  Now you know I'm going to have to build
this thing, just to see it run.

You might also wish to lower the value of the current-
limiting resistor to allow the full 20mA that the pins
can put through it.  Since you're only going to be driving
the LEDs for very small duty cycles (1/12 at most) you
certainly won't have to worry about burning them out.
--
Rick Miller
<.....rdmillerKILLspamspam@spam@execpc.com>

1996\06\06@131538 by Reginald Neale

flavicon
face
electronics house) connected as shown:
>>
>> Gnd----[220ohm]---+---[220ohm]----+5
>>                   |
>>                   +---[LED]------- Port pin
>>

This can also be used with separate red and green LEDs in inverse parallel,
e.g. a panel display to indicate TOO HIGH (red LED); TOO LOW (green LED);
or within range (tri-stated to open circuit - no LEDs).


{Quote hidden}

In a series circuit, the same current flows through all elements, so it
makes no difference which side the resistor is on. Also, if you only need
to light one of the LEDs at a time, you can simplify this by using a single
resistor at the port pin.

.....................Reg Neale.....................
"Ignorance is a renewable resource"   P.J. O'Rourke

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...