Summary: Hardware displays solid with Adafruit_DotStar library but displays flickering gibberish with FastLED.

Summary: Hardware displays solid with Adafruit_DotStar library but displays flickering gibberish with FastLED. Huh?

Setup is Teensy 3.2 and a APA102 strip with 28 LEDs. With FastLED I get some control of the strip pattern but lots of flickering and gibberish after the first ten LEDs or so.

I’d expect something like that to be a hardware problem, so poked around looking for issues. Power is all good. Grounds all seem connected. Scoping the DATA line shows nice square pulses; scoping CLOCK shows nasty spikes, as per pic. Looks like the Teensy is attempting to produce pulses, coz the timing and pattern looks reasonable, but these are the least square pulses I’ve ever seen. I am amazed the strips can pick up any information out of that. But I can’t find a hardware issue - this is unchanged hardware that was working previously.

However, and here’s where it gets odd, trying an equivalent program using the Adafruit_DotStar libary works fine. No problems at all. Scoping the CLOCK line shows nice square pulses, exactly as expected. The FastLED version is trying to produce pulses and failing; the Adafruit version is just fine. Huh?

So I am confused by this. Any suggestions?

FastLED code that runs but produces flickering and noise on LEDs:
https://pastebin.com/Dywuc8kd

Adafruit_DotStar code that runs fine and produces square pulses and solid LED patterns:
https://pastebin.com/gbYYdAvz

Using hardware SPI? What speed are you running them at? Tried lowering the speed?

@Jason_Coon Ah, of course.

Changed:
FastLED.addLeds<APA102, 6, 5, BGR>(leds, NUM_LEDS);
To:
FastLED.addLeds<APA102, 6, 5, BGR, DATA_RATE_MHZ(6)>(leds, NUM_LEDS);

It works just fine at 6 MHz and flickers at 7. The test strip is on the end of a metre-long cable, so I presume that’s why it’s so sensitive.

(Also, am working on getting your demo patterns onto the 180-LED hat. Thanks for sharing, your patterns look so very pretty indeed.)

@Jez_Weston yeah, I figured the DotStar library probably doesn’t even try to drive them as fast as FastLED can.

Cool, can’t wait to see it!

Also what rate is your scope collecting at? I wonder how well it would handle a 24mhz clock (which is what fastled defaults to for apa102)