Problem with FastLED and 16 way parallel output

wagne704

Member
I'm having a problem(s) that I'm not sure is software or hardware. I'm trying to use a Teensy 3.1 with FastLED 16 way parallel output.

Issue 1)
8 way parallel output works fine, but running 16 does nothing (although the onboard LED does come on). There are 14 strands of 10 LEDs each. 14*10*60 mA = 8.4 Amps. Power supply can only deliver a continuous current of 6 amps but even FastLED.setBrightness() at low values produces nothing. 16 way output also does not work with only the first 8 strands connected (that do work in 8 way output).

Issue 2)
The Teensy will not run any sketches if power cycled. The project is intended to be wearable, and has a battery connected to a power supply producing 5V 6A (Polulu). If I do not leave the battery connected to the Teensy while uploading a sketch, the Teensy will not run. So if the battery is ever removed and reinserted, the Teensy does not run.

At this point my best guess is that there is a (non-fatal) problem with the Teensy, but I'm not sure where to look.

Crossposted to the FastLED G+ community https://plus.google.com/105285457004951932723/posts/ELNeSrD2VJH
 
Last edited:
Issue 1
What happens if you connect only 10 strands of LEDs. Do they work?
I'm trying to determine if this is a software or hardware issue and that would either make or break your power supply hypothesis

Issue 2)
Can you post your source code for us to examine? It could be any number of things that are causing your issues with booting. Perhaps try blinking the LED pin in your program and see if that still occurs when you reinsert the battery
 
Issue 1)
Issue 1
What happens if you connect only 10 strands of LEDs. Do they work?
I'm trying to determine if this is a software or hardware issue and that would either make or break your power supply hypothesis

Even connecting only 8 strands but running in 16 way output does not work, but 8 strands with 8 way output does work. Same 8 strands both times. Port D for 8 way, or the first 8 of Port DC for 16 way.

Issue 2)
Sorry I should have clarified: only when running a sketch in parallel output mode produces this problem. The Teensy can power cycle fine when simply using a single data output. However, ANY parallel output mode (including FastLED demos) do not allow for power cycling.
 
It's literally just the FastLED parallel output demo

Code:
#include<FastLED.h>

#define NUM_LEDS_PER_STRIP 10
// Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
#define NUM_STRIPS 8

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

// Pin layouts on the teensy 3/3.1:
// WS2811_PORTD: 2,14,7,8,6,20,21,5
// WS2811_PORTC: 15,22,23,9,10,13,11,12,28,27,29,30 (these last 4 are pads on the bottom of the teensy)
// WS2811_PORTDC: 2,14,7,8,6,20,21,5,15,22,23,9,10,13,11,12 - 16 way parallel
//
// Pin layouts on the due
// WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)
// WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)
// WS2811_PORTD: 25,26,27,28,14,15,29,11
//

void setup() {
  // LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  // LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  // LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
  LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  LEDS.setBrightness(32);
}

void loop() {
  static uint8_t hue = 0;
  for(int i = 0; i < NUM_STRIPS; i++) {
    for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
      leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);
    }
  }

  // Set the first n leds on each strip to show which strip it is
  for(int i = 0; i < NUM_STRIPS; i++) {
    for(int j = 0; j <= i; j++) {
      leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
    }
  }

  hue++;

  LEDS.show();
  LEDS.delay(10);
}
 
First, I recommend uploading File > Examples > 01.Basics > Blink, just to verify if your Teensy is able to run a simple program automatically at powerup.
 
It's possible there's something off with the 16-way code, it's been a while since i've tested it (most of my setups are happy with 8-way). In the meantime, you can do something like:

Code:
#define NUM_STRIPS 16
...
LEDS.addLeds<WS2811_PORTD,NUM_STRIPS/2>(leds, NUM_LEDS_PER_STRIP);
LEDS.addLeds<WS2811_PORTC,NUM_STRIPS/2>(leds + (NUM_LEDS_PER_STRIP * (NUM_STRIPS/2)), NUM_LEDS_PER_STRIP);
...
[CODE]

to use two 8-way parallel outputs.

For the startup problem - I have found problems with diving into pushing out led data "too soon" (I don't know why, or what's going on, but have found that a delay(1000) in setup is enough to solve the problems for me).
 
Solved flickering problem after weeks of debugging!

Hi, I just wanted to posthumously thank Daniel for posting this. I'm rebuilding the lights for my art car this year (rewiring everything, moving the wiring inside of the frame of the artcar, moving to 12v lights, building a new simpler control panel). I got everything working, but was plagued with erratic flickering. At first I assumed it was a grounding issue, but after rechecking all of my wiring, rebuilding my controller boards and eliminating almost all of my code I found this suggestion which fixed it. I'm using a teensy 3.2 (since that's how I built it years ago) so this might not be useful for you all, but it saved my summer. I grew up before the internet and having forums like this one completely transformed my ability to make progress.

Thanks Paul!


It's possible there's something off with the 16-way code, it's been a while since i've tested it (most of my setups are happy with 8-way). In the meantime, you can do something like:

Code:
#define NUM_STRIPS 16
...
LEDS.addLeds<WS2811_PORTD,NUM_STRIPS/2>(leds, NUM_LEDS_PER_STRIP);
LEDS.addLeds<WS2811_PORTC,NUM_STRIPS/2>(leds + (NUM_LEDS_PER_STRIP * (NUM_STRIPS/2)), NUM_LEDS_PER_STRIP);
...
[CODE]

to use two 8-way parallel outputs.

For the startup problem - I have found problems with diving into pushing out led data "too soon" (I don't know why, or what's going on, but have found that a delay(1000) in setup is enough to solve the problems for me).[/QUOTE]
 
Back
Top