TLC4950 Blinks Unset Channels

I am having problems with the TLC4950 PWM shield from SparkFun. Occasionally it will fire all channels for one of my 50 millisecond cycles (change values as most, every 50 milliseconds).

I am using my setup to control my Christmas light display. My setup includes an Arduino UNO, the Sparkfun PWM shield, a Rugged Audio Shield to play the music, and the Arduino Wireless shield (using the micro SD card slot only, no wireless option connected).

I use the SD card to store the sequence of lights to turn on and off. The Rugged Audio Shield is mostly self contained in that I only have to tell it to start playing a song on its own SD card, and it takes care of it. The Arduino doesn't have to drive it. My lights have a cycle of 50 milliseconds (time between when lights might turn off or on). I am not doing any dimming the lights, either on or off. The flashes may occur as often as every 10 seconds (keeping in mind that I am switching states every 50 milliseconds) and appear to last for a full cycle. The time between flashes is often longer.

The flashes seem to occur at roughly the same spot in my sequence, though I have been able to change that by inserting additional delays (which makes the sequence unusable). I have observed the flashes during periods where the shield was in a steady state - meaning the light values did not change between cycles though I did resend the same data. I observed this when there was only a single channel that was on. Getting the data from the PWM shield showed what I had sent, and not what was on.

I am driving relays (both mechanical and SSRs) from the shield. It doesn't make a difference which one I am using.

Any ideas what the problem might be? Is the PWM shield defective?

Thanks for the help.

My crystal ball says you are haveing a problem with electrical noise on your signal lines.
And possibly you are using "long" where you should be using "unsigned long".

Any ideas what the problem might be?

Yes, lack of supply decoupling.

Grumpy_Mike:
Yes, lack of supply decoupling.

What is it by supply decoupling do you mean? Are you saying power supply decoupling?

Are you saying power supply decoupling?

Yes.

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I am thinking more electrical noise and not the long vs. unsigned long issue. Grumpy Mike has pointed me to his page regarding the decoupling of the power supply, so going to give that a try. I am hoping that will take care of the noise, and the random flashes.

THANKS for responses! :smiley:

Just a quick update. I tried to do some of the decoupling (filtered the power going in to the relay boards only), but that didn't help. So, out of the blue, I decided to add a second

while (Tlc.update());

after setting my values. That seems to have taken care of my problem. My guess is that I was trying to set the values on the TCL4950 too fast. (Previously adding delays seemed to have an effect, but caused the whole thing to slow down too much.) I know that it is running slower now, but still acceptably fast for my application. Thank you again to everyone that answered.