PIC16F628 Serial 8 RGB LED PWM Controller
This code is for a simple RGB LED controller for 8 LEDs using a PIC16F628 that has PWM control for the LEDs. It is controlled by sending 12 bytes to the PIC’s internal USART for the intensities of the red, green, and blue color channels. The operation is very simple and so is the wiring. The PIC selects each LED and turns on the respective colors if they are less than or equal to theCount then goes to the next LED. Because of persistence of vision, the eye sees the LEDs as all being on at the same time. However, because this is running off the internal OSC (4MHz) and the code is not optimized, there is some flickering evident when moving one’s head from side to side.
![]()
The microcontroller code can be downloaded here:
- u8RGBpwm4.jal ( u8RGBpwm4.hex)
Sample VB code and test application: 8RGBpwmblinkenlightsDR1r1.zip


December 7th, 2006 at 9:58 pm
Would you send me an example of your fantastic idea? SChematic and code of any type would be great! I just happen to have a free copy of BASIC for the pic so that would be nice.
Thnaks for any help,
Matt
December 10th, 2006 at 3:20 am
your projects are good, but I think it is better to write programs in assembly because I’m not familar with jal very well. Thank you.
March 2nd, 2008 at 7:08 pm
You could also charlieplex the rgb leds.
June 3rd, 2008 at 8:10 pm
How about making it where it stores the pattern in EEPROM and plays it back without need for serial connection?