>
> Hi,
>
> I've recently been given a bunch of flux-type RGB LEDs which I planed
> to use in a small lighting project controlled with my OOPIC-R via PWM.
> The problem is that the LED's are common anode, and I was expecting
> common cathode. Is there any way to make use of these LEDs without
> having to build any circuitry external to the oopic-r? I'm only
> planning on running four of these RGB leds, (4x3 colours, 12 LEDs in
> total) not a very big array. The oopic-r would (as you can probably
> guess) simply fade between R, G and B over time. I'm pretty much a
> beginning with the electronics side of engineering, but from reading
> round I've found that to control common anode LED arrays (seven segment
> displays or RGB LEds) you have to sink the current coming from the
> cathodes. Is the OOPIC-R able to do this through its signal pins?
>
> cheers
>
> Jim
>
In my view, sinking LED current is the preferred way to do it.
Connect the common anode to +5VDC and put a current limiting resistor
between each cathode and an IO pin.
To calculate the resistor, you need a few facts:
Vf - the forward voltage drop of the LED at a partiular current
If - the forward current upon which to calculate. Start low and don't
exceed the maximum rated current
R = (5.0 - Vf) / If
This ignores the drop in the OOPic and will result in somewhat less
current that desired. If it matters, have the OOPic turn on an LED
and measure the pin voltage.
Then R = (5.0 - Vf - Pin Voltage) / If
With the new and improved current, the pin voltage may be a little
higher. You can calculate again but it isn't worth the effort.
Many LEDs are spec'd for 20 mA but 10 mA is usually enough to be
easily visible. Don't overdo it.
Rememeber, 12 LEDs at 20 mA means the chip has to sink 240 mA and the
total chip can sink only 300 mA ABSOLUTE MAX. Each pin is limited to
sinking 25 mA. The total combined current of PORTA, PORTB and PORTE
is 200 mA ABSOLUTE MAX. Something around 15 mA per is probably ok but
I would design for 10 mA.
You really need to read through Chapter 17 of the PIC16F877A datasheet.
Richard
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment