On Sun, Apr 18, 2004 at 07:16:08PM -0700, Brooke Clarke wrote: > Hi: > > I would like to experiment with a 3 color LED to see what colors it can > make. That's on my task list too. > The commercial color LED drivers seem targeted for cell phones and are > extremely small surface mount parts making them difficult to work with. And unnecessary. > > I would like to have good control of the current in the Red, Blue and > Green LEDs. The forward drops for the 3 colors are considerably > different with Blue a little over 3.5 Volts. This is a problem in that > a small change in the supply voltage or LED temperature will cause a big > change in the LED current is simple dropping resistors are used from a > +5 Volt rail. So use individual resistors for each leg that matches the Vf for the particular color. > > One approach would be to use 3 independent current sources, each good > for 100 ma and switch them on and off (PWM) with an 8 pin PIC. Be sure to check both the absolute current ratings and the duty cycle curves for the part. Exceeding the max current for a given duty cycle is a recipie for a smoking crator instead of an LED. Also be aware that 100ma well exceeds the current capacity of a PIC I/O pin. So you're looking at a transistor driver to make it work. And simply adding a low valued resistor on the emitter leg of a NPN transistor can get you simple current control by providing a PWM generated analog voltage at the base of the transistor where the current is (Vb - 0.6V)/Re Vb=base voltage and Re = Emitter resistor. One question (in general): any particular reason folks are so enamored with the 8 pin parts? Personally I avoid them like the plague due to extremely limited I/O and complete inability to have a bootloader. Unless you're talking about a 1000+ unit run, the costs between the 8 pin part and a hefty capable 40 pin part with all the bells and whistles (12F629 and 16F871 as examples) is only a 3X price difference. In hobbyist/small scale run terms, the price is negligable. So I'm just wondering if there is an advantage to develop with a extremely limited target as opposed to a larger more capable part? > > Is there a simpler way to do this? Not really. Make sure you read up on Scott Dattalo's vertical counters for software PWM which will let you set an control multiple channels. And while testing your code, I'd advise using current that is under the 100 percent duty cycle maximum to retain the magic smoke. BAJ -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu