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?