PIC16F628 Serial 8 RGB LED Controller

This code is for a simple RGB LED controller for 8 LEDs using a PIC16F628. It is controlled by sending 3 bytes to the internal USART for the red, green, and blue color channels. The operation is very simple and so is the wiring. The PIC selects each LED then turns on/off the respective colors then goes to the next LED. Because of persistence of vision, the eye sees the LEDs as all being on at the same time.

Read More

PIC16F628 8 RGB LED Controller

This code is for a simple RGB LED controller for 8 LEDs using a PIC16F628. The pattern is determined by the data in the EEPROM. Upon startup, the controller loads the data into RAM and starts up the sequence. The operation is very simple and so is the wiring. The PIC selects each LED then turns on/off the respective colors then goes to the next LED. Because of persistence of vision, the eye sees the LEDs as all being on at the same time. Currently the max number of display patterns is 20 (because the bank array is 80 bytes and each pattern is 4 bytes).

Read More

PIC16F628 Serial 1 RGB LED PWM Controller

This code is for a simple RGB LED controller for 1 LED using a PIC16F628 that has PWM control for the LED. It is controlled by sending 2 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 loops and turns on the respective colors if they are less than or equal to theCount. Because of persistence of vision, the eye sees the LEDs as all being on at the same time. The 4-bit code below has 15 linear values of PWM. The 8-bit code has 255 linear values of PWM. The 4-bit exponential PWM code has 15 values fit to an exponential curve. This allows for more “even” color levels because the human eye does not readily perceive linear changes in light intensity. For LED applications, the 4-bit exponential code is recommended.

Read More

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.

Read More

PIC12F675 Single RGB LED Controller

This code is for a simple RGB LED controller for 1 RGB LED using a PIC12F675 (or PIC12F629). The pattern is determined by the data in the EEPROM. When the PIC needs a new target for the PWM, it loads it from EEPROM. Pin 4 (GP3) is pulled high because it is used to switch between displays. Please see the source code for more information; the structure and design is commented. The operation of the controller is very simple and so is the wiring. Read More