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.

TLC59711: Large changes in led brightness for small PWM changes

Part Number: TLC59711

Hi All,

I am trying to create a very smooth fade in/fade out process using this device but for some reason when entering very low numbers

into the PWM value of a given channel (say the values 1 and then 2 and then 3) I see relatively big changes that should not be there.

In the past two years I have been working a lot with 16bit PWM for leds fade in/out processes and I know something is wrong here. For a range of 65535 possible values, such

small changes should not be even noticeable to the eye.

I guess I am missing something when controlling this device. I would to learn what is the reason for what I am seeing and how can I fix it.

Thank you,

Nir

  • Hi Nir,

    Glad to help you. Please kindly provide related information such as:

    1. schematics & PCB layouts

    2. oscilloscope captures for power rails and communication lines (if you have)

    3. controlling codes

    Best Regards,

    Steven

  • Hey Steven,

    Thank you. Since this project is only in the proof of concept stage, I have gone and used two of Adafruit's TLC59711 break out board (https://www.adafruit.com/product/1455) cascaded together and connected them to Adafruit's MetroMini (https://www.adafruit.com/product/2590) which is a compatible Arduino board.

    Everything is working great and I can control the brightness of each led. The only issue is the one I mentioned in my original post. I am trying

    to understand if there is something in the code that might cause this. 

    Below is the simple source code for the example (please see my comment inside the code under "NIR") and am also attaching the library.

    /***************************************************
    This is an example for our Adafruit 12-channel PWM/LED driver

    Pick one up today in the adafruit shop!
    ------> www.adafruit.com/.../

    These drivers uses SPI to communicate, 2 pins are required to
    interface: Data and Clock. The boards are chainable

    Adafruit invests time and resources providing this open source code,
    please support Adafruit and open-source hardware by purchasing
    products from Adafruit!

    Written by Limor Fried/Ladyada for Adafruit Industries.
    BSD license, all text above must be included in any redistribution
    ****************************************************/

    #include "Adafruit_TLC59711.h"
    #include <SPI.h>

    // How many boards do you have chained?
    #define NUM_TLC59711 2

    #define data 11
    #define clock 13

    //Adafruit_TLC59711 tlc = Adafruit_TLC59711(NUM_TLC59711, clock, data);
    Adafruit_TLC59711 tlc = Adafruit_TLC59711(NUM_TLC59711);

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



    // Uncomment this line if using UNO/AVR since 10 has to be an output
    // for hardware SPI to work
    pinMode(10, OUTPUT);

    tlc.begin();

    tlc.setPWM(2,1); // NIR: This is the line that controls each led brightness. So here for example I am trying to control led #2 with a PWM value of 1
    tlc.write();
    while(1)
    ;
    }Adafruit_TLC59711.hAdafruit_TLC59711.cpp

  • Hi Nir,

    Thanks for your reply.

    1. How do you power the device?

    2. What is your CLK frequency for the communication interface? Have you checked whether communication signals are stable and meet timing requirements?

    3. Does the pre-mentioned issue occur for both cascading devices?

    4. Can you read out the 224-Bit Data from the shift register through SDTO pin? I need to check whether you input the right bits into TLC59711.

    Best Regards,

    Steven

  • Hey Steven,

    This issue occurs on both cascaded devices. Yes, communication is very stable and works great. In do not think this is an hardware issue since

    all commands work correctly. Reading the device's D/S, page 17, it reads:

    "The TLC59711 can adjust the brightness of each output channel using the enhanced spectrum pulse width
    modulation (ES-PWM) control scheme. The PWM bit length for each output is 16 bits. The use of the 16-bit
    length results in 65536 brightness steps from 0% to 100% brightness"

    Which is very good and exactly what I need for this project. However, on page 18, it reads:

    "Enhanced spectrum (ES) PWM has the total display period divided into 128 display segments. The total display
    period refers the period between the first grayscale clock input to the 65536th grayscale clock input after BLANK
    (bit 213) is set to '0'. Each display period has 512 grayscale values, maximum"

    And this is the part where I got lost. Does this actually mean that each led can have only 512 GS values and not 65,536? Because this is the way it seems

    to act. If you change a single value out of a range of 65536 values, you will not see it but if you change a single value from a range of 512 possible values, you will, for sure see it and I do see it.

    What do you think? 

    Nir.

  • Hi Nir,

    Does this actually mean that each led can have only 512 GS values and not 65,536?

    No. Each output channel can have 65536 brightness steps. 

    Best Regards,

    Steven