Pages: 1 [2] 3   Go Down
Author Topic: 2 TLC5940 problem, possible overload?  (Read 3367 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay so i tried the 2nd code you submitted and here is the result

http://youtu.be/aEZmlAXeBYA

In response to the wiring, i have it wired up exactly as how it was before.
Logged

Accelerate to 88 miles per hour.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Heres the 1st code post you gave me.

http://youtu.be/d0D6X_gIpY8
Logged

Accelerate to 88 miles per hour.

Salem, Oregon
Offline Offline
Sr. Member
****
Karma: 7
Posts: 310
Friends don't let friends use Strings
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In response to the wiring, i have it wired up exactly as how it was before.

So that means no 10k on VBLANK then?  Sorry, I was just asking.

This is closer to what I had in mind... can you see the differences from the code I posted before?

Code:
void loop()
{
  int maxValue;

  channelOne = random(15);            // pick any one LED from 0 to 31
  maxValue   = 3584 + random(512);    // don't always use the same brightness

  uint32_t startMillisOne = millis() + 50;
  uint32_t endMillisOne = millis() + 1000;

  tlc_addFade(channelOne, 0, maxValue, startMillisOne, endMillisOne);
  tlc_addFade(channelOne, maxValue, 0, endMillisOne, endMillisOne + 1000);

  // now run the fade until it completes
  while (tlc_isFading(channelOne))
    tlc_updateFades();
}

A problem in your code that I missed is you have an error with the 2nd tlc_addFade (you need to make sure the fade is set to end after it starts).

I finally added more LEDs to my TLC5940 board so I could see exactly what the code was doing.

Brad.

EDIT: Removed bogus error comment here... note the other code is much more visually interesting once you correct the errors - that 50 millis delay before the fade starts allows the fade buffer fill up a bit and is probably more along the lines of what you want.  I do wonder if you should be checking to make sure you don't have multiple fades on the same channel (since random could return a dupe).

EDIT2: You should use 31 not 15 in the code fragment - I've only got one TLC5940 wired in to my board.
« Last Edit: March 01, 2012, 11:21:03 pm by Brad Burleson » Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't understand why my 2nd tlc5940 won't work. 

So the code seems to work fine although i still don't have any communication through the 2nd tlc5940(the daisychained one).  and every once in a while an led will flicker a bit, seems like i would need a .1 micro farad cap although i dont have enough room for that.

Here is the video

http://youtu.be/Us1wQ3DXCvk

I changed the
Code:
channelOne = random(15);            // pick any one LED from 0 to 31

to
Code:
channelOne = random(31);            // pick any one LED from 0 to 31

so that it would encompass all the leds avaliable
Logged

Accelerate to 88 miles per hour.

Salem, Oregon
Offline Offline
Sr. Member
****
Karma: 7
Posts: 310
Friends don't let friends use Strings
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't understand why my 2nd tlc5940 won't work. 

Have you ran the BasicUse example against your hardware?  Either make sure you modify NUM_TLCS (which I think you've done) OR change the example code itself.

This example will do a "night rider" sort of fade along all the LEDs available.

If that doesn't work you need to double-check your wiring.

(the code you're running will have an extra delay with no-LEDs lit every so often - I assume because there isn't actually 512 levels of brightness for LEDs - but your video has too many "holes" where I think it's trying to fade LEDs on the 2nd TLC5940).

Brad.
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

so i double checked the wiring and i had forgotten to wire up the same glsck and all that good stuff from the first tlc to the second. 
After I did that, i did the basic use example and it did the ghost rider but only till the end of the 2nd and then ti would blink in the middle and then at the end of the first and then jump to the end of the 2nd and repeat the wierd blinking sequence.
So I then uploaded the 1st code segment from earlier that you put up and now the led on the board is like dimmed.  I don't know why.  its dimmed for a long time and then every once in a while an led will fade in then out...
« Last Edit: March 02, 2012, 12:13:18 am by funkyguy4000 » Logged

Accelerate to 88 miles per hour.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm headin to bed, I'll be able to talk to you about this tomorrow night. but for a few hours at the most. 

from like 4-6:30 central...

I really really appreciate your help, I mean wow, I didn't think it would be this complex.  I would still like some help finishing it out though.

Talk to you tomorrow brad!
Logged

Accelerate to 88 miles per hour.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try replacing tlc.clear() with tlc.setAll(4000). This will set all the channels to 4000. I, personally, think your Arduino is struggling to supply all of the voltage to the TLCs and LEDs. I'd give them their own 5v supply and stick on some decoupling caps.
Are you just wanting to light one LED at a time, random LED and random brightness? I have a function that does that but doesn't use fades.
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

naw its not the voltage, i know for a fact people have done this like this with a 3.7 LiPo, its just the code is freaking out.
Besides i dont have the board space or the time to mess with caps now, i have 2 .1 micro farad caps and thats it.
Logged

Accelerate to 88 miles per hour.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whereas I know for a fact that the basic use code works perfectly. If you can't get that working then you're never gonna get some custom code working.
A Lipo would also be fine, as you'd be giving the LEDs their own voltage, not pulling the 5v from the Arduino pin.
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The whole circuit runs on a 3.7v LiPo.  All wired in parallel.  I just don't understand why its freakin out
Logged

Accelerate to 88 miles per hour.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The whole circuit runs on a 3.7v LiPo.  All wired in parallel.  I just don't understand why its freakin out
Exactly, in parallel. Yours in running in serial, pulling down the 5v that goes into, then out of the Arduino and into the TLCs and the LEDs. Try putting another 5v, or 3v or whatever they can take, to the LEDs, linking the grounds together
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

could i put the 5v from the arduino to the tlcs and then the 3v3 from the arduino to the leds?
Logged

Accelerate to 88 miles per hour.

Salem, Oregon
Offline Offline
Sr. Member
****
Karma: 7
Posts: 310
Friends don't let friends use Strings
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The whole circuit runs on a 3.7v LiPo.  All wired in parallel. 

Well that's what was discussed but as Demonic69 noted if you're wiring up your board to match the diagram in the first post, you're not wired in parallel.

Simply drop the 5v line from the Arduino to the breadboard and then power both boards from the same 5v source (or same LiPo, just don't power only the Arduino and run it's 5v to the TLC5940s).  Start there, and if you still have issues you might want to try another power supply as mentioned (assuming fairly mundane LEDs, a decent 5v source should at least run BasicUse without any problems).

And again keep with the BasicUse example until all the LEDs work.  Then you can move on to playing with the code.

Quote
could i put the 5v from the arduino to the tlcs and then the 3v3 from the arduino to the leds?

No.  Typically the Arduino doesn't provide much 3.3v and you really don't want to power anything extra from your Arduino.

BTW I also missed an error in the use of random().  If you call random(15) you get a value returned between 0-14.  That means one LED won't be lit.  So you need to adjust your values by one (later of course, after everything is working).

This is a picture of my test rig.  Granted it's only a single TLC5940 right now, but I'll connect 2 more tonight and show the results.

I hope I'm not making things worse,

Brad.


* lilyOneTLC.JPG (156.51 KB, 640x480 - viewed 23 times.)
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay i'll work that out.

It may be just that there isn't enough voltage.  I'll keep on working things out.

Thank you guys so much for your help,  If i have any further questions, ill post them here
Logged

Accelerate to 88 miles per hour.

Pages: 1 [2] 3   Go Up
Jump to: