Cascading Max7219 problem

Hi All,

I'm hoping someone can point me in the right direction to get my cascaded 2nd MAX7219 chip functioning.

here's my problem.
When i cascade the 2nd chip from the first one, nothing happens :frowning:
both max7219 chips are sharing the clock and load pins and the data in on the 2nd chip is connected to the data out of the first.

I know the second chip is working correctly because if i share the same data in pin both displays show the same thing which is correct.

I'm running the sample code from the LedControl Library (see below)

Has anyone else experienced this same issue?

Thanks in advance. :slight_smile:

//We always have to include the library
#include "LedControl.h"

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn 
 pin 11 is connected to the CLK 
 pin 10 is connected to LOAD 
 ***** Please set the number of devices you have *****
 But the maximum default of 8 MAX72XX wil also work.
 */
LedControl lc=LedControl(12,11,10,2);

/* we always wait a bit between updates of the display */
unsigned long delaytime=50;

/* 
 This time we have more than one device. 
 But all of them have to be initialized 
 individually.
 */
void setup() {
  //we have already set the number of devices when we created the LedControl
  int devices=lc.getDeviceCount();
  //we have to init all devices in a loop
  for(int address=0;address<devices;address++) {
    /*The MAX72XX is in power-saving mode on startup*/
    lc.shutdown(address,false);
    /* Set the brightness to a medium values */
    lc.setIntensity(address,8);
    /* and clear the display */
    lc.clearDisplay(address);
  }
}

void loop() { 
  //read the number cascaded devices
  int devices=lc.getDeviceCount();

  //we have to init all devices in a loop
  for(int row=0;row<8;row++) {
    for(int col=0;col<8;col++) {
      for(int address=0;address<devices;address++) {
        delay(delaytime);
        lc.setLed(address,row,col,true);
        delay(delaytime);
        lc.setLed(address,row,col,false);
      }
    }
  }
}

Have you connected they data out of the 1st chip to the data in on the second chip?

sure have, see line 5 of my original post :wink:

sorry, here is another obvious, have you specified number of devices?

It's fixed :smiley:

I decided to go back to the datasheet and recheck all my wiring and it would appear that i had the load and the data in pin on the second chip swapped over. How it was still working with the datain pins shared originally i have no idea.... but!! Woo hoo :smiley:

ok, now to modify my original sketch to span my scrolling display over both 8x8 displays. ;D

thx mstadtler for giving me a kick in the butt to recheck my wiring :wink: