How to use a LED driver?
Promagic
Posts: 17
The led driver that i have is the TLC5940 "http://www.ti.com/lit/gpn/tlc5940"
It has 16·channels with pwm,·I have googled for hours now and cant even find a single sample code.
How do I communicate between BS2 and the TLC5940, or ANY LED controller?
Many Thanks!
It has 16·channels with pwm,·I have googled for hours now and cant even find a single sample code.
How do I communicate between BS2 and the TLC5940, or ANY LED controller?
Many Thanks!
Comments
So, on the BS2, you'll need a "SHIFTOUT" command (LSB First, it looks like). Then you'll need to PULSOUT the XLAT signal.
You'll need to connect a pin for serial_data_out, a pin for serial_clock, a pin for XLAT, and a pin for Ground/Vss.
He'll also need a Vdd input, right?
In addition, it does say "All data are clocked in with the MSB first." on page 12 of the datasheet.
Also the VPRG pin (pin 27) should be grounded to keep it in GS mode, unless you want to use the Stamp to control the "Dot Correction", in which case you could assign a pin to shift it between those two modes.
As I understand things, he'll need something like
I think that the GS mode is the standard way of putting out data to the output lines, so there are 192 bits (12 bits for each of 16 lines), so that to turn output 0 _only_ to its highest setting, you'd shift out 12 bits of "1" followed by 180 bits of "0". Since the maximum number of bits per shift is 16, this will have to be done with multiple values. From the Stamp Manual, p. 437:
So the SHIFTOUT command to turn on just output zero might be
I'll bet that even if that works, it's the least elegant way to do it, but am I in the ballpark here?
Then each of the outputs can be set to a brightness anywhere from 0 to 4096, so something like this would give him full output on output 0, and each following output be half as strong (with the last three off entirely):
Post Edited (sylvie369) : 11/14/2008 3:21:57 PM GMT
First of all is something called a "serial-in parallel out shift register", Does anyone know how to program one?
http://focus.ti.com/docs/prod/folders/print/cd54act164.html
http://www.cs.cmu.edu/~RAS/Docs/surface/shift_register.html·-This was helpfull
Second, Is the Good old fashioned way! Fancy Wiring!
3 ports = 6 Leds
4 ports = 12 Leds
5 ports = 20 Leds
6 ports = 30 Leds
8 ports = 56 Leds
Each individually controllable!
http://www.josepino.com/pic_projects/?how_control_leds.jpc
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
Post Edited (Promagic) : 11/19/2008 5:31:43 AM GMT