I’m having trouble getting started with FastLED and would appreciate someone checking over what I’m doing. I was able to test my Ray Wu Aliexpress APA102 strips through Teensy 3.1 and Octo board with the Adafruit Dotstar strand test code and everything worked fine. But using the same hardware and pins I get this with my first attempt at FastLED. It seems like some sort of corruption of the data. The strand should be all one color at any time. Here’s the code I’m running:
Try setting the rate lower like so and see if it makes any difference.
FastLED.addLeds<APA102, LED_PIN, CLK_PIN, COLOR_ORDER, DATA_RATE_MHZ(12)>(leds, NUM_LEDS);
I suppose I’ll try and get the wiring a bit nicer; right now the clock and data pins go through about 18" of two non twisted jumper wires with press-on connections; I wonder if a shorter soldered connection is important at these data rates?
And perhaps put a 1k resistor to ground at the end of the strand on the data and clock pins. It seems like there is more corruption toward the end of the strand than the beginning. The end is closer to the camera in the video.
Do you get errors if you set your NUM_LEDS to something like 50? Do you have a resistor on the data line by the first pixel?
Soldered connections can’t hurt!
I’d also grab the newer 3.1 branch of the library from github and see if that changes anything. There are a lot of small bug fixes and improvements in there.
All good ideas which I will try. As far as adding resistors, I tend to see people talking about adding them on the data lines, but shouldn’t they also be just as useful on the clock lines?
As far as clock settings, do I understand correctly that the DATA_RATE_MHZ(12) that people put in the FastLED.addLeds() call is for the SPI, while there’s another setting for the Teensy speed which I can find in the Teensy documentation?
If you are using Teensyduino, you can select the Teensy clock rate when you compile your sketch. Try different ones than the default that actually overclocks to 96MHz.
Not sure it will work but it is such an easy thing to try !!
As for the resistor, the reason to have them is to limit the current into the devices when you plug/unplug strips from the controller, not to eliminate or reduce noise.
If in the process of connecting a strip to an already powered up controller, you somehow temporarily connect only the data pin, you may permanently damage that first pixel.
If you never connect your strip to a ‘live’ controller, those resistors are not required. Notice there are no resistors between devices within a strip that is because the strip can’t be plugged/unplugged in the middle of a strip.
I guess resistors are probably as useful on the clock line as with the data line.
I thought the100 ohm resistors before the strip were for impedance matching to avoid reflections distorting the signals. And the 1k resistors at the end were for the same purpose. I already have 100 ohm resistors in the Octo board, but there’s a meter or two of cat6 and a foot or so of non-twisted wire after those resistors so I think it makes sense to add the 100 ohm also near the strip itself.
I did experiment with the SPI timing again, and this time everything except the very last pixel in the strand seems to work correctly with about 8-12 mhz, and definitely with 1mhz. Seems like I’m experiencing analog gremlins so I’m going to work on the wire and resistors to get everything solid.
The PRJC folks state that the 100 ohm resistors on the OCTOWS2811 are indeed meant to match the characteristic impedance of the CAT6 cable.
My understanding is that you must also terminate with a 100 ohms resistor to complete the impedance matching for each circuit.
That means you would get a 50% voltage divider on your signal levels.
Specification of the APA 102 from GreeLED state that VIH (Input voltage high level) must be minimum 0.7 VDD !??
@PaulStoffregen could you clarify what value of resistor you recommend at the end of a strand of APA102 driven by your Octo board… Also while you are here do you advocate adding another 100 ohm resistor after a couple of meters of Cat6 cable near the strip inputs? Thanks for your graciousness.
JP Roy when you say voltage divider are you thinking of the 100 ohms being between the strip power ground and the power supply ground? I was thinking it might be better to connect the end of the strip power ground directly to power ground.
Since the signal is delayed in each pixel I don’t think it makes sense to think of 100 ohms on both ends of the data lines as a voltage divider but I could be wrong.