SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By andrewl0
#114552
Couple of questions:
I've recently purchased two of the latest versions of this LED backpack (RGBSerialMatrixBackPack_UG_090420), and I'm having problems with daisy chaining from an Arduino Uno..

1. Both boards display the following colors upon booting in the lower left hand corner of the backpack: RRGGBB. From reading around on the net I understand that the second backpack in the daisy chain should identify itself as second in the chain by displaying a different pattern of colors in the lower left hand corner when booting. Is this correct? If so do I need to upgrade to a new version of the board firmware and if so where can I find that firmware?

2. Does anyone have a simple Arduino Sketch that utilizes a daisy chained series of these backpacks?

Many thanks!
By coyote20000
#114557
Going by memory, with my older version matrix's, if they are set to standalone, they display [R][G]. For a chain of two matrix's, you program both with %2. They should display, [black][R][G]. The [Black] space indicating it's programmed for a chain of 2.
[Black][Black][R][G] for a chain of 3 and so on...

If you can't find example code, let me know. I'll look in my archive and see if I have anything looming about on my HD.

Dave
By andrewl0
#114577
coyote20000 wrote:Going by memory, with my older version matrix's, if they are set to standalone, they display [R][G]. For a chain of two matrix's, you program both with %2. They should display, [black][R][G]. The [Black] space indicating it's programmed for a chain of 2.
[Black][Black][R][G] for a chain of 3 and so on...

If you can't find example code, let me know. I'll look in my archive and see if I have anything looming about on my HD.

Dave


Thanks Dave, I was confused with regards to how to get the latest version of the firmware configured after reading a bunch of threads regarding the old firmware.

After looking at the latest data sheet, I've figured out how to set my two LED boards into the appropriate mode. The Arduino sketch follows if anyone else is interested:

Code: Select all
// Pin definitions for UNO 
// If you have a different board, check its datasheet SPI
// documentation for the correct pins.
#define PIN_SCK  13
#define PIN_MISO 12
#define PIN_MOSI 11
#define PIN_SS   10

// Send a single byte via SPI, taken from Atmel's datasheet example.
void sendChar(char cData){
  SPDR = cData;
  while(!(SPSR&(1<<SPIF)));
}

void setup(){
  // SPI communication setup. Please refer to Atmel's datasheets
  // to understand all this. Basically it sets up the Arduino as
  // master and configure the appropriate clock speed.

  // Configuration register
  SPCR=(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0);
  // Status register
  SPSR = SPSR & B11111110;

  // setup pins
  pinMode(PIN_SCK, OUTPUT);
  digitalWrite(PIN_SCK, LOW); // ensure clock low
  pinMode(PIN_MOSI, OUTPUT);
  pinMode(PIN_SS, OUTPUT);
  digitalWrite(PIN_SS, HIGH); // de-assert SS
  delayMicroseconds(500); // delay as the LED Matrix datasheet's recommends

  // This section reconfigures the board the boards to a daisy chain of 2
  // operation.
  // This can be confirmed by an RRGGBB pattern beginning at a
  // corner, with one black LEDs before the first LED, when the
  // matrix is powered on.
  // Warning: this will take effect only after first run, power
  // off and power on!
  // Also you have run this sketch with a single RGB board attached to your Arduino, 
  // and program all the boards individually prior to daisy chaining them.
 
  digitalWrite(PIN_SS, LOW);
  delayMicroseconds(500);
  sendChar('%');
  // The next line sets the number of boards in the daisy chain to 2 units.  For 3 units the next line would read: sendChar(3)
  sendChar(2); 
  digitalWrite(PIN_SS, HIGH);
  delayMicroseconds(10);
}

void loop(){
}  
Now onto fun scrolling projects!!
By ScottH
#114584
So my recently purchased Serial RGB shows [black][red][red][green][green][blue][blue][black] on startup and for some reason no longer shows the happy face. Perhaps this is why I'm having trouble with skipped frames. I guess I'll re-flash it.

-Scott
By coyote20000
#114604
Scott, yes, I think that's right, the colors are doubled. [r][r][g][g]. I think the [black] means its set to a 2 chain.

I think I shall break out my matrix's and try the new firmware. :D