Go Down

Topic: Library for TLC5940 16-channel PWM chip (Read 35 times) previous topic - next topic

Josh18657

Quote

ive never tried servos but you could always try hooking up a led to the output,  it should appear to blink or atleast do something.  

also have you tried another servo library or in a rc model to verify that the servo works

also looking closer at your photo i cant tell if the breadboard ground has a ground connected to the arduino ground


led doesn't do anything that I can see besides a very faint light

the servos work fine with the regular arduino servo library

yup, all the grounds are connected to the arduino ground

Quote

I haven't been following this thread but has anyone actually posted some code that makes that chip work with servos.

this thread may help you get your servos working: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232572239


yeah, back a page or 2 the op made a post about this now supporting servos, and an example is included in the zip file

great link, all my servo searching and I never came acrossed that one, i'll have to read those further


thanks guys for the quick responses

nphillips

Has anyone had an issue with "long-term" running of fades?

I have 4 RGB LEDs hooked up to the TLC, set to fade every 15 seconds to a randomly selected color. When I power the circuit up (I have the arduino set up as a stand-alone, on a PCB) everything runs fine. But when I came back to the board after a day or so, the whole thing was "frozen", and nothing worked -- no fades, and my inputs weren't responding.

I double-checked my code, and I don't see anything that might cause an issue. The only thing I could think of is the "old" millis issue where it rolls back to 0 after a while. So if X is the millis rollover point, and your timer was looking for X+10, you would never actually hit that point.

I found a post from this year saying that the rollover occurs after 55 days, as opposed to 9 hours (which was what I was familiar with). Maybe I'm using an old bootloader? I'm using Arduino 0012, and my chip I bought in July 2008.

TimoRozendal

I am very grateful for this library, makes what I want to do a lot easier.
Right now I have it working, I have these RGB led strips that I can control the way I want.

However, I noticed that the color differs a bit per strip, I think that is due to perhaps a difference in leds or the inaccuracy of the resistors.  I would like to correct for that using a calibration. Can I do that using the built in dot correction of the tlc 5940?

And then how should I do that with this library, my idea is now:
- set  "#define VPRG_ENABLED    1"  in in tlc_config.h
- connect Arduino digital pin 6 to TLC pin 27 in stead of GND
- use tlc_setDCfromProgmem(dcArray1); to set all the pins at once

Questions:
- is this correct? (or do you think there is a better way)
- is it also possible to set just 1 pin at once? and can I only do it from progmem? (tlc_setDCfromProgmem is the only function that sets dot correction, right?)
- is this data automatically stored in the EEPROM memory of the tlc5940? Or should I always have VPREG enabled and send the final calibration array every time I want to use it?
Is it simply a matter of setting tlc's DCPRG pin high to store it?


----------------------------
second question:
the drive capability of the 5940 is 120 mA, is that per channel? so can it do the 16*0.12=1.92Ampere? Does that require additional cooling? what are your experiences?

Mike Mc

Yes i'd like to do this too. My channel 0 is outputting a lower voltage to my 8x8 array.

is it possible to set the Dot Correction value on just one channel individually? I see the example shows how to set ALL of them to the same value, but I don't see the point in that function. How can just one channel be adjusted on it's own please?

ReSiStAnCe

According to the datasheet: VPRG :Multifunction input pin. When VPRG = GND, the device is in GS mode. When VPRG = VCC, the device is in DC mode. When VPRG = V(PRG), DC register data can programmed into DC EEPROM with DCPRG=HIGH

Each dot correction register is 6 bits, so you need to shift in 96 bits and then latch the data into the register.
Basicly it's the same MO as shifting in Greyscale bits, but you now do it while VPRG = high

Go Up