Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: OctoWS2811 flicker when connected via USB

  1. #1
    Junior Member
    Join Date
    Dec 2013

    OctoWS2811 flicker when connected via USB

    I've got a project that I'm working on with the OctoWS2811 library.

    This is what I have so far:

    8x WS2812B strips of 120px.
    2x 26a power supplies
    Teensy 3.0 with OctoWS2811 @ 96mhz

    I'm noticing that when I plug a laptop into the teensy that I get extra flicker on my strips. It doesn't matter much if the laptop is plugged into its own power source.

    I've cut the trace on my teensy as specified here so that the Teensy is only powered by VIN. The teensy is powered by one of the power supplies. The power supplies have their V- (grounds) joined. Also the power supplies have the same power input (L/N/E) daisy chained.

    I am assuming that USB Is sufficiently grounded on the Teensy. Is this true? Do have I have to do anything else to join the USB and Teensy Grounds?

  2. #2
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    London, uk
    I had a similar problem, that ended up being flicker only if the laptop was still plugged into the mains.
    Quote Originally Posted by mortonkopf View Post
    @sermad. I did have what seemed like random flickering on a strip of 147 leds. This only occurred when the Teensy 3 was still plugged in to the usb port of the macbook after uploading a sketch. The flickering seemed to random leds but cyclical timing. Unplugging to usb port ( I was using a separate power source) cured it. I do not know why there would be interference.

    ""Was the macbook running on battery power at the time or was it plugged in? I won't pretend to understand the complexities involved, but I quickly learned that the more grounds I added to my project, the trickier things got. ""

    Usually the grounding issues I saw were more steady or cyclical and affected the entire strip, whereas signal strength or quality issues manifested as problems with the later LEDs in the strip (past number 80 or so).

  3. #3

    I see the same problem, and it appears to be software or CPU related.

    I have a large single strip (704 LEDs, stripLen==704) with WS2812B LEDs that require >3.3V. Power and ground are connected in 8 locations along the strip; the power looks clean everywhere and doesn't droop below 4V ever. I'm using an OctoWS2811 adapter board with a Teensy 3.1, using the first output only. My code is essentially:

    void loop()
        for (int i = 0; i < STRIP_LEN; i++)
            led.setPixel(i, 0x555555);;
    When USB is connected (serial), I get pretty bad flicker, which is more likely to start later in the strip (ie. it only starts rarely around LED 100, and flickers serveral times per second around LED 500). Note that I'm not even sending anything over USB, it's just connected to the host.

    When I unplug USB, it stops.

    It also stops flickering after 10 seconds if I add this to my code:
        static Metro kill_usb(10000);
        if (metro.check())
    even with the USB cable still plugged in. So I am quite confident that this is not a grounding or other power issue.

    I've tried setting the IRQ_DMA_CH3 priority to 32 or even 0, which doesn't seem to change anything.

    For fun I removed all __disable_irq() and __enable_irq() in usb_dev.c and usb_mem.c to see if that helps anything, but it still flickers.

    The flickering is rare, but still happens, when running the strip at 400 kHz. It is much more common at 800 kHz.

    I've played with timings in OctoWS2811.cpp but that doesn't seem to help. My chips are interesting in that they always seem to retransmit with T0H=400ns, T1H=800ns, even when the first chip is receiving something different (e.g. running at 400 kHz).

    Maybe the USB hardware causes bus contention or something and messes with the DMA? Paul, any thoughts?

  4. #4
    It flickers a lot less, but still flickers, if I change the MCM_CR line in OctoWS2811.cpp to:

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Quote Originally Posted by jimparis View Post
    Paul, any thoughts?
    As always, post a complete program and all necessary details, and I'll put it on my "to investigate" list. I can't promise I'll get to it quickly, but I will not forget.

    I'm not sure if I have 704 LEDs available to connect to a long strip. But if that's what it takes to reproduce a problem, I can buy more.

  6. #6
    Thanks Paul. It turns out that this is not just caused by USB, so I started a new thread here with full code, and will follow up there.

  7. #7
    Junior Member
    Join Date
    Dec 2013
    I have uncovered a number of issues on my project. I added filter caps to my LED strips, I eliminated a couple ground loops, found a power supply that has Active PFC and am using one of Paul's OctoWS2811 adapter boards with Cat6 cable. My original Teensy 3.0 let the smoke out and I'm now using a Teensy 3.1. I believe that I was seeing a similar issue to Jim.

    I have observed issues with the data line which I detailed in this post:

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts