or show support
by clicking an Ad Color Theme: Dark or Light
Microchip PIC C18 TLC5940 Library
A library written in C18 for the 18F line of PICs from Microchip, to control multiple TLC5940 LED drivers. Based from a HiTech C library from a project posted on Waiting for Friday(Project Link).
Timer 0 is used to BLANK the drivers and Timer 2 is used in conjunction with CCP1 to produce the clock signal. Included files run on the 18F2550, but it could easily be ported to different chip. Runs quite efficiently and is currently setup for RGB LEDs. The R-G-B arrays are set as unsigned char, but the TLC5940 expects 12-bit numbers for its color data, to keep large amounts of LEDs from taking up way to much data memory, the 8-bit numbers are expanded to 12-bit with the 4 LSB all 0s, so no LED is ever fully on, but its not noticable.
Written to run on a 48 Channel Mono / 16 Channel RGB LED Controller which utilizes a 18F2550 and 3x TLC5940s, but the code can be easily edited to
work with different PICs and hardware platforms. To demonstrate it also includes a basic RGB LED control firmware, to fade or flash the LEDs, a few patterns have been programmed, but
more could be added.