Pages: [1]   Go Down
Author Topic: TLC5940 and dot correction  (Read 711 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have an Arduino mega 2560, and one (later man) TLC5940 to control RGB LEDs.
It works all great.

I want to use the dot correction in order to get better color (yellow, is more green etc...).

So, I connect the pin 27 of the TLC to the pin 50 of my arduino, and enable VPRG in the config file.

Thats my code: (from the TLC5940 library http://alex.kathack.com/codes/tlc5940arduino/html_r014/group__ReqVPRG__ENABLED.html)

Code:
#include "Tlc5940.h"
#include "tlc_progmem_utils.h"


prog_uint8_t dcArray1[NUM_TLCS * 12] = {
DC_QUARTET(32, 63, 32, 63), DC_QUARTET(32, 63, 32, 63),
DC_QUARTET(32, 63, 63, 63), DC_QUARTET(32, 63, 32, 63),
};
// treid with differents values  for the dot correction

void setup(void)
{
Tlc.init();

tlc_setDCfromProgmem(dcArray1);

while (Tlc.update()); // tried with and without this line
}

void loop(void)
{
Tlc.clear();

// set red color to all rgb lights

Tlc.update();

}

The RGB light are no more red but more cyan/white.

I don't really understand how it should work.
Did somebody already get dot correction working on an arduino mega?

Thanks for your help!
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I could be wrong, but I was under the impression that dot correction on a TLC5940 is to compensate between brightness levels of different LEDs, for example if you are using banks of LEDs from different manufacturers.

If you want to adjust the actual color an RGB LED is producing I think you would want to do something like an HSL to RGB color space transformation, because then you could adjust the hue until you're happy.

http://en.wikipedia.org/wiki/HSL_and_HSV

or, en Français,

http://fr.wikipedia.org/wiki/Teinte_saturation_lumière

Good luck!


Moderator edit: link corrected
« Last Edit: March 28, 2013, 03:08:55 am by Coding Badly » Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

France
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh ok I thought dot correction was to get better colors.

Thank you very much for your help!
Logged

Offline Offline
Edison Member
*
Karma: 28
Posts: 2045
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The RGB led is really three separate leds,   and you can use the dot correction to adjust the
relative brightness of the three leds,   which is going to give you better colour combinations.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just implement the HSL color space, and it's really better to change the colors.

But my problem still the same, I don't get a real Yellow. So I think I need the dot correction.

Do someone have an answer to my first question? (how to use dot correction with arduino 2560 and tlc5940)
Logged

Offline Offline
Edison Member
*
Karma: 28
Posts: 2045
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet is pretty clear.   You set a pin so the chip can tell it is dot correction data and then you clock out
six bits for each output  and then set into the register.

You can also lock the data somehow into eprom, haven't tried that, don't have 23 volts to do it.
Logged

Pages: [1]   Go Up
Jump to: