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.

  • TI Thinks Resolved

TLC5947: Unexpected BLANK pin behavior

Prodigy 30 points

Replies: 5

Views: 460

Part Number: TLC5947

I am running three chains of TLC5947 boards of this design from Adafruit (), each of which is bit banged from an Arduino Nano. After a great deal of research (including from these forums, great resource, thanks!), I have come to understand that the TLC5947 is not meant for rapid changes, so sometimes there is flickering when the LED states are changed.

With the BLANK pin disabled, two of the three chains behave better than expected as can be seen in video1. They fade from nothing to full brightness for red, blue, and green without any discernible hiccup. However, the third chain seems to behave more or less at random. When I enable the BLANK pin, all work as expected with the brief flash of all turning off.I have ordered replacement TLC59711 boards, but would appreciate any insight into this problem! If I could get these boards to behave as the two do in video1, that would be the best case scenario. Also, I realize that there are many possible variables at play here, so if there is any key information that would be helpful, please let me know.

Thank you in advance for your help.

  • Hi, Richard,

    How do you set your BLANK pin?

    If you sets BLANK always LOW, when XLAT comes, there’s a period that the channels are OFF.

    If the BLANK changes with XLAT to reset the GS counter, there’ll be no long period OFF state and the new period is updated after XLAT turns low.

    If you think this answers your question, please help to click "Resolve".

    Thanks.
    Regards,
    Kenneth

    Thanks and best regards,

    Kenneth

  • In reply to Kenneth Du:

    Thank you for the fast response!

    Here is the implementation from the library:

    void Adafruit_TLC5947::write(void) {
      // digitalWrite(_ena, HIGH);
      digitalWrite(_lat, LOW);
      // 24 channels per TLC5974
      for (int16_t c=24*numdrivers - 1; c >= 0 ; c--) {
        // 12 bits per channel, send MSB first
        for (int8_t b=11; b>=0; b--) {
          digitalWrite(_clk, LOW);
          
          if (pwmbuffer[c] & (1 << b))  
            digitalWrite(_dat, HIGH);
          else
            digitalWrite(_dat, LOW);
    
          digitalWrite(_clk, HIGH);
        }
      }
      digitalWrite(_clk, LOW);
      
      digitalWrite(_lat, HIGH);  
      digitalWrite(_lat, LOW);
      // digitalWrite(_ena, LOW);
    }
    

    As you can see on the first and last lines, I set the BLANK pin (_ena in this case) HIGH before the data is propagated and back to LOW after it is latched. Right now it is commented out, which is what causes the awesome response in 2/3 of the SPI chains but the bizarre random behavior in the other SPI chain. When the lines are uncommented, 3/3 SPI chains display the correct LED values, but with a visible blink at each transition as expected. My goal is to try to get the third SPI chain to behave like the first two which show no blinking when the LEDs transition states.

    I have tried switching the digital pins assigned to each SPI chain, thinking that it was a problem with the microcontroller, but the effect is the same.

  • In reply to Richard Hunter:

    Hi, Richard,

    Please refer to the code of driving 2 TLC5947:

    16LEDs_Ring_Code.zip

    Thanks.

    Regards,

    Kenneth

    Thanks and best regards,

    Kenneth

  • In reply to Kenneth Du:

    Hi Kenneth, sorry for my slow reply.

    Thank you for the code sample. I'm fairly new to all this, so I apologize, but I wasn't able to find the code for driving 2 TLC5947s. In main.c I noticed that the method for sending data was a bit different than what I had implemented, so I will give that a try, but I didn't see anything specific to 2 TLC5947s. It would be great if you could point me to a particular file!

    Also, I don't know that this will answer why sometimes even chained TLC5947s respond very well without any blinking when the data is being written while others behave randomly unless the LAT pin is held low. I know there are lots of possible variables, but I was wondering if you had any insight into that behavior.

    The chips are great and I would love to be able to solve this problem!

    Thanks again for your help.

  • In reply to Richard Hunter:

    Hi, Richard,

    The main.c I share is the code for driving 2 TLC5947.

    As you said, not much difference between 1 TLC5947 and 2 TLC5947.

    Just making sure that at you code for LAT below please add the code to pulse BLANK:
    digitalWrite(_lat, HIGH);
    digitalWrite(_lat, LOW);

    See the example below:
    GPIO_setOutputHighOnPin(GPIO_PORT_P5,GPIO_PIN4); //BLANK-high
    GPIO_setOutputHighOnPin(GPIO_PORT_P5,GPIO_PIN5); //XLAT-high
    __delay_cycles(6); //Twh1 XLAT high-level pulse width 6/25M=240ns
    GPIO_setOutputLowOnPin(GPIO_PORT_P5,GPIO_PIN5 ); //XLAT-low
    GPIO_setOutputLowOnPin(GPIO_PORT_P5,GPIO_PIN4 ); //BLANK-low

    Please help to click "Resolve" if the problem is solved.

    Thanks.
    Regards,
    Kenneth

    Thanks and best regards,

    Kenneth

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.