It’s been well known long APA102 LED strips have trouble at 24 MHz. Today I finally got around to investing why this happens.
Detailed write-up here:
https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
It’s been well known long APA102 LED strips have trouble at 24 MHz. Today I finally got around to investing why this happens.
Detailed write-up here:
https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
Paul, thank you! I’ve been wondering about this for so long. Glad to finally see some scope investigation on this.
So - if you could start out tweaking the 24Mhz clock signal so that instead of a 50/50 duty cycle on the clock, it starts out with a much shorter high - how short of a high on a 24Mhz clock can you get things to still work - then let the “natural” lengthening of the high portion of the clcok cycle play out over distance and let you get a bit further than when starting out at 50/50 – I forget, hardware SPI setups don’t let you change how the clock is pulsed, do they?
Actually - another thought, I wonder if you could have something that sits partway through a strip whose sole purpose in life is to cut the length of time at high down (e.g. something that always gates high to low after 0.02µs(ish)?
As an interesting test could that signal be run into a Teensy that does just that and sends it back out along it’s way?
Any chance that this duty cycle shift is happening due to capacitance or inductance on the output? Wonder if a strong pulldown resistor would clean it up?
Clock regen was always a losing strategy for something with a flexible clock. With a fixed frequency at least you can regen a clock signal with a one-shot.
@Daniel_Garcia Didn’t you have a matrix setup with a lot of APA102 (how many again ?) that behaved well at high data rates ?
That led me to suspect strips more than the device itself but Paul’s test would contradict this now.
I also wondered if some sort of crafty analog circuit could undo the damage to the clock signal every hundred LEDs.
@PaulStoffregen What about feeding that awesome investigation to the actual chip manufacturers and see if they would be willing to introduce something ‘on-board’ the APA102 for a new, improved version of their chip ?
@JP_Roy it’s possible the board had something other than apa102’s on it (sk68xx’s?) - I also wonder if this is something that’s caused/exacerbated by voltage drop along the strip - and that board had pretty solid power
It’s always going to drift when you buffer a clock a few hundred times, and as @PaulStoffregen suspects it may change with temperature. It will be very hard to get the rising and falling edges the same speed. Plus getting the high and low thresholds on the input pins exactly symmetric.
If the APA102 will work with a severely asymmetric clock pulse, an external circuit to regenerate a very short one-shot pulse (shorter than the max clock speed you can use) may work to delay the problem or regenerate every few hundred pixel.
@PaulStoffregen Thanks for this Paul, have you tried this with SK9822 pixels? I switched to them and have stopped having any and all issues that i had with APA102 I don’t use FastLED and mostly use hardware SPI and most of my projects are hundreds of to Thousands of pixels in length.
@JP_Roy - I do not have contact info for the company which makes the APA102. In fact, I don’t even really know which company actually makes them. If anyone does have reliable contact info, please feel free to send them the link to my blog article.
@PaulStoffregen I buy from them in batches of 14,000 and my PCBA contacts are located in the same city, will check into it
@Leon_Yuhanov - Nope, I do not have any SK9822 LEDs here for testing. But anyone with a 100 MHz or higher bandwidth oscilloscope could pretty easily redo this test. Just run any of the FastLED examples with the strip length set longer than the actual number of LEDs, and use your scope to measure the clock falling edge to data delay, and the duty cycle of the clock. Easy Peasy! (well, easy if you have a good scope and know how to use it)
@PaulStoffregen MMm I have a 100mhz scope, I will try tonight. Happy to send you a meter of SK9822 I go through hundreds of meters per year
Honestly, anything you send me will likely go unused and only end up collecting dust. Those APA102s have been sitting here for over a year. I bought them pretty much only for this test. I have many large piles of hardware sitting here, intended for detailed testing to get to the bottom of issues people face with certain libraries. Today was a rare moment of actually getting around to one of them and taking the time to write about it.
@PaulStoffregen Ok then, I wont send them to you
That’s probably best. I generally feel much better about parts collecting dust when I paid for them myself.
I new there was another reason I never gravitated to APA102’s. Thanks for the write up Paul!