I’m putting together the hardware for the next version of the Too Bright Hat. This time around it’s 430 APA102 LEDs, controlled by a Teensy 3.1 and powered by three lithium cells via a 40 Watt UBEC.
Running a test with the Adafruit DotStar library reveals that the hardware is working fine, no flickering. However,using FastLED causes flickering, as in the video.
The code is simple, no brightness control or power management. It isn’t a power issue, as it occurs when only one LED is commanded to turn on (the driver can run 200 LEDs at a single colour, although the battery Voltage sags a tad). It isn’t due to trying to update too fast (I’ve tried as slow updates as 100 ms). The flicker does flick with each update though.
Can I see your code for both the FastLED version and the adafruit dotstar version of your test? I want to run them side by side here with a scope to see what might be happening (but my suspicion is that I’m driving the clock line at a higher data rate than the adafruit library is and some wiring setups have problems with that). (Please use gist or GitHub to post them, don’t post code in g+ comments, too much mangling happens)
I think I know what might be causing bitbang’d flickering at higher clock speeds - I do some adjustment, for hardware spi, to account for the fact that above a certain CPU clock rate, the spi max clock rate stops going up, I suspect that is causing the bitbang’d output to drive way too fast when you’re at 96mhz, but I’ll have to verify it to be sure (and the problem may be less of it going too fast and more with the clock line transition timings not quite being right, but again, I want to run it on a scope and see what things actually look like).
Sorry, pasted wrong code. Here’s the DotStar code that doesn’t flicker at 96 MHz:
As for not using the hardware SPI pins, I’m using hardware that I designed before I knew about those. Still, on the staff I’m getting 2 ms updates, which looks pretty… So it’s not a big issue for me at present.
Ok - I’ll get into it with hardware later tonight or tomorrow (great timing, I set aside part of this weekend to do a bunch of checking on teensy related code/performance)