How to control WS281x RGB LED strip?



  • @Alexandr-Didenko
    It definitely sounds like a hardware problem.

    This is exactly what happens when the logic high output level of the 3.3V Omega2 is just at the minimum level for 5V WS2813 to be recognized.

    For testing, it might help to lower the 5V supply a tiny bit (4.9V instead of 5V, easy to try if you have a lab power supply), because this also lowers the logic high threshold of the WS2813 chips a bit.

    A logic level converter is certainly the way to go to make that reliable - but the type you chose is most certainly way too slow for the WS2813 signal. These bi-directional thingies are good for serial speeds (many offers do not properly spec, but those that do say max 28800bd). The WS281x signal is in the 1mbps range, however.

    For that you want to use a unidirectional level shifter, such as the 74AHCT125 (or its single-gate version, 74AHCT1G125). I used that one successfully for my "pixelboard", see schematics, with 200 WS2813.



  • 74AHCT1G125 litle improved situation.
    But LEDs all the same, often have chaotically color.
    Tried strip WS2813 in another packet.
    Tried another power supply.

    0_1527249566359_e96243e0-2893-490b-ae89-dc8247c0a527-image.png

    0_1527249593319_2837172b-2654-449a-b990-4a238bdcc038-image.png

    0_1527249620688_f25c0b0d-8d98-4c37-a292-3cec0dd36d2f-image.png

    1. Video https://photos.app.goo.gl/Sd31jXaUses3iPKG2


  • @Alexandr-Didenko I have no real idea why it does not work reliably in your case (it does in mine).

    To make sure the timing works ok, you can check the stats of the ledchain driver:

    root@pixelboard:~# cat /dev/ledchain1 
    Ready
    Last update: 0 repeats, last timeout=0 nS, max irq=9484 nS
    Totals: updates=99756463, overruns=0, retries=3745, errors=4, irqs=2079220056
    

    If you have a high errors number, then something (most probably another driver) is blocking IRQs too long, causing incomplete LED chain updates. Getting some retries is normal. In my example, the number seems high (3745) but that's over a uptime of 46 days, with 99 million full chain updates, so the retry rate is 0.0038%

    However, I don't see how even lots of retries/errors would cause anything else than the chain not fully updating. But not completely chaotic colors.

    So I still suspect something in the hardware. The really sharp downwards spikes seen on your scope screenshots look suspicious. I can't really make sense of these, occuring only every 5th falling edge.

    How do you power the LED strip? Direct fat wires from the LED strip to the PSU, for +5V and GND?



  • @luz thanx for support.
    New video: youtube.com/watch?v=5GpZlGmnKGs.
    I send string many times:
    echo -en '\x10\x00\x00\x10\x00\x00\x10\x00\x00' >/dev/ledchain0
    And here is chaotic colors.
    But!
    Sometimes led strip work properly.

    cat /dev/ledchain0:
    Ready
    Last update: 0 repeats, last timeout=0 nS, max irq=10575 nS
    Totals: updates=87, overruns=0, retries=0, errors=0, irqs=286
    

    0_1527529647250_ddc1f617-e21c-47e3-94fe-7b3d4c6eb667-image.png

    Strip power:
    From laboratory power supply +5V to +5V strip and to AMS1117_3.3. GND to Omega and to GND strip.
    Data wire from pwm0 (G18) to pin 2 74AHCT1G125.
    74AHCT1G125: 1 and 3 pin to GND, 5 pin to +5V, 4 pin to strip WS2813 pin DI.
    Three LEDS don't need in fat wires.



  • @luz
    in your schematics LEDCHAIN_DATA_3V connect to G46/UA_RX1.
    I connecting to pwm0 (G18).
    Does it matter?



  • @luz Thanx! WS2813 and WS2818 work!
    https://www.youtube.com/watch?v=rqpyM6vhPLA



  • @Alexandr-Didenko nice device! I assume your I/O are i2c or SPI based? If so, your hardware could run as a digitalSTROM gateway, just by running my vdcd on it. Any plans to open source your device? Or produce and sell it?

    BTW: how did you get the WS281x to work, finally?



  • @Alexandr-Didenko nice device! I assume your I/O are i2c or SPI based? If so, your hardware could run as a digitalSTROM gateway, just by running my vdcd on it. Any plans to open source your device? Or produce and sell it?



  • @luz I/O - MCP23017 - i2c. My plans - to sell it.
    I don't know what I do, that WS281x to work :)
    Honestly!
    It suddenly began to work.
    I thing that oscilloscope give interference.



  • @Alexandr-Didenko said in How to control WS281x RGB LED strip?:

    @luz I/O - MCP23017 - i2c. My plans - to sell it.

    Let me know when it becomes available :-)

    I don't know what I do, that WS281x to work :)
    Honestly!
    It suddenly began to work.

    :-)

    I think that oscilloscope give interference.

    Could be, depending on the probe. Anyway, I'm glad you have it working now!


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.