Hi. I have purchased one of the TLC5947 24 Bit PWM units to drive some RGB Leds.
I have got the code working and have found that in the RainbowCycle routine there is a noticeable flicker as the 2 2 LED's change their colors. I have tried different power supplies, and even modded the CPP library to access the ports directly. However I can still see this flicker.
Can somebody suggest how I can reduce of remove it as the rate is giving me headaches.
Many many thanks
Dave
TLC5947 Flicker
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- marcwolf
- Posts: 27
- Joined: Thu Mar 20, 2014 6:51 am
Re: TLC5947 Flicker
I've found an answer in a LED's forum.. Connect the /OE to the clock and the flicker disappears.
Hope this helps
Dave
Hope this helps
Dave
- adafruit_support_bill
- Posts: 88094
- Joined: Sat Feb 07, 2009 10:11 am
Re: TLC5947 Flicker
Thanks for posting your findings
- dzfan
- Posts: 18
- Joined: Fri Jan 06, 2012 3:12 pm
Re: TLC5947 Flicker
Does anyone know why this works? I don't understand why disabling output while the clock is high would eliminate flicker. I do appreciate the solution though.
- Panpira
- Posts: 2
- Joined: Sun Nov 30, 2014 3:34 am
Re: TLC5947 Flicker
Little correction:
Connect the /OE to the Latch!
-> no flicker by fading
why adafruit say absolutly nothing to this problem? no hint, no correction in the example...
ask me where the problem is. the solution is so easy but difficult to find. waste hours for it... grrrr to ada
Connect the /OE to the Latch!
-> no flicker by fading
why adafruit say absolutly nothing to this problem? no hint, no correction in the example...
ask me where the problem is. the solution is so easy but difficult to find. waste hours for it... grrrr to ada
- Aqualize
- Posts: 6
- Joined: Tue Dec 02, 2014 5:22 pm
Re: TLC5947 Flicker
I have this problem also, at a lost now. But I will come back with a more thorough problem description but would like to say that connecting /OE to Latch didn't help. Flickering stops but so does commands from Arduino so I can't change anything. When you wrote "connect", did you mean anything else than physically connecting the /OE pin and Lat pin (on the input side of the board, i.e. left on the pictures in the guide for it)?
- Panpira
- Posts: 2
- Joined: Sun Nov 30, 2014 3:34 am
Re: TLC5947 Flicker
ho, ho, ho aqualize,
i simply put a jumper on the outgoing side.
it works perfectly with this primitive test scetch:
#include <Adafruit_TLC5947.h>
#define NUM_TLC5974 1
#define data 4
#define clock 5
#define latch 6
Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, data, latch);
int count=1;
boolean richtung=0;
int analogPin = A0; // only a poti for fading speed
int wert=0;
void setup() {
tlc.begin();
}
void loop() {
if (count==4095 || count==0){
if(richtung==0)richtung=1;
else richtung=0;
}
tlc.setPWM(0,count);
tlc.write();
if(richtung==0)count++;
else count--;
wert = analogRead(analogPin);
delay(wert);
}
if u mail me ([email protected]) i can send u a video. soft fading and no flicker.
:-)
i simply put a jumper on the outgoing side.
it works perfectly with this primitive test scetch:
#include <Adafruit_TLC5947.h>
#define NUM_TLC5974 1
#define data 4
#define clock 5
#define latch 6
Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, data, latch);
int count=1;
boolean richtung=0;
int analogPin = A0; // only a poti for fading speed
int wert=0;
void setup() {
tlc.begin();
}
void loop() {
if (count==4095 || count==0){
if(richtung==0)richtung=1;
else richtung=0;
}
tlc.setPWM(0,count);
tlc.write();
if(richtung==0)count++;
else count--;
wert = analogRead(analogPin);
delay(wert);
}
if u mail me ([email protected]) i can send u a video. soft fading and no flicker.
:-)
- Aqualize
- Posts: 6
- Joined: Tue Dec 02, 2014 5:22 pm
Re: TLC5947 Flicker
Hi and thanks for the example code.
I switched over to an Arduino Uno R3 (genuine) and tried connecting as you have (pin 4,5,6) etc.
It works. So now I know my TLC5947 board isn't damaged. I throw my test code at it, changing pin numbers and it works, no flickering when I connect the /OE and LAT on the outgoing side. My program lits up 16 LEDs one at a time (0->4095 PWM value) and then shuts them down one at a time (4095->0) with a delay of 250ms for each.
In the weekend I have to narrow the problem down to work on my intended platform, an Arduino BANNED.
Cables I can move around but just throwing out a hook here; is there any "obvious" reason a ATmega32u4 (on the BANNED, I don't have any Leonardo or other to test with) should have problems compared to the ATmega328 of Uno R3?
On the BANNED I can see it stepping and when I shorts the /OE and LAT it freezes (but no flickering) the state. If I wait say 2 seconds and then removes it I can see that a lot of LEDs have changes state. That tells me that the program runs fine during those 2 seconds (not freezing or anything), just that it don't gets its commands out/accepted by the TLC5947.
As said, I will sit down and troubleshoot next evening or on Saturday, maybe it's something easy with the cables of my choice of pins (SDA,SCL,LAT: 4, 8, 12) that makes it misbehave.
I switched over to an Arduino Uno R3 (genuine) and tried connecting as you have (pin 4,5,6) etc.
It works. So now I know my TLC5947 board isn't damaged. I throw my test code at it, changing pin numbers and it works, no flickering when I connect the /OE and LAT on the outgoing side. My program lits up 16 LEDs one at a time (0->4095 PWM value) and then shuts them down one at a time (4095->0) with a delay of 250ms for each.
In the weekend I have to narrow the problem down to work on my intended platform, an Arduino BANNED.
Cables I can move around but just throwing out a hook here; is there any "obvious" reason a ATmega32u4 (on the BANNED, I don't have any Leonardo or other to test with) should have problems compared to the ATmega328 of Uno R3?
On the BANNED I can see it stepping and when I shorts the /OE and LAT it freezes (but no flickering) the state. If I wait say 2 seconds and then removes it I can see that a lot of LEDs have changes state. That tells me that the program runs fine during those 2 seconds (not freezing or anything), just that it don't gets its commands out/accepted by the TLC5947.
As said, I will sit down and troubleshoot next evening or on Saturday, maybe it's something easy with the cables of my choice of pins (SDA,SCL,LAT: 4, 8, 12) that makes it misbehave.
- Aqualize
- Posts: 6
- Joined: Tue Dec 02, 2014 5:22 pm
Re: TLC5947 Flicker
Just want to let you know that it works fine now. I can't explain what was the problem. I moved the BANNED to the breadboard I had connected the Uno to. Changed the target platform from Uno to BANNED in tools menu and uploaded. Works fine. No freezing.
I changed pins from 4,5,6 to 4, 8, 12 as I had before. (I've chosen those because them seems the least "valuable" in any further expansion. Interrupt, PWM etc.)
Works fine.
Moved back to breadboard where I had previously connected this and ripped out all the jumper wires and connected it again. Works. Compiled the original sketch with all the #includes I will need to the project. Works fine.
So I can only guess human error when I had connected it with the breadboard wires the first time.
I now notice a slight flicker which goes away when I connect LAT and /OE on the TLC5947. Before it was horrible.
Gonna solder the other TLC5947s I have. Hope daisy-changing won't be a problem (might have to LAT and /OE on the last one to terminate it?).
Edit:
Connecting 3 TLC5947 boards went fine.
I changed pins from 4,5,6 to 4, 8, 12 as I had before. (I've chosen those because them seems the least "valuable" in any further expansion. Interrupt, PWM etc.)
Works fine.
Moved back to breadboard where I had previously connected this and ripped out all the jumper wires and connected it again. Works. Compiled the original sketch with all the #includes I will need to the project. Works fine.
So I can only guess human error when I had connected it with the breadboard wires the first time.
I now notice a slight flicker which goes away when I connect LAT and /OE on the TLC5947. Before it was horrible.
Gonna solder the other TLC5947s I have. Hope daisy-changing won't be a problem (might have to LAT and /OE on the last one to terminate it?).
Edit:
Connecting 3 TLC5947 boards went fine.
- Aqualize
- Posts: 6
- Joined: Tue Dec 02, 2014 5:22 pm
Re: TLC5947 Flicker
I've now chained 4 TLC5947 boards together and gotten another problem. They're driving around 75 small red LEDs. Default resistor on the boards.
When increasing the PWM value with 300 for all at once (.setPWM call in a loop, then .write) they flash brighter and goes to the new PWM setting.It is so fast so I doubt I can get it on cheap video camera. If I disconnect the last two of the TLC5947:s the light seem to work okay. If I den connect the arduino to the last two it works fine. Switched the last and the first TLC5947 in the chain.
Recompiling and uploading new sketch (simple builds of the sample code) for every alteration of the number of TLC5947 connected.
The power supply I've tested is
1. Simple wallwart, but if you touch the wallwart it can cause some interference and make LEDs change intensity (I don't know enough physics to explain the cause).
2. USB Powerbank.. Found that these don't cause any interference and I found one that actually can be charged and discharged at the same time so it acts like some reservoir.
Any input on things to investigate are welcome. All boards have a 470 microFarad capacitor (if I remember the value correctly) simply soldered on. There's about 2 or 4 dm (8 or 16 inch) breadboard cables (dupont wires) connecting them. Due to the application I can't have the boards all close together. I connected the /OE and the input to the arduino and all TLC 5947:s are supplied from one source, not daisy chained (I know that electrically it is all connected in parallel in either way).
Got a picture with my crappy cell camera.
You see the Arduino BANNED and a Tosduino board (tested with both) to the center right, the TLC 5947 chained to the left and lower of them. At the top is the power distribution where I split the incoming power supply. In this instance I had connected the BANNED down to the 3rd and 4th TLC5947 boards.
When increasing the PWM value with 300 for all at once (.setPWM call in a loop, then .write) they flash brighter and goes to the new PWM setting.It is so fast so I doubt I can get it on cheap video camera. If I disconnect the last two of the TLC5947:s the light seem to work okay. If I den connect the arduino to the last two it works fine. Switched the last and the first TLC5947 in the chain.
Recompiling and uploading new sketch (simple builds of the sample code) for every alteration of the number of TLC5947 connected.
The power supply I've tested is
1. Simple wallwart, but if you touch the wallwart it can cause some interference and make LEDs change intensity (I don't know enough physics to explain the cause).
2. USB Powerbank.. Found that these don't cause any interference and I found one that actually can be charged and discharged at the same time so it acts like some reservoir.
Any input on things to investigate are welcome. All boards have a 470 microFarad capacitor (if I remember the value correctly) simply soldered on. There's about 2 or 4 dm (8 or 16 inch) breadboard cables (dupont wires) connecting them. Due to the application I can't have the boards all close together. I connected the /OE and the input to the arduino and all TLC 5947:s are supplied from one source, not daisy chained (I know that electrically it is all connected in parallel in either way).
Got a picture with my crappy cell camera.
You see the Arduino BANNED and a Tosduino board (tested with both) to the center right, the TLC 5947 chained to the left and lower of them. At the top is the power distribution where I split the incoming power supply. In this instance I had connected the BANNED down to the 3rd and 4th TLC5947 boards.
- Attachments
-
- led drivers.jpg (888.62 KiB) Viewed 1575 times
- Aqualize
- Posts: 6
- Joined: Tue Dec 02, 2014 5:22 pm
Re: TLC5947 Flicker
After reading more posts on the forum with problems for these TLC5947 daisy-chained I tested with not chaining them but connecting them separately to the BANNED and instantiating 4 objects of Adafruit_TLC5947 class.
It seems to work good, even connected to the wall wart (I had better success before with USB power banks).
I left it overnight with max brightness on all LEDs (set in the setup () method so loop () is empty). Hopefully every LED will be the same max brightness when I come back tomorrow.
It's a pity that daisy-chaining doesn't work good but I need to get the project moving and currently the only other thing that will be connected is TSL2561 Light sensor via I2C. So I need 14 ports (0-13) but I could also use some of the "analog" ports (the function as digital).
Having 4 Adafruit_TLC5947 objects is cumbersome so I will rewrite it to handle the different "channels" under the hood and some utility functions.
It seems to work good, even connected to the wall wart (I had better success before with USB power banks).
I left it overnight with max brightness on all LEDs (set in the setup () method so loop () is empty). Hopefully every LED will be the same max brightness when I come back tomorrow.
It's a pity that daisy-chaining doesn't work good but I need to get the project moving and currently the only other thing that will be connected is TSL2561 Light sensor via I2C. So I need 14 ports (0-13) but I could also use some of the "analog" ports (the function as digital).
Having 4 Adafruit_TLC5947 objects is cumbersome so I will rewrite it to handle the different "channels" under the hood and some utility functions.
- clfaye
- Posts: 18
- Joined: Mon Sep 30, 2013 5:45 pm
Re: TLC5947 Flicker
Thanks you guys so much. I had the terrible flicker as well and connecting the /OE to the latch solved it immediately. Getting to where I am on my project has taken forever, and the flicker was very discouraging. Now I can get going again!
Adafruit - Why is this not noted in the learning materials? It seems really important.
Adafruit - Why is this not noted in the learning materials? It seems really important.
- J0hnny5
- Posts: 4
- Joined: Fri May 18, 2018 3:08 pm
Re: TLC5947 Flicker
This also worked for me. I found similar info from TI's forums here. The pins on the chip TLC5947 are XLAT (latch), pin 30, and BLANK ( /OE), pin 2.Panpira wrote:Little correction:
Connect the /OE to the Latch!
-> no flicker by fading
The solution is so easy but difficult to find. waste hours for it... grrrr to ada
I agree this should be implemented on the ADA1429 dev board or at least put in the instructions. Thanks everyone for the info.
Please be positive and constructive with your questions and comments.