TLC5940 - General Discussion - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

TLC5940


  • Please log in to reply
61 replies to this topic

#1 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 02 May 2012 - 06:59 PM

I'm looking for some examples (wiring diagram & code) on how to use this IC without any special function (just to start with setting PWM output values, no corrections, nothing).
There is already another thread, where I asked for info, http://forums.netdui...h__1#entry18925 but I see that it doesn't come up on the list (maybe it's too old), so I start a new thread here.
I found very difficult even only to understand the needed wiring, so a very very short mini-tutorial would be really appreciated (not only by me, I'm sure...).
Thanks in advance
Andrea

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 May 2012 - 11:46 AM

Andrea, the TLC5940 is maybe popular, but is also cumbersome (at least from my viewpoint) to manage. Also it leaks on an *awful* retriggering task, which has to be performed with a complex logic (counters and oscillators).
That's the way I never bet anything for that chip, at least for the Netduino world.

Just have a look at these chips, for example:
http://www.austriami...iver-ICs/AS1117
They are simply amazing, plus they are cheap (I guess around €5 each).

To drive a similar chip is trivial using Netduino (I didn't try yet though), and it embeds everything you need: led/display drivers, and keypad.
I'm seriously thinking to buy some of these, just to play on...
Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 03 May 2012 - 11:49 AM

Ohh that AS1117 indeed looks promising! Nice find. Now just need to find a nice shop that sells them :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 May 2012 - 12:08 PM

Ohh that AS1117 indeed looks promising! Nice find. Now just need to find a nice shop that sells them :)


It's just around your corner!
Biggest fault of Netduino? It runs by electricity.

#5 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 02:11 PM

Hi, Mario, nice to hear from you again! :-) Yes, you are right, 'cumbersome', for the TLC5940 is the minimum :-) I've seen the ICs you mention, and they look promising: you can also order free samples, but I see that they are all in formats not much hobby-friendly (no DIP, just to be clear!). If it's really the case, I cannot understand how I could use them in my small, single, applications... Andrea

#6 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 04:32 PM

...I'm to ask if some good angel can give a look and tell me what he thinks about this configuration, with my TLC5940.
I found a small but interesting document here: TLC5940 One-Wire Control, where, with an apparently simple wiring, I should be able to turn on and off the entire block of LEDs. The only interesting page is page 3, even if the whole document is there.
I wired the chip in this way:
Posted Image
and used this code to try to get the led flashing:
Thread.Sleep(300);

var gsclk = new OutputPort(Pins.GPIO_PIN_D0, false);
var blank = new OutputPort(Pins.GPIO_PIN_D1, true);

Thread.Sleep(200);

bool enable = false;
while (enable)
{
    blank.Write(enable);
    Thread.Sleep(1);
    gsclk.Write(!enable);
    Thread.Sleep(2000);
    enable = !enable;
}

Here I'm supposing I can use the Netduino to turn high and low the two signals GSCLK and BLANK, with a simple delay, as suggested by the document (it uses a subcircuit, there).
The other difference is the capacitor in the bottom of the figure, between Vcc and ground: there are no numbers, and I suppose it's there to stabilize input voltage (or not?).
Please, is there someone who can give a look and enlighten me on anything that can be wrong?
Thanks again.
Andrea

#7 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 04:40 PM

I add that the resistance linked to Iref and ground is 500Ohm, as suggested by formulas in the original TLC5940 datasheet, to get about 78mA sink current to the LEDs. Andrea

#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 May 2012 - 04:45 PM

bool enable = false;
while (enable)
{
 ...
}

There is error in the code: while(false) never executes the inside code. I have not checked the wiring, though.

#9 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 04:55 PM

:-(((((((( I win the 'Stupid of the year' prize hands down... At least now my wiring is ok, and the leds are flashing... I have a jumpstart, to understand how to handle the chip! As always, the most obvious thing (error) is invisible, when you see it too many times! :-( Andrea P.S.: I hope you all will never know I am a 20 years+ experienced software programmer... :-)))

#10 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 06:41 PM

Ok, today is not my lucky day: the AS111* chips that Mario mentioned previously in this thread are absolutely available in PDIP version too... Andrea

#11 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 06:56 PM

Just to confirm today is not my lucky day, correction of the correction: the interesting chips are NOT in the PDIP format. Andrea

#12 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 03 May 2012 - 10:29 PM

...I think I have to give up, maybe Mario is right: the chip is too much cumbersone, to say the least.
What puzzles me is that I've tried two sources I found in internet:
- http://tlc5490netduino.codeplex.com/
- http://forums.netdui...940-pwm-driver/
but neither one has the wiring diagram. It's really strange that programmers so kind to share their code don't think to inexpert people like me: or I'm so inexpert to not see something obvious... :-)
Everywhere I look I find some different detail, on the wiring, so that it's even impossible to try every combination!
Andrea

#13 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 04 May 2012 - 05:28 AM

- http://forums.netdui...940-pwm-driver/
but neither one has the wiring diagram.

If you follow the link to the blog in the above forum post you will find the schematic for the circuit. You are right that the post does not contain a Fritzing diagram but the schematic is there.


Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#14 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 04 May 2012 - 05:42 AM

Just have a look at these chips, for example:
http://www.austriami...iver-ICs/AS1117
They are simply amazing, plus they are cheap (I guess around €5 each).

Looking at the datasheet this does not appear to be a PWM chip - unless I've missed something. Looks interesting though. I feel a cube controller redesign coming on.

Stefan - you can get them from Digikey but they only appear to be available as QFN packages. The AS1115 which is similar is available in an SSOP package.


Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#15 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 May 2012 - 06:51 AM

Looking at the datasheet this does not appear to be a PWM chip - unless I've missed something. Looks interesting though. I feel a cube controller redesign coming on.

Stefan - you can get them from Digikey but they only appear to be available as QFN packages. The AS1115 which is similar is available in an SSOP package.


Regards,
Mark


Well, it depends on what Andrea has in his mind.
From a led-driver perspective (as the TLC is), the AS* do offer a PWM modulation.

BTW, I'm afraid that Andrea is looking for something else than a LED driver.
Cheers
Biggest fault of Netduino? It runs by electricity.

#16 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 04 May 2012 - 07:20 AM

Yes, Mark, but in your case I cannot get over the external timer problem: I would like to handle everything from the netduino. Mario: I'm still looking, but I'm pretty sure that in the PDIP chips I cannot find anything interesting. Could you confirm that the other packages are not easy to handle for a hobbyist like me and most of the others here? Andrea

#17 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 04 May 2012 - 08:27 AM

Yes, Mark, but in your case I cannot get over the external timer problem: I would like to handle everything from the netduino.

If you want to run the GSCLK from the Netduino then you will have a slow clock signal which will lead to a very long period for the PWM signal. The NETMF is not fast enough to generate a clock signal for the chip if you want sub 1 second frequencies for the PWM output.

regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#18 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 04 May 2012 - 08:44 AM

1-second period??? why so much? Interesting, though: if this is the case, definitely this chip is NOT for me... and maybe for anyone... Andrea

#19 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 04 May 2012 - 10:46 PM

Mario, I am to clarify what you (maybe) imagined some message ago. My idea is to drive a lot of DC motors using many L293D's (Half bridge motor driver). These need a PWM signal for speed (and other signals, that I would send with 74HC595's), so I thought to the combination with TLC5940, but I'm starting to fear this is a little at dream level... In each L293D signals would enter coming from these two chips. Do I have to change my ideas? Andrea

#20 Nzc

Nzc

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationNetherlands

Posted 09 May 2012 - 10:07 AM

I'm working on a driver for the Tlc5940 for Netduino. I use the PWM ports from the Netduino to control the BLANK and GSCLK cycles, and the output looks pretty smooth to me, no flicker whatsoever. I have a GSCLK period of 2 microseconds, BLANK on 4096 times that, so roughly 10 ms per PWM cycle. Communication on the SPI port runs at about 40 MHz (if I can believe the documentation ;) ), I don't see any noticable interruptions when switching the signals. I use a shield from Sparkfun, not all pins are exposed there (notably VPRG), but for now it'll do. I actually wanted to ask if there is anyone interested in code like this. Maybe I should just put it on Sourceforge?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.