Teensy 4.0 OctoWS2811 example working with 120 leds/strip but not 300.

Gibbedy

Well-known member
Hello.
I've been forced to upgrade my christmas lights controller from a 3.2 because I need more than 8 channels.
I'm testing the 4.0 with octows2811 example with the only modification being adding a pin list for 14 channels and changing the memory buffers.
I have a few leds connected to pin 23 and it is working with ledsPerStrip at 120.
The problem I have is I need 300 ledsPerStrip. Channel 14/pin 23 isn't working when I change this value. (may or may not work for other pins but thats where my test lights are connected.

What am I doing wrong here. Thanks.
arduino reports:
Using library OctoWS2811 at version 1.5
Arduino 1.8.19.

Gavin.
Code:
#include <OctoWS2811.h>

const int ledsPerStrip = 120; //this works on the 5 leds I have connected to pin 23
const int ledsPerStrip = 300; //this doesn't change the state of the 5 leds I have connected to pin 23.

DMAMEM int displayMemory[ledsPerStrip*14];
int drawingMemory[ledsPerStrip*14];

const int config = WS2811_GRB | WS2811_800kHz;
uint8_t myPinList[14] = {2, 14, 7, 8, 6, 20, 21, 5,4,11,18,19,22,23};
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config,14,myPinList);

void setup() {
  leds.begin();
  leds.show();
}

#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF
#define YELLOW 0xFFFF00
#define PINK   0xFF1088
#define ORANGE 0xE05800
#define WHITE  0xFFFFFF


void loop() {
  int microsec = 2000000 / leds.numPixels();  // change them all in 2 seconds

  // uncomment for voltage controlled speed
  // millisec = analogRead(A9) / 40;

  colorWipe(RED, microsec);
  colorWipe(GREEN, microsec);
  colorWipe(BLUE, microsec);
  colorWipe(YELLOW, microsec);
  colorWipe(PINK, microsec);
  colorWipe(ORANGE, microsec);
  colorWipe(WHITE, microsec);
}

void colorWipe(int color, int wait)
{
  for (int i=0; i < leds.numPixels(); i++) {
    leds.setPixel(i, color);
    leds.show();
    delayMicroseconds(wait);
  }
}
 
At work but it looks like I’ve setup octows2811 buffers larger than needed. I’ll try a straight teensy 4 pin list example now I’ve discovered it exists and wire some lights up to all my outputs and see what’s going on between 120 and 300 pixels. Need more hours in a day.
 
I believe the logic/comments in the Teensy4_pinlist example mislead me.
I was looking for an update on my led every 2 seconds:
int microsec = 2000000 / leds.numPixels(); // change them all in 2 seconds

Which is fine at 4 strips of 120 leds because thats a delay of 4166us between all 480 pixels (2000000/480) and it takes 3600us to pump the data (24bits x120) out to 120 leds in parrallel at 800khz. That is my one led is still going to flash every 2 seconds like the example says.

But for every led you ad you increase the update time by 30us. At 300 leds per strip thats 9000us to update all the leds. With 14 strips at 300 leds I'm not going to see a color change of one light on 1 pin every 2 seconds. It takes about 35 seconds.

Gavin.
 
Back
Top