This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLC59116 Global Dimming (GRPPWM) problem

Other Parts Discussed in Thread: TLC59108, TLC59116, TLC59116F

Hi,

A while back I designed a system which uses multiple TLC59108 and TLC59116 to play back patterns etc on many LED's. The customer is very happy with performance etc, but now would like a global dimming feature implemented to reduce brightness. I thought this should be quite straight forward, since as the dimming switch is pressed I could simply re-initialise the drivers but use a new GRPPWM value.

The TLC59108 are all off one I2C channel of the microcontroller, the TLC59116 off the other. I made all the modifications to both channels. The TLC59108 are dimming as expected, but for the life of me I can't seem to get the TLC59116 to respond. It is like they are ignoring the GRPPWM value.

Below is the data which is being sent out as part of the initialisation:

-----------------------------------------------------------------------------------------------------

#define TLC59116_INIT_DATA_LENGTH        25


// Data payload to initialise TLC59116.
unsigned char TLC59116_INIT_DATA[TLC59116_INIT_DATA_LENGTH] = {
    0b10000000,        // Control Register.                                    // TLC59116 Internal Register:
    0b10000001,        // Mode 1.                                                // [0x00]
    0b00000000,        // Mode 2.                                                // [0x01]
    0xFF,            // Brightness control LED0.                                // [0x02]
    0x00,            // Brightness control LED1.                                // [0x03]
    0x00,            // Brightness control LED2.                                // [0x04]
    0x00,            // Brightness control LED3.                                // [0x05]
    0x00,            // Brightness control LED4.                                // [0x06]
    0x00,            // Brightness control LED5.                                // [0x07]
    0x00,            // Brightness control LED6.                                // [0x08]
    0x00,            // Brightness control LED7.                                // [0x09]
    0x00,            // Brightness control LED8.                                // [0x0A]
    0x00,            // Brightness control LED9.                                // [0x0B]
    0x00,            // Brightness control LED10.                            // [0x0C]
    0x00,            // Brightness control LED11.                            // [0x0D]
    0x00,            // Brightness control LED12.                            // [0x0E]
    0xFF,            // Brightness control LED13.                            // [0x0F]
    0x00,            // Brightness control LED14.                            // [0x10]
    0xFF,            // Brightness control LED15.                            // [0x11]
    10,//0b11111111,        // Group Duty Cycle Control Register (GRPPWM).            // [0x12]
    0b11111111,        // Group Frequency Register (GRPFREQ).                    // [0x13]
    0b11111111,        // LED Driver Output State Register 0 (LEDOUT0).        // [0x14]
    0b11111111,        // LED Driver Output State Register 1 (LEDOUT1).        // [0x15]
    0b11111111,        // LED Driver Output State Register 2 (LEDOUT2).        // [0x16]
    0b11111111        // LED Driver Output State Register 3 (LEDOUT3).        // [0x17]
    };
-----------------------------------------------------------------------------------------------------

As part of my fault-finding, I have stripped the code back and have removed all but one TLC59116 device from my board and it is configured as:
A0 = 0
A1 = 0
A2 = 1
A3 = 0

So a write will be: 0b11001000 = 0xC8
And a read will be: 0b11001001 = 0xC9

The control register should be set to auto-inrement all registers starting from register 0b0000.
Mode1 register has 100 for the auto-increment, not sure if this matters since it is a read-only register? OSC = ON, ignore subaddr, listen to all-call.
Mode2 register has error status enabled, Group Control = dimming, outputs change on stop.

My test board has all 16 outputs connected, but the final product has only 14 so for the purposes of testing I have LED0, 13, 15, ON at full brightness.

I can see all the above data going out, and can even read back all registers and see the GRPPWM register saying it has the value 10 stored in it... If I change the DMBLNK to '1', the outputs will blink (when GRPFREQ is set lower) which proves the LEDOUT options are set correctly, ie responds to dimming/blinking. At the moment all the code is doing is sending the initialisation, and then either some test data, or doing a read back depending on my testing.

I did come across another thread talking about issues with the GRPPWM which had no answer:

http://e2e.ti.com/support/power_management/led_driverslcd_bias/f/192/t/153172.aspx

Are there any differences (other than more outputs) between the 8-channel TLC59108 and 16-channel TLC59116, I did not come across anything in the datasheet?

Can anyone provide any insight into what could be going wrong? If needed I can provide a I2C trace of the data going out/in.

Thanks,

Bernard.



  • Bernard,

    I am using a TLC59116 EVM.  It does not have the capability to change registers 0x02-0x11 (Individual brightness control registers).  I was able to confirm your functionality.  I can get the dimming working by changing the GRPFREQ register (0x13) from 0xFF to 0x00.  There was a slight change made between TLC59108 and TLC59116 that impacts the blinking / dimming functionality  (similar to the post you cite above).

    Let me know if this helps with your application.  If not, I can use an MSP430 interface to control the individual brightness registers and further debug.

    Regards,

    Dick

  • Hi Dick,

    Thanks for looking into this. I have just done a further comparison between the 08 and 16. I modified my code to send out the initialisation only for the 08 and then the 16 and captured the I2C. They are still on seperate channels, though I don't think this should affect the results. I've inserted the files below, unfortunately the insert file seems to be inserting as an image. I didn't reduce the size to try keep the text readable, so appologies if they are quite large.

    I changed the address of the TLC59116 to match (A0-A2) that of the TLC59108. As you can see the messages are basically identical other than 08/16 address, and number of LEDs. Only the first and last LEDs are set to 200 (decimal), and the dimming value is set to 10 (decimal). On my test boards both visually and with a scope I can see the TLC59108 very dim, but the TLC59116 has not dimmed at all.

    Do you know what the changes were between the TLC59108 amd TLC59116? Is it possible that there is more than one revision of the TLC59116 in existance?

    I've just looked at one of the devices on my test board and it has the following marking: (they are TSSOP package)

    Y59116
    03KG4
    CSEC

    If possible, are you able to send just the initialisation seqence I have above to a TLC59116 device and see if it is dimming?

    Actually, I just noticed you mentioned you were using register 0x13- GRPFREQ: "I can get the dimming working by changing the GRPFREQ register (0x13) from 0xFF to 0x00." Do you actually mean register 0x12 - GRPPWM??? From the datasheet: "When the DMBLNK bit (MODE2 register) is programmed with logic 0, a 190-Hz fixed-frequency signal is superimposed with the 97-kHz individual brightness control signal. GRPPWM is then used as a global brightness control, allowing the LED outputs to be dimmed with the same value."

    Thanks,

    Bernard.

  • Hi Dick,

    I'm just wondering whether you had a chance to look into the problem I have. I realised that when you said you changed register 0x13 (GRPFREQ) to 0x00 you probably would have seen dimming as that would set the blinking to its minimum period (40ms) ON/OFF. Although it's blinking, it's fast enough to appear consistently on but dimmed.

    Thanks,

    Bernard.

  • I was having the same problem, but figured it out.  Your problem may have been GRPFREQ, which should be set to 0 according to the datasheet.  Here's my code (Arduino):

    // I2C bus addresses (excludes the R/W bit)
    #define ADDRESS 0b1100000
    #define ALLCALL_ADDRESS 0b1101000
    #define RESET_ADDRESS 0b1101011

    // I2C R/W
    #define I2C_READ 1
    #define I2C_WRITE 0

    // Control register (three MSB control auto-increment)
    #define NO_AUTO_INCREMENT 0b00000000
    #define AUTO_INCREMENT_ALL_REGISTERS 0b10000000
    #define AUTO_INCREMENT_BRIGHTNESS 0b10100000
    #define AUTO_INCREMENT_CONTROL 0b11000000
    #define AUTO_INCREMENT_BRIGHT_CONTROL 0b11100000

    // TLC59116 registers
    #define TLC59116_GRPPWM 0x12
    #define TLC59116_LEDOUT0 0x14


    void setup()
    {
    Wire.begin();
    Serial.begin(9600);

    // Transmit to the TLC59116
    Wire.beginTransmission(ADDRESS);
    // Send the control register. All registers will be written to, starting at register 0
    Wire.write(byte(AUTO_INCREMENT_ALL_REGISTERS));
    // Set MODE1: no sub-addressing
    Wire.write(byte(0));
    // Set MODE2: dimming
    Wire.write(byte(0));
    // Set individual brightness control to maximum
    for (int i=0; i< 16; i++)
    Wire.write(byte(0xFF));
    // Set GRPPWM: Full brightness
    Wire.write(byte(0xFF));
    // Set GRPFREQ: Not blinking, must be 0
    Wire.write(byte(0));
    // Set LEDs off for now
    for (int i=0; i< 4; i++)
    Wire.write(byte(0));
    // Set the I2C all-call and sub addresses (if needed)
    Wire.endTransmission();

    delay(100);
    }

    // Turn the LEDs on or off. LEDs is a 16-bit int corresponding to OUT0 (LSB) to OUT15 (MSB)
    void setLEDs(int LEDs)
    {
    int registerVal=0;
    int registerIncrement = 0b11;

    // Write the value to the LEDs
    Wire.beginTransmission(ADDRESS);
    // Write to consecutive registers, starting with LEDOUT0
    Wire.write(byte(AUTO_INCREMENT_ALL_REGISTERS + TLC59116_LEDOUT0));

    // Write the value for LEDs
    for (int i=0; i< 16; i++) {
    if (LEDs & 0x01)
    registerVal += registerIncrement;
    // Move to the next LED
    LEDs >>= 1;
    // Are 4 LED values in the register now?
    if (registerIncrement == 0b11000000) {
    // The register can be written out now
    Wire.write((byte) registerVal);
    registerVal = 0;
    registerIncrement = 0b11;
    }
    else {
    // Move to the next increment
    registerIncrement <<= 2;
    }
    }
    Wire.endTransmission();
    }

    // Set the brightness from 0 to 0xFF
    void setBrightness(int brightness)
    {
    Wire.beginTransmission(ADDRESS);
    // Write to the GRPPWM register
    Wire.write(byte(NO_AUTO_INCREMENT + TLC59116_GRPPWM));
    Wire.write(byte(brightness));
    Wire.endTransmission();
    }

    Hope this helps someone!

    Peter


  • Hi Peter,

    Thanks for posting, I had given up trying to solve the issue I was having with the device.

    Which datasheet are you looking at that says GRPFREQ must be set to 0? I am using the TLC59116 which doesn't have that in the datasheet. The datasheet says:

    "GRPFREQ is used to program the global blinking period when the DMBLNK bit (MODE2 register) is equal to 1.
    Value in this register is a Don't care when DMBLNK = 0."

    I did however check the TLC59116F datasheet:

    "NOTE
    The value in GRPFREQ has to be programmed to 00h when DMBLNK = 0."

    Is that the device you are using?

    I may try go through the datasheet again and see if I can spot anything I've done wrong, but as I mentioned in the original posts, it does seem to be working fine with the TLC59108. I had the person I did the work for try reprogramming with GRPFREQ set to 0x00, and they have said it made no difference.

    Bernard.

  • You are correct.  I am using the TLC59116F.  However, I will be trying out a TLC59116 next week and will let you know if I'm able to use group dimming on that device.

  • I was able to get the TLC59116 (not TLC59116F) working on my board, using the same code as posted above.  It dimmed as programmed using the code above, using GRPPWM.  I am seeing the "erratic flashing" as mentioned in this thread - http://e2e.ti.com/support/power_management/led_driverslcd_bias/f/192/t/153172.aspx 

  • Hi Peter,

    Thanks for letting me know you got it working. What values did you use for the Mode settings (1 and 2)? I'm wondering if there is something in there which is different to what I had.

    At the moment, in a non-working configuration, I am initialising the TLC59116 with:

    0b10000000,        // Control Register.

    0b10000001,        // Mode 1.

    0b00000000,        // Mode 2.

    ...etc

    One difference may be that I am not trying to globally dim the output in 'normal' operation, I am setting a global dimming level once at start-up (or later on a switch press at setup). Luckily this means the glitch which goes along with the change won't affect me. I was also wondering about the read-only bits in the registers, and whether it does actually matter what value it is set to when you write into it...

    I haven't had a chance to go through the datasheet again in detail yet, but hopefully in the next day or two.

  • You can see my code above.  The same code works on both the TLC59116 and TLC59116F.  I'm setting MODE1 and MODE2 to 0 on startup.  I'm setting GRPPWM while running so yes, that could be the difference.  I haven't tried to read back register values, but at this time things are working for me so I'm not highly motivated to spend more time on this.

  • Peter and Bernard,

    I am glad to see you are making progress.  Unfortunately, I do not have any sample code that I can offer for comparison.  I will continue to monitor this thread to see if there is anything I can to do assist.

    Regards,

    Dick

  • Hi all,

    I'm working on a design using the TLC59116 (not 'F'), and came across this thread while investigating what turns out to be the erratic flashing issue mentioned in the other thread.

    I have 3 RGB LEDs connected to a single '59116. My test code currently sets them to several colors in turn via the individual brightness registers, and ramps the group brightness from 0xFF to 0x00 for each color. Group dimming has been working, with the exception of the erratic flashes.

    Inspired by this discussion, I added code to change the GRPFREQ register on the fly during operation. It turns out that the datasheet is quite incorrect: GRPFREQ is definitely *NOT* a 'don't care' while DMBLNK is 0. It worked originally because the default value is 0; that is the only value at which PWM group dimming actually works correctly.

    As the value of GRPFREQ increases, the GRPPWM duty cycle dynamic range decreases. With a value of 1, the LEDs remain at 100% brightness for what appears to be the top 50% of the brightness range, and only dim from 100% to 50% with the PWM between 50% and 0%. With a value of 3, the LEDs remain at 100% for the top 75% of the range, and only drop to 75% brightness at 0% PWM. By the time the value reaches 0x20 or so, there is virtually no dimming, with all higher values effectively setting the brightness to 100% regardless of the GRPPWM value.

    There appears to be a connection between this and the erratic flashing issue. When I set the GRPFREQ value to 1, there is a consistent brightness glitch when the PWM value drops to 50% (i.e. when the LED outputs actually begin to dim). The brightness drops momentarily, then spikes back to 100%, then continues dropping. Unlike the other flashes (which are also still present erratically), this is absolutely consistent on every cycle.

    It would be nice to get to the bottom of these issues, as they really detract from an otherwise very impressive part.

    Thanks,

    ---Karl