Spi2812b and SPI

Hello Guys.

I’m trying figure out what’s going on this.
I try to send data for controlling WS2812b using SPI.

So this is my research.
I’m using a chip monostable like SN74123N to receive SPI and then convert 0 and 1 frequency time, to avoid charge the process in Lepotato.

So here is the issue.
When I send the bytes over SPI timing is the issue.
As you know when WS2812 takes more than 50us ws2812 takes this as reset.

Im tested in Python using spidev library.
I’m activate using ldto spicc-spidev.

Here is the code:

Import spidev
spi = spidev.SpiDev()
spi.open(0,0)

try:
spi.max-_speed_hz = 800000
spi.mode = 0
data = b’ \x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00

spi.xfer2(data)

finally:
spi.close()

This works great.
In logic analyser shows all bits with interruption each 16bits, time of 14us.

And all leds on.

The problem comes when i loop and send to create and FX. Like pass each pixel.

I create a for loop.

I change this in code.

data =

for led in range(15)
data.append(0)
data.append(255)
data.append(0)

buffer = copy.copy(data)

spi.xfer2(buffer)
time.sleep(.5)

Here some times the time 16bits interruption takes more 50us.

and leds flickering. or change color for timing.
So this 16bits interruption is not consistent or I’m try to figure out to avoid it.

What do you think?

Well you certainly got futher than in the last discussion on this.

Controlling WS281X LEDs from Renegade? - Hardware - Libre Computer Hub

Just out of interest did you try to run the For loop with spi.open and spi.close within the loop ?

Do you have a sketch/photo of how you wired this up ? I would like to give it a try - for the fun of it and to be able to test my oscilloscope! Also were you following any particular guide ?

I do have a Pi running the Adafruit Neopixel library but my usual go to is an ESP 8266 or ESP 32 flashed with WLED for driving pixels - it’s so easy & cheap with more functionality that I will ever need !