Pages: [1] 2 3   Go Down
Author Topic: Tlc5940 multiplexing code  (Read 4618 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again,

I have two rows of 4 RGB Led's.  The anodes are powered with P-Fet's and go through the TLC5940.  I looked at the sample library but it pretty much just confused me.  I believe what is suppose to happen is that the Led's are suppose to but turned on and off very quickly so that your eyes cannot detect it and to minimize the amount of power it would take when all of them are on.  Can someone point me at a link or just assist me on how I can control this small matrix with the TLC5940 multiplexed.  I have searched and came across a few things but all of them are a lot more complex.  I prefer to start simple and add up.  Please let me know if you can assist me.  Thank you in advance. 
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm with you on this one, all I seem to find is some old outdated posts and many of them have very basic documentation.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd love to see this too. I'm embarking on a 49 RGB LED matrix and want to power it with TLC5940's.
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2511
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've seen Grumpy Mike's example? http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

In his schematic you'd assumedly be skipping the switch and diode that he has associated with each LED, and also note that all of the R/G/B channels should be connected vertically.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've seen Grumpy Mike's example? http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

In his schematic you'd assumedly be skipping the switch and diode that he has associated with each LED, and also note that all of the R/G/B channels should be connected vertically.

Would http://www.sparkfun.com/products/10349 be a suitable transistor compared to the recommended TPC6108?

Also, would this scale to 7x7 okay? Would I need to change anything other than the resistors?

Thanks!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34129
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, would this scale to 7x7 okay?
I scaled it to 8X8 in my Hexome
With one TLC5940 per colour so that you can have separate current control allowing you to balance the colours.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, would this scale to 7x7 okay?
I scaled it to 8X8 in my Hexome
With one TLC5940 per colour so that you can have separate current control allowing you to balance the colours.

Should I still use 15k resistors?
Would this through-hole FET work okay instead of the one you used? http://www.sparkfun.com/products/10349

Sorry, I'm new to the whole multiplexing thing and electronics in general and want to avoid burning up all those LEDs  smiley

Thanks for the help!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34129
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Should I still use 15k resistors?
Where?


The TLC5940 does not required LEDs to have current limiting resistors as there is a current limiting circuit in the chip. Just one resistor is needed to set the current for all the LEDs.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Should I still use 15k resistors?
Where?
If I'm reading it correctly, your schematic shows 15k resistors connected to each diode. If I'm not using the diodes, I can eliminate the resistors as well then?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34129
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes those are pull down resistors for reading the switches. That circuit uses the same matrix scanning that lights the LEDs to scan for key depressions at the same time.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes those are pull down resistors for reading the switches. That circuit uses the same matrix scanning that lights the LEDs to scan for key depressions at the same time.
Ah I see. And will a 60v 27a FET work okay in lieu of the one you suggest in your schematic?

Thanks for all the help!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34129
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That is one heck of an over specification but as long as it turns on fully with 5V (that is a logic level one) it will work.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got everything hooked up, but was hoping someone could double-check my work before I blow something up.

In particular I'm worried about a few things:
1) I'm not sure I wired the decoupling capacitors correctly
2) Im not sure I wired the FETs correctly
3) I connected the 5940's together as per the playground article* which seems to differ slightly from Grumpy Mike's schematic †.
4) I used open digital pins to add in the extra rows of LEDs/fets. The pins in Grumpy Mikes schematic seemed pretty particular and some out of order so I'm worried I'm missing something here.
5) The Arduinome_4X4_RGB.pde fails to compile (error: 'PD6' was not declared in this scope)

Note: Ignore the IR LEDs and photoresistors since I don't have those hooked up yet. Also ignore the scribbles on the breadboard. They were there when I bought it from a scrap house and won't come off. smiley

EDIT: Also, I know the LED's aren't connected to the 5940's yet, but will connect up by color (RGB) to the three chips.

http://i.imgur.com/1HPjp.jpg
http://i.imgur.com/TQhrT.jpg
http://i.imgur.com/OYwnC.jpg
http://i.imgur.com/qPQnt.jpg


*http://students.washington.edu/acleone/codes/tlc5940arduino/img/breadboard-arduino-tlc5940.png
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome_files/4%20X%204%20RGB%20LED%20Matrix.pdf

« Last Edit: June 05, 2011, 05:54:31 pm by elemeno » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34129
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduinome_4X4_RGB.pde fails to compile (error: 'PD6' was not declared in this scope)
Looks like there has been a change in the latest Arduino distribution that makes this not compile. Take the TLC5940Multiplex_defines.h file and add the following to the end:-
Code:
#define PORTB   _SFR_IO8 (0x05)
/* PORTB */
#define PB7     7
#define PB6     6
#define PB5     5
#define PB4     4
#define PB3     3
#define PB2     2
#define PB1     1
#define PB0     0


#define PORTD   _SFR_IO8 (0x0B)
/* PORTD */
#define PD7     7
#define PD6     6
#define PD5     5
#define PD4     4
#define PD3     3
#define PD2     2
#define PD1     1
#define PD0     0
I have now amended this file on my site.

Quote
I connected the 5940's together as per the playground article* which seems to differ slightly from Grumpy Mike's schematic
My schematic uses a modified early version of the TLC5940 library which is what I based my code on. The "official"  library changed some of the pins, there pins have fixed hardware functions so it is not a simple matter to change them. So you must use my wiring with my code or the other wiring with the other code, you can't mix them.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Care to fax each other apple juice?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm getting very close! The code complied and some of the LED's are firing, but are very weak. I think it's because there's not enough power. The schematic calls for +5v on pin 19, pin 21 and the FETs. I noticed the schematic says "+5v DC Prog" on pin 19. Does that mean I should be using a separate power supply there?
Logged

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