This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Thursday, October 18, 2007

[oopic] Re: Common Anode RGB Leds

Thanks for the response Richard, it is a great help. I'm really
impressed with how friendly this group is and willing to share!

Conceptually I'm still a little lost with the idea of sinking current
through the IO pins, do I need to do something in software to put the
relevant lines into a "current sinking" mode, or will the PWM control
just 'work' and somehow recognise that during the active part of the
duty cycle it's supposed to be sinking current, not providing it.

Sorry if this is exposing a fundamental (and embarrassing) lack of
knowledge of electronics, I'm using this project as a learning
experience!

I've got the PIC16F877A datasheet and will be reading it through.

Jim

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, "jim_three_uk" <jimthree@> wrote:
> >
> > 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:

http://docs.yahoo.com/info/terms/

No comments: