Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Banishing initial LED flash on startup

Status
Not open for further replies.

Hippogriff

Member
I have a PIC 16F1825 controlling a WS2812B LED ring. Circuit is USB-powered, so 5V coming in... I created the veroboard circuit with a 10uF decoupling capacitor and a common power and ground rail, then I've connected components to that.

Each time I start the circuit I get a extremely quick flash from the LED ring, before it goes into my program routine. The first thing the program does is reset the LED ring and set it to be all off (R = 0, G = 0, B = 0). So, I'm figuring that in-between power being supplied and the first few lines of code, there is this little flash of LEDs as, somehow, the LED is reacting to power being present in the circuit. It's not a very aggravating thing, I'm just wondering how I might be able to stop it happening.

The WS2812B LED ring is connected to +5V, ground and pin C3 of the PIC. Just the single pin is used to control what the LED ring is supposed to be doing... if you send nothing down C3, then the LED ring does nothing.

I might think this is bad behaviour and the LED ring shouldn't be doing anything at all until correctly told to do so... but I am also no expert in this matter, so I thought I would ask.
 
Last edited:
See what the data sheet for the LED ring says, and try it without the PIC connected - see if it still does it (it probably will).

Assuming it does?, then (still with the PIC disconnected) try it with a resistor from the control pin to ground - as when a PIC starts up all pins are set to inputs, so it's effectively floating until the PIC initialises.
 
You are completely correct. If I detach the LED ring from the circuit I've made (veroboard) and put it into an empty breadboard with just the power and ground lines connected to my bench PSU... as soon as I hit the button it does the quick flash and then goes dark. Exactly the same behaviour I see when it's in the circuit.

If that is the case... will a resistor aid me in any way... as there's no PIC in the equation now... there's just a LED ring connected to 5V and ground, flashing once... does it matter if the control pin on a PIC or even just in this simple scenario is floating?
 
The datasheet is not very focused on things like startup... it goes into more detail about the data transmission method to achieve control over it (and I've got that). I did just cram a resistor in-between the control pin and ground (not connected to anything else) and it did the same flash.
 
Yeah, still does it. Shame...

At least I know there's no simple solution that I simply didn't know about.
 
Did you try a pull-down instead of a pull-up?
 
I tried both... but only on the LED control pin... which I don't really get the point of... as the LED ring will flash as power is applied when the control pin is not connected to anything anyway. I'm not big on pull-up / pull-down resistors... most of my circuits don't have need of resistors to be honest... I've used one in this circuit for a mode select switch, but it's the first time in a while. Shall I try anything different?
 
The goal is to figure out if the LED circuit can be prevented from flashing by doing anything with its input pins in isolation from the PIC. The secondary problem is to prevent the PIC from doing anything bad as it initializes.
 
Status
Not open for further replies.

Latest threads

Back
Top