Go Down

Topic: Scrolling text on LED matrices using SPI and arduino Mega2560 (Read 8 times) previous topic - next topic

CrossRoads

Where are the 0.1uF and 1uF (or 10uF) caps on the VCC pin of each device?
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.

Aaron_dyer

Oh yes, I did include a 10 u F and 100 nF on the Vcc line for the first Max7219.....are you saying each chip would need this?

Aaron_dyer

I totally got rid of all the LEDs and LCD commands...I pretty much used your code and just changed ss0-ss3 to the pinouts for the Mega.....

When I open the serial monitor now....the 3rd and 4th matrices blink some but nothing accurate yet....

here is the code I'm using now....

Aaron_dyer

Attached is a picture of my project is you're curious.....

Everything works how I would like it to except the matrices.....They are blinking erratically at times...or steady on....etc.

CrossRoads

Enclosure looks nice!  Better than my PCB with Duemilanove cable-tied to it.

Yes, you need caps for each device. 0.1uF keeps high frequency noise,  10uF acts as local current buffer for the large currents being switched on/off.

Looks like you have slightly old code.  See if this helps

byte display_test = 0x0D;           This needs to be 0x0F,

byte displayArray[192] = { }; // 192 bytes

These need to be written with 0x07:
Code: [Select]

  // scan limit to all 7 columns
  digitalWrite (ss0, LOW);
  SPI.transfer (scan_limit);
  SPI.transfer (0x08);
  digitalWrite (ss0, HIGH);
  digitalWrite (ss1, LOW);
  SPI.transfer (scan_limit);
  SPI.transfer (0x08);
  digitalWrite (ss1, HIGH);
  digitalWrite (ss2, LOW);
  SPI.transfer (scan_limit);
  SPI.transfer (0x08);
  digitalWrite (ss2, HIGH);
  digitalWrite (ss3, LOW);
  SPI.transfer (scan_limit);
  SPI.transfer (0x08);
  digitalWrite (ss3, HIGH);


these need to be written with 0x01 for Normal mode (vs shutdown)
Code: [Select]

  // dispay test to normal
  digitalWrite (ss0, LOW);
  SPI.transfer (display_test);
  SPI.transfer (0x00);
  digitalWrite (ss0, HIGH);
  digitalWrite (ss1, LOW);
  SPI.transfer (display_test);
  SPI.transfer (0x00);
  digitalWrite (ss1, HIGH);
  digitalWrite (ss2, LOW);
  SPI.transfer (display_test);
  SPI.transfer (0x00);
  digitalWrite (ss2, HIGH);
  digitalWrite (ss3, LOW);
  SPI.transfer (display_test);
  SPI.transfer (0x00);
  digitalWrite (ss3, HIGH);


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.

Go Up