MAX7219 in daisy chain. How many decop capacitors I need?

Grab the LedControl library Arduino Playground - HomePage if you don't already have it
and try the scrolling demo attached. It's written for a single 8x8 matrix running on an UNO but should work on upto a 24x8 matrix with little alteration. As it uses the LedControl library it bitbangs instead of using the SPI interface.

ScrollTest4MAX.ino (14.2 KB)

Heres my latest update:

so I have cascaded them now...data out from 1st max7219 -> data in to next one....and so on for 4 of them to control the 32 x 8 (4 matrices..)

Its a tight enclosure...I fixed numerous issues...

I had the Rset on the 2nd max7219 on pin 17 not 18......fixed that..so the 2nd Matrix is ok now.....I was about to replace the chip too, but I saw that right at the end....

heres my code working in the enclosure... (Attached)

the problem with the LedControl Library is 1.0.1 doesn't support it, even when I exclude SPI...so which IDE version do you have?

The only other thing that is bothering me ..well two things actually...

so the matrices don't scroll across each other, they just all show the same letter as each individual matrix scrolls...

AND The letters are Backwards.....and before you think anything there, I already swapped the wires around thinking it was wired in backwards, but that made it worse.....

Latest_Box_Working_somewhat.ino (65.3 KB)

Riva:
I'm worried your idea will run into problems as you cannot sync the scanning between the MAX7219 chips. I foolishly think the below may be betterwork as your not connecting between driver chips. I only drew one led as I'm meant to me working.

Oh right, diodes! I didn't think of that, thanks!
This is getting a way too complex for me. I'll never be able to tone transfer something like this :frowning: About ready to give up on the idea....

oooohh PCB in Eagle is Tough...we're trying to make a board on a board machine and I hate the traces in the rats nest...

does anyone have an idea about why the scroll letters would be backwards?

i had a garbage LedControl Library...I deleted it and downloaded / extracted the other one...so I think I may be in business now....

Aaron_dyer:
i had a garbage LedControl Library...I deleted it and downloaded / extracted the other one...so I think I may be in business now....

I was in the process of zipping and uploading my LedControl library as it works fine on 1.0.1. I won't bother now as you have got it working.

As to the text being backwards that's probably down to either wrongly defined font matrix or wiring I'm afraid.

Aaron_dyer:
i had a garbage LedControl Library...I deleted it and downloaded / extracted the other one...so I think I may be in business now....

Yeah I had same issue. There's outdated library out there. New one works fine with 1.0.1 and has some nice examples too. Thanks for hijacking my thread btw :roll_eyes:

"does anyone have an idea about why the scroll letters would be backwards? "
Easy to fix: change these to count from 8 to 1 instead of 1 to 8:

    digitRegister = 0x01;  // digit0, up to 0x08 for digit7
    digitalWrite (ss3, LOW);
    for (x = displayStart; x<(displayStart +8); x=x+1){  
      SPI.transfer (digitRegister);
      SPI.transfer(displayArray[x]);
      digitRegister = digitRegister+1;
    }
    digitalWrite (ss3, HIGH);

Here's how I did it:

  //Serial.print ("digit 0: ");
  startX = displayStart + 7;
  endX = displayStart-1;
  digitRegister = 0x01;  // digit0, up to 0x08 for digit7
  for (x = startX; x>endX; x=x-1){  
    digitalWrite (ss0, LOW);
    SPI.transfer (digitRegister);
    SPI.transfer(displayArray[x]);
    digitalWrite (ss0, HIGH);
    /*
    Serial.print (" R");
    Serial.print (digitRegister);
    Serial.print (" ");
    Serial.print (displayArray[x],HEX);
    */
    digitRegister = digitRegister+1;
  }
  //Serial.println(";");

  // next digit
  //Serial.print ("digit 1: ");
  startX = displayStart + 15;
  endX = displayStart + 7 ;
  digitRegister = 0x01;  // digit0, up to 0x08 for digit7
  for (x = startX; x>endX; x=x-1){  
    digitalWrite (ss1, LOW);
    SPI.transfer (digitRegister);
    SPI.transfer(displayArray[x]);
    digitalWrite (ss1, HIGH);
    /*
    Serial.print (" R");
    Serial.print (digitRegister);
    Serial.print (" ");
    Serial.print (displayArray[x],HEX);
    */
    digitRegister = digitRegister+1;
  }
  //Serial.println(";");

  // next digit
  //Serial.print ("digit 2: ");
  startX = displayStart + 23;
  endX = displayStart + 15;
  digitRegister = 0x01;  // digit0, up to 0x80 for digit7
  for (x = startX; x>endX; x=x-1){  
    digitalWrite (ss2, LOW);
    SPI.transfer (digitRegister);
    SPI.transfer (displayArray[x]);
    digitalWrite (ss2, HIGH);
    /*
    Serial.print (" R");
    Serial.print (digitRegister);
    Serial.print (" ");
    Serial.print (displayArray[x],HEX);
    */
    digitRegister = digitRegister+1;
  }
  //Serial.println(";");

  // next digit
  //Serial.print ("digit 3: ");
  startX = displayStart + 31;
  endX = displayStart +23;
  digitRegister = 0x01;  // digit0, up to 0x80 for digit7
  for (x = startX; x>endX; x=x-1){  
    digitalWrite (ss3, LOW);
    SPI.transfer (digitRegister);
    SPI.transfer(displayArray[x]);
    digitalWrite (ss3, HIGH);
    /*
    Serial.print (" R");
    Serial.print (digitRegister);
    Serial.print (" ");
    Serial.print (displayArray[x], HEX);
    */
    digitRegister = digitRegister+1;
  }

I'll def. Try to fix some code tomorrow......ans the wiring is def. Good...I swapped wiring on a matrix earlier and it was all jacked up......in my string right now I have each matrix displaying the same letter as it scrolls and so letters aren't backwards, I had the string "MAXIMUM" because those letters backwards or not its the same. But like I said, all matrices say M and then all say A and so on.

MAXIMUM :slight_smile: That's clever

Aaron_dyer:
I'll def. Try to fix some code tomorrow......ans the wiring is def. Good...I swapped wiring on a matrix earlier and it was all jacked up......in my string right now I have each matrix displaying the same letter as it scrolls and so letters aren't backwards, I had the string "MAXIMUM" because those letters backwards or not its the same. But like I said, all matrices say M and then all say A and so on.

When you altered the wiring you only need to alter the column order or row order (depending on what way the mirroring occurs) but not both.

With the wiring though, I triple checked the datasheet for the matrix and the max7219 outputs.....they were good.....

Here is a video I took of it last night....the matrices working are 2 minutes in.....you'll see what I'm talking about with each matrix displaying the same letter and not scrolling across each other...

With the wiring though, I triple checked the datasheet for the matrix and the max7219 outputs.....they were good.....

I only suggested this because I made the schoolboy error of wiring up as per instructions using a hand built LED matrix to realize when I turned the board over to the front that the columns were now backwards. Not as bad as wiring up a 28 pin Amphenol connector and discovering the shell was still on the bench.

"when I turned the board over to the front that the columns were now backwards"
But you can fix that in software - swap the bytes end for end that go to the max7219 registers:
Data intended for Register1 goes to Register8, and data for Register8 goes to Register1 instead.

CrossRoads:
"when I turned the board over to the front that the columns were now backwards"
But you can fix that in software - swap the bytes end for end that go to the max7219 registers:
Data intended for Register1 goes to Register8, and data for Register8 goes to Register1 instead.

This happened months ago. I just swapped the order of the 8 wires, only took a couple of minutes.

Riva,

I uploaded your ScrollTest4 code....

This is the run in I'm having with my mega2560.....

so for this one I have the Duemilanove running....

but the text is scrolling vertical and the letters are backwards.....

man this is so frustrating..

I'm just using 1 max7219 and 1 matrix right now......

I wire my components up via this site:

http://www.pjrc.com/teensy/td_libs_Matrix.html

My matrices say XH-1088BRW on them as well......

Aaron_dyer:
so the matrices don't scroll across each other, they just all show the same letter as each individual matrix scrolls...

I did play around with two matrices and LedControl and had this problem too. From memory (not stating fact) I had the number of devices integar set at 1 instead of 2

LedControl lc=LedControl(12,11,10,1); 12, 11 and 10 Arduino pins 1 number of Max7219.

It maybe worth checking good luck Pedro.

Aaron_dyer:
I wire my components up via this site:
Matrix & Sprite Arduino Libraries, for a many-LED display!

Ah, I understand now, I though you had it all wired up using this article Arduino Playground - MAX72XXHardware but it turns out it's not.
The matrix is wired slightly different in each article so the code I suggested is no use to you. Also the pjrc version has the matrix rotated 90 degrees so this accounts for the letters scrolling the wrong way. I'm not sure why the letters would be backwards but as Crossroads points out this can easily be fixed by reversing the retrieval order of the matrix data. Now the only thing I can suggest for each matrix showing the same letter is you have them cascaded backwards. Looking from the front of your 4x matrix blocks the arduino should be connected to the right hand device (DIN, CLK & LOAD) and that MAX7219 DOUT should be connected to DIN on the MAX7219 to it's left and so on.

EDIT: Just noticed this in the pjrc article.

Beware, the Matrix library wants Teensy to connect to the last chip, and the DOUT-to-DIN chain connects from right to left. That seems backwards, but if you wire Teensy to DIN on the left-most chip as might seem intuitive, your display will end up with groups of 8 instead of one nice, continuous X-axis coordinates.

The pjrc wiring is fairly common: you send most significant byte (left most digit) first.