Page 1 of 1

RGB Matrix SPI bricking?

Posted: Tue Feb 15, 2011 6:43 pm
by joh
It seems the RGB Matrix can be pushed into a non-working state where a re-flash is necessary to restore functionality.

Using an Arduino as SPI master, this is my test code:
Code: Select all
void setup() {
    SPI.begin();
    SPI.setClockDivider(SPI_CLOCK_DIV64);
}

void loop() {
    digitalWrite(SS, LOW);
    for (int i = 0; i < 64; i++) {
        SPI.transfer(random(255));
    }
    digitalWrite(SS, HIGH);
    delay(500);
}
This will at first result in random colors on the LED Matrix as expected. However, after a few seconds the display will freeze up completely. Resetting it sometimes results in the "Ready State" pattern appearing (RRGGBB), but no response to any SPI data. Other times it responds to SPI data, but the rows/cols are mixed up resulting in seemingly random positions of the pixels.

At this point, a re-flash of the firmware is necessary to restore functionality.

Has any other RGB Matrix owners experienced this? If not, are you able to re-produce the problem?

I'm trying to figure out if my matrix is defective and needs to be replaced, or if I'm doing something wrong...

- Johannes

Re: RGB Matrix SPI bricking?

Posted: Tue Feb 15, 2011 7:00 pm
by coyote20000
Perhaps try the new firmware. If i had v4 i'd try your code and let you know the results.

Re: RGB Matrix SPI bricking?

Posted: Tue Feb 15, 2011 8:12 pm
by joh
coyote20000 wrote:Perhaps try the new firmware. If i had v4 i'd try your code and let you know the results.
I forgot to mention that I'm already using the v4 firmware...

Re: RGB Matrix SPI bricking?

Posted: Wed Feb 16, 2011 6:19 am
by coyote20000
Maybe this will help.
V5 backpack firmware attached..

From this...
http://www.sparkfun.com/tutorials/200
and this...
http://www.sparkfun.com/news/452

Enjoy.
Dave

Re: RGB Matrix SPI bricking?

Posted: Wed Feb 16, 2011 9:15 am
by joh
Ah I think I see what's happening. In some cases, random(255) will return 0x25 ('%') which causes the board to enter command mode. The next random byte received will set the number of boards...

Re: RGB Matrix SPI bricking?

Posted: Wed Feb 16, 2011 9:25 am
by coyote20000
Ahhh, yes, good catch!

Re: RGB Matrix SPI bricking?

Posted: Wed Feb 16, 2011 9:39 am
by joh
Ok, now I got it working. v5 includes a special start-of-frame command (0x26) which should be sent before each frame. Also, it seems necessary to set the number of boards at the beginning. This code works:
Code: Select all
void setup() {
    SPI.begin();
    SPI.setClockDivider(SPI_CLOCK_DIV128);
    
    //Send the command mode character
    digitalWrite(SS, LOW);
    SPI.transfer('%');
    digitalWrite(SS, HIGH);
    delay(100);
    //Configure the correct number of boards
    digitalWrite(SS, LOW);
    SPI.transfer(1);
    digitalWrite(SS, HIGH);
    delay(100);	
}

int color = RED;

void loop() {
    int i;
    
    if (color == RED)
        color = BLUE;
    else if (color == BLUE)
        color = GREEN;
    else
        color = RED;
    
    digitalWrite(SS, LOW);
    SPI.transfer(0x26); // start of frame
    for (i = 0; i < 64; i++) {
        SPI.transfer(color);
    }
    digitalWrite(SS, HIGH);
    
    delay(500);
}

Re: RGB Matrix SPI bricking?

Posted: Sun Jul 24, 2011 1:45 am
by jhmckeever
I get the following issue when trying to compile the V5 firmware in my Arduino environment (v22).
Does anyone have any suggestions?
Code: Select all
RGB_Backpack_v6.cpp: In function 'int main()':
RGB_Backpack_v6:117: error: invalid conversion from 'volatile char*' to 'char*'
RGB_Backpack_v6:117: error: initializing argument 1 of 'void parse_frame(char*)'
RGB_Backpack_v6.cpp: In function 'void fillBoardCount(char)':
RGB_Backpack_v6:340: error: invalid conversion from 'volatile char*' to 'char*'
RGB_Backpack_v6:340: error: initializing argument 1 of 'void parse_frame(char*)'
TIA - J.