Teensy 4 “multiplexed” SPI w/ FastLED

Status
Not open for further replies.

DrOldies

Active member
I’m using multiple APA102 LED strips.

FastLED describes how to achieve 4 output lines with 2 SPI channels by multiplexing:
For Teensy 3.2 this works for 7, 14 and 11, 13

Code:
FastLED.addLeds<APA102, 7, 13>(leds,NUM_LEDS);
FastLED.addLeds<APA102, 7, 14>(leds,NUM_LEDS);
FastLED.addLeds<APA102, 11, 13>(leds,NUM_LEDS);
FastLED.addLeds<APA102, 11, 14>(leds,NUM_LEDS);

Testing the SPI channels I cannot get this working for either 4.0 or 4.1.

Teensy 4.0 SPI:
MOSI0, SCK0 11, 13
MOSI1, SCK1 26, 27 (on bottom)

Teensy 4.1 SPI:
MOSI0, SCK0 11, 13
MOSI1, SCK1 26, 27 (SDIO pins)
MOSI2, SCK2 43, 45 / 50, 49 (on both chips)
(I did not try the MOSI2 pins on 4.1)

While each SPI channel works singly or in pairs, when I mix the cross-mix the pairs, one or more channel locks up. For example for Teensy 4.0

11, 13 - works
11, 13 and 26, 27 – both work
11, 13 – 11, 27 – 26, 13 - 26, 27 – channels 1 and 3 have no output

Tests with several other combinations of non-SPI pins work. For example: 0, 1 – 0, 3 – 2, 1 - 2, 3

Any insights into what’s different and how I could get this working? A quick test showed that the SPI is more than 3x faster than non-SPI pins.
 
Status
Not open for further replies.
Back
Top