So great to find this forum.  I just ordered six meters of APA102 144/m

So great to find this forum. I just ordered six meters of APA102 144/m and I’m getting ready to drive them with FASTLED and Teensy 3.1 over SPI. I need a driver to convert levels from the 3.3V Teensy 3.1 to the 5V APA102 logic level, and to reduce soldering hassle I was thinking of buying a http://www.pjrc.com/store/octo28_adaptor.html OctoWS2811 adapter. As far as I can tell I could use this if instead of putting header under the SPI pins I wired them point to point to appropriate pins on the adapter. Sound right?

According to an adafruit tutorial I read, the bidirectional converters they stock don’t drive long wires as well as the 74HCT245

Hi @Tom_Morrow ​ are you trying to avoid soldering altogether?

You have a couple of options, but your thinking is correct. You do need to level shift the output of the Teensy and the Octows2811 is custom designed to sit under the teensy, a bit like an Arduino shield. Yes you could wire point to point, but the octows2811 was designed to eliminate the rats nest of wires.

If cost is a factor, then you can roll your own, and use a plain old 74HCT245 and a strip of proto/veto board. These can be picked up cheaply. There is nothing magic happening with the octows2811 just a neat form factor.

Yes, you want to use a 74HCT245 with whatever you put together. Interesting idea about that adapter. What says @PaulStoffregen ?

6 meters of APA102 yeah! That’s going to be a whole lot of fun. And power distribution. :slight_smile:

As you probably know, this adaptor was meant for 8 outputs to WS2812B. You can probably also use it for APA102, but the 8 buffers may not be connected to the same pins you want to use. The normal SPI outputs are pins 11 (MOSI) and 13 (SCK). This board doesn’t have any connections on those pins.

One idea might be to use SPI.setMOSI(7) and SPI.setCLK(14),then SPI.begin(). ((EDIT: FastSPI has this pin 7 & 14 built in, see Daniel’s comment below)) That will reconfigure the SPI hardware to output signals on pins 7 and 14, which ARE connected to outputs. Then you’d plug cable into the upper jack and use the blue & green wires, if your CAT6 cable is T568B wired (common in the USA) or blue and orange if T568A wired.

One possible gotcha is whether FastSPI can work properly if you’ve already called SPI.begin() to set up the SPI port?

The hardware inside Teensy 3.1 is certainly capable of routing the hardware SPI signals to those other pins. The audio library is usually used that way, since the I2S port needs to use pins 11 and 13 for streaming digital audio. So if there turns out to be some software limitation in FastSPI, I’m sure a little coding can get somehow get this working.

I do not personally have any APA102 LEDs for testing. If anyone does hook up APA102s this way, please ping me to confirm if it works. Assuming it does, if you’re willing to publish a blog or even just project photos with captions and hopefully a clear shot of how you actually connected the wires to a APA102 strip, I’d love to add a link to that page.

One other very minor point is this board has 8 buffers. The others are connected to pins 2, 5, 6, 8, 20 and 21. In your Arduino sketch, those other 6 pins should be configured with pinMode to either OUTPUT or INPUT_PULLUP. Or using then in INPUT mode is fine, if you connect a digital signal to that pin. It’s generally not a good practice to leave digital inputs “floating”. That board was designed with the assumption you’d use it with OctoWS2811, which makes all 8 of those pins output. This is only a minor issue, and the consequence for floating inputs is perhaps a little extra power consumed in the 74HCT245 chip, which is probably minor compared to so many LEDs. Still, it’s good practice to configure those other 6 pins so the unused inputs don’t float.

Note that FastLED on the 3.1 branch will happily use any combination of clock (13, 14) and data (7 or 11) and will use the hardware spi to drive them.

Wow, what amazing feedback. I didn’t realize the SPI pins were configurable on the Teensy 3.1. It sounds like that will be an elegant way of letting me use straight headers without any special wiring. I don’t mind a little soldering but I really hate unsoldering so I like that the OctoWS2811 has a connector to make field installation and potential swapping easy. And using CAT6 cable will be easier than twisting my own wires for the connection to the APA102s.

I have been using the OctoWS2811 quite happily to drive a load of APA102’s for a couple of projects I am working on. Just set the pins to 7 and 14 in fastled 3.1.

I just cut the end off an ethernet cable and connect the wires from that. Works like a bought one.

I used the OctoWS2811 because a. I’m lazy, b. I had some and c. it is neat.

I will dig out the relevant lines of code tonight (I’m in Oz GMT +10) and post them along with the colours of the wires to use on the ethernet cable.

Sweet! I think Paul covered the wire colors above. Since I’m new to FastLED it would be helpful to see the code, although it sounds straightforward to set those pins.

These are the relevant lines of code for the APA102s with the octoWS2811

I have added a video of the lamps I made using the APA102’s and the octoWS2811

Note that color ordwe can also be a bit different for the APA102’s so you will need to establish that as well.

#include <FastLED.h>
#define LED_PIN 7
#define CLK_PIN 14
#define COLOR_ORDER GBR
#define LED_TYPE APA102
#define NUM_LEDS 105
CRGB leds[NUM_LEDS];
void setup() {
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, LED_PIN, CLK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}

Cheers
Steve

Please note I have added a photo above with the octoWS2811 wiring shown.

Hey @Tom_Morrow , do I get it right, that it is just possible to connect ONE strip of APA102 to the OCTOWS2811-Adapter? How about to use all the 8 connected pins for FOUR strips?
I don’t really know about hardware SPI’s on the teensy, but if I get it right, there is just one hardware SPI output possible on the teensy?

I want to built a setup with a teensy + ESP8266(WIFI-Shield) to use as “slave-controllers” for bigger stripe installations with APA102, that will be controlled by a computer over WIFI. Would be great to have the possibility, to connect 4 Stripes to one “slave-controller”. Is that possible?

Cheers,
Birk.

For a bit of info on FastLED’s SPI - https://github.com/FastLED/FastLED/wiki/SPI-Hardware-or-Bit-banging

Also - you could just use FastLED’s new support for the esp8266 and skip the teensy entirely :slight_smile:

Wow, thanks for the fast reply. I’m new in the community :wink:
As I understand it, it’s just possible to use the teensy hardware SPI’s for the APA102. And since the Octo2811-Shield has no connection to pin 13&11, I can just connect one strip.
Is that right in general, or just if I want to make use of higher update rates?
Higher update rates is not important to me tight now, more the flexibility to connect more stripes to one teensy.

If I can use any pin as software SPI, I should get 4 APA102 Strips to work with the Octo2811-Shield, right? Is there a problem about this logic?

The FastLED support for esp8266 is very amazing! Hope I can get it work with my little compiling knowledge.

If you’re using the fast APA102s and your building a small to medium size project (under 300 to 500 LEDs), pretty much any board can work. For fast POV, you’ll want a fast SPI port. Otherwise, bitbanging is probably fine.

Especially on these faster boards (I clocked bitbang’d spi output on the photon at ~13mhz the other day).

Next on my list after rgbw/16-bit support is finally doing DMA based drivers for spi based chipsets on the MCUs that I can get at dma on.

(I really need a way to not need a day job for a few months :slight_smile:

thx, got it. so with bitbanging i can connect 4 APA102’s with your shield.