Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RGB LEDs with PWM??

Status
Not open for further replies.

seahkw

New Member
Hey folks.I m a PiC newbie and I stumbled upon this great forum.I am trying to use a PIC16F877 cct to drive an RGB LED to morph 7 colours.U know like to fade from green>red>blue>...>white>green.. COOL!! (http://www.superbrightleds.com/TriColor LED.htm)

I found that the only way to do it seems to be using PWM. Cau u guys give me a lead on how to get started?The kit I have uses C or assy MPLAB(**broken link removed**) Havent got much clue how to begin.. :?

Wuld really appreciate if I can get a clue from here.Thanks..!
 
PIC16F877, like all the other 28/40 pin PIC pkgs I know, have only 2 hardware PWMs. You will have to hack something together for the 3rd color. Fortunately, the rate doesn't have to be too high so the software solutions aren't too bad.

PIC16F877 is obsoleted by PIC16F877a, BTW. And the "a" is cheaper now.

Your pkg is a bit of overkill... 28 pin ones are easier to build with. But yes, it'll work fine.

The current listed on the LED specs is near the absolute max (not continuous) of 25mA for a PIC pin. Common anode would be better since the pulldown capabilities are a bit better than pullup. Take into account that the PIC pin output voltage will not be 0V when low, but will get pulled up to 1V or so under the heavy current. This will strongly affect your resistor sizes. Still, the best thing to do is add 3 external transistors to drive it.
 
Thanks Oznog! Yeah I do understand that the pkg is an overkill now.. I agree on the transistors part.. the floating 1V is definately an issue.Only thing now is how to hack the 3rd colour..Will try to think about it.
 
Status
Not open for further replies.

Latest threads

Back
Top