cancel
Showing results for 
Search instead for 
Did you mean: 

WS2812B sporadic wrong color - DMA issue or?

KKjel.1
Associate III

I have a custom designed board using a single WS2812B RGB LED.

I use the DMA to control, just as "all" examples and drivers use it.

Fairly simple, and it works as a charm.

99% of the time...

Symptom:

Once in while, it starts to show a wrong color.

Fx. if I want to blink 3 times yellow, it may show 1*white + 2*yellow. Or other variations.

Green sometimes get cyan-like.

Red may also show as white.

More rare: OFF shows as green.

The wrong color is not completely random: It is most often white (-ish), or it is the wanted color but in a brighter version.

The LED can work OK for hours, and suddenly fails for a couple of minutes. Then OK again.

Tests performed:

Checked with oscilloscope: The timing is spot-on, and the control signal is sharp and OK.

Debugged code = OK

Hardware/Software

STM32H730

WS2812B is driven and controlled directly form 3V3 supply and MCU pins

Also running other timer interrupts. Running FreeRTOS.

Possible causes:

I am running out of ideas where to search for the problem.

I have searched everywhere for similar problems, but can't find any.

Do you have any ideas in which direction I should go?

- Timing ?

- Supply voltage ?

- Or ?

Thanks in advance !

28 REPLIES 28
AScha.3
Chief II

Just guessing: DMA is not your problem, maybe just the signal ->

H730 is really fast switching, so try: set port/pin speed to low , if not perfect then,  then try with a series resistor cpu/pin -> 100 ohms -> WS..../data line ; and check good solder contact to GND plane -> WS.../gnd line .

If you feel a post has answered your question, please click "Accept as Solution".

Fast response, thanks 🙂

When I use DMA, I have limited possibilities to set the port pin config: Both speed and drive strength is not available in CubeMX when the pin is not a generic GPIO port pin.

 

I will check and test with the limiting resistor.

Hey, DMA or not - you still use the pins and this you can set !

ie. here dma -> spi -> GPIO pins

AScha3_0-1704312834153.png

 

If you feel a post has answered your question, please click "Accept as Solution".

How close is the signalling voltage to the 3V3 rail?  I've seen cases where if it's "too close" there can be occasional "flashes" of unintended colors, even if the bitstream timing is in spec.

Hey. 

Yes, you are right. When used with the DMA/PWM, the port pin disappears from the normal GPIO list.

But I can see it's in the TIM section (of course).

The speed is set to low already:

KKjel1_1-1704316254790.png

 

 

 

 

I checked with oscilloscope several weeks ago, so I don't remember exactly.

But I checked that the signal was close to 3V3, to make sure that this was not the problem.

It sounds strange if it could be the problem?

I guess it's quite common to drive the device with the same voltage as the control signal, so it sounds crazy if it's necessary to force them to not be the same ?

So: you drive signal from cpu pin , 0/3v3 level ?

And supply for WSxx led ? also 3v3 ?

If you feel a post has answered your question, please click "Accept as Solution".

Just as an experiment try reducing the signalling voltage some.

> I use the DMA to control, just as "all" examples and drivers use it.

What does this mean, exactly?

DMA "copies" an array from RAM to some timer register(s), I presume? If so, how do you prevent your program from writing into the array while it's being "transmitted"?

JW