Go Down

Topic: MAX7219 in daisy chain. How many decop capacitors I need? (Read 4584 times) previous topic - next topic

Aaron_dyer

Ya I was starting to doubt myself...I have been reading this page over and over regarding cascading the max7219...

http://www.arduino.cc/playground/Main/MAX72XXHardware

Crossroads has been helping me, but I just can't get it to scroll anything on the matrices....


I think I'm going to switch up the wiring to cascade it like the playground has it...and then try to find some example code..or come up with something....

any example code reference would be great...

Just keep in mind, I'm using a Mega2560..

so SCK = 52

MOSI = 51

SS (LOAD) = 53

Riva

Grab the LedControl library http://arduino.cc/playground/uploads/Main/LedControl.zip 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.

Aaron_dyer

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.....


bratan


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 :( About ready to give up on the idea....
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

Aaron_dyer

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?

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....

Riva


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.

bratan


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  :smiley-roll:
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

CrossRoads

"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:

Code: [Select]

    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:
Code: [Select]

  //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;
  }
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Riva


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.

Aaron_dyer

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...

http://www.youtube.com/watch?v=HQPnPPoyabQ

Riva

Quote
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.

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up