Go Down

Topic: WS2803 versus WS2801 (Read 17 times) previous topic - next topic

CrossRoads

The outputs change state 500uS after the data stops changing. I would guess 500uS is allowed to lapse in one situation and not the other.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

KirAsh4

I think you're right there CR.  What I'm noticing with FastSPI is when the code is first uploaded, only one group of 3 output pins will come on.  If I hit reset, the second group comes on, hit reset again and the next comes on ... so it takes hitting the reset button 6 times to get all the outputs on.    Now granted, FastSPI only has support for the WS2801 and not the WS2803 ... so I would expect some sort of oddity to happen ... like constantly hitting reset. :)

KirAsh4

The next question is trying to figure out how to address individual outputs.  With Adafruit's WS2801 library, it turns the outputs on in groups of 6.  So if I send it Color(r, g, b) with r=255, g and b=0, I get ouputs 0, 3, 6, 9, 12, and 15 turned on.  If I send r=0, g=255, and b=0, the next set of outputs come on, 1, 4, 7, 10, and 16.  And with b=255, r and g=0, the last set comes on, 2, 5, 8, 11, and 17.

I think it's possible to address each one separately, it's figuring out how to change the library to do that.

CrossRoads

You have a bunch connected in series, yes?
So if you don't want to change, I would think you'd want to send it the same data again.

So end out out chips worth of data every time, and just change the ones you want to change.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

KirAsh4

Nope, just a single one (for now.)  One WS2803 with 18 output ports.  Using the current WS2801 method to send data to it, lights up the 18 ports in groups of 6, and I figured out why.

I worked out one work around for now.  Because the WS2801 library only sends out 24 bits, and WS2803 accepts 144 bits before it starts relaying, it made sense that when the code was sending data, the IC was simply waiting till it received 144 bits and then latched the data.  I just never noticed it because there was no delay.  So, what I did was the following:
Code: [Select]
  for (int i = 0; i < 6; i++) {
    switch (i) {
      case 0:
        strip.setPixelColor(i, Color(255, 0, 0));
        break;
      case 1:
        strip.setPixelColor(i, Color(0, 255, 0));
        break;
      case 2:
        strip.setPixelColor(i, Color(0, 0, 255));
        break;
      case 3:
        strip.setPixelColor(i, Color(255, 255, 0));
        break;
      case 4:
        strip.setPixelColor(i, Color(255, 0, 255));
        break;
      case 5:
        strip.setPixelColor(i, Color(0, 255, 255));
        break;
    }
    strip.show();
    delay(250);
  }


By grouping the ports in groups of 3 (R, G, B), I can then refer to them with index numbers 0 to 5.  So when I sent Color(255, 0, 0), I was addressing the first group of 3 ports, setting out0 to 255, out1 to 0, and out2 as 0.  This effectively turned on the first of the three ports.  Sending Color(255, 0, 255) turned on ports 0 and 2 .... etc., etc.

Following the above, I'm turning on ports 0, delay, 4, delay, 8, delay, 9, 10, delay, 12, 14, delay, 16, and 17 successively.  The rest are all off.

Like I said, this is a work around.

Go Up