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

Thread: Teensy 3.2 & Octows2811 - rotary encoder causes first LED in each channel to flicker

  1. #1

    Teensy 3.2 & Octows2811 - rotary encoder causes first LED in each channel to flicker

    I have a project with a Teensy 3.2 and Ocotows2811 that uses all 8 channels. Each channel contains between 72 and 86 WS2812B LEDs and my code uses FastLED v3.4.0 to control them. It has all been working well until I connected a rotary encoder to pins 24/25/32 underneath the Teensy. The encoder's clock pin is attached to Teensy pin 32, the data pin is attached to Teensy pin 25. The encoder also has a button attached to pin 24.

    When the encoder is physically connected I've noticed that the first LED in each channel sometimes flickers green at what appears to be full brightness. Some of the LEDs at the start of the 8 channels flicker more often than others, but they all do it intermittently - anything from a few times a second, to every several seconds, with no discernable pattern. Each "flicker" is for the duration of one call to the next (i.e. sometimes makes the first LED turn bright green; that LED stays green until is called again, at which point the LED behaves normally again for a while). It is always the first LED. Sometimes the problem affects all channels simultaneously but usually just one or some of them at a time. No other LEDs are affected, the rest all behave as I expect them to.

    I have tried cutting my code down to a completely trival sketch (just light LEDs one at a time in order, no encoder-related code or anything else) but the green flickering still happens as long as the encoder is physically connected. If I physically unplug the encoder (but the connecting jumper wires are still attached to the Teensy pins 24, 25 and 32) the problem disappears.

    I desoldered and resoldered the wires on pins 24/25/32 in case there was a bad connection but that made no difference. I checked the behaviour of the encoder with a multimeter and it seems to be fine. I've tried the encoder with both 3.3V and 5V but that made no difference.

    As far as power goes, I have two battery packs each with dual 5V/3A USB-A outputs, so four power outputs in total that each power two channels of LEDs. The Teensy is powered separately, either by its micro USB port or via the Octows2811 5V input. The flickering happens regardless of which way the Teensy is receiving its power. The 8 channels connect to the Octows8211 via two Cat6 cables and the grounds from the USB cables are connected with the Cat6 grounds, as recommended on the octo28 web page. All cables are around 50cm to 1m long.

    Before I go down too many rabbit holes trying to figure out what is causing this problem, does anyone have any pointers that could help me narrow it down? Is there some reason I should be using different pins?

    Many thanks!

  2. #2
    Aaaargh... just realised what the problem might be. I see here that it says "Do not use" on pin 32 for the Teensy 3.2! Not sure how I missed that, I must have scanned that page a dozen times. I'll try moving to pin 33 and see if that solves the problem, will report back what I find.

  3. #3
    Yep that was the problem, it's working perfectly now on pin 33 Sorry for the noise, hopefully this at least helps anyone else down the line who hits the same issue.

Posting Permissions

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