Arduino Uno to Maxim7219, second chip

Hello Arduino forum,

Have bread boarded one 7219 according to

Not using seven segment display.
Using Linear display

Using the sketch copied herewith below

The first 64 LEDs work perfectly.

Installed second group of eight and the eight LEDs on the
second chip flicker in a sequence but flicker none the
less.

Have seen similar behavior when using shift registers
and the right number of register chips were not listed
in the sketch at the beginning of the sketch.

Have tried hooking up the DIN to IC2 to the DIN and the Dout
of the IC1. No luck.

Has anyone seen this behavior before?
If not any ideas on how to troubleshooting besides
checking the wiring.

I have played with it for hours and cannot figure
out what is wrong.

Thanks

Allen in Dallas

#include "LedControl.h"

LedControl lc=LedControl(12,11,10,2);

unsigned long delaytime=500;
unsigned long delaytime2=100;

void setup() {

lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,8);
/* and clear the display */
lc.clearDisplay(0);
}

void loop() {
  
lc.setLed(0,0,0,true);
    delay(delaytime2);
lc.setLed(0,0,1,true);
    delay(delaytime2);  
lc.setLed(0,0,2,true);
    delay(delaytime2);  
lc.setLed(0,0,3,true);
    delay(delaytime2);  
lc.setLed(0,0,4,true);
    delay(delaytime2);  
lc.setLed(0,0,5,true);
    delay(delaytime2);  
lc.setLed(0,0,6,true);
    delay(delaytime2);  
lc.setLed(0,0,7,true);
    delay(delaytime2);      

lc.setLed(0,0,0,false);
    delay(delaytime2);
lc.setLed(0,0,1,false);
    delay(delaytime2);  
lc.setLed(0,0,2,false);
    delay(delaytime2);   
lc.setLed(0,0,3,false);
    delay(delaytime2);   
lc.setLed(0,0,4,false);
    delay(delaytime2); 
lc.setLed(0,0,5,false);
    delay(delaytime2);   
lc.setLed(0,0,6,false);
    delay(delaytime2);   
lc.setLed(0,0,7,false);
    delay(delaytime2);
//...
//... code for the ninth thru sixty-fourth LED
//...

lc.setLed(1,0,0,true);  //65th LED, first in IC2
    delay(delaytime2);
lc.setLed(1,0,1,true);
    delay(delaytime2);  
lc.setLed(1,0,2,true);
    delay(delaytime2);  
lc.setLed(1,0,3,true);
    delay(delaytime2);  
lc.setLed(1,0,4,true);
    delay(delaytime2);  
lc.setLed(1,0,5,true);
    delay(delaytime2);  
lc.setLed(1,0,6,true);
    delay(delaytime2);  
lc.setLed(1,0,7,true);
    delay(delaytime2);      

lc.setLed(1,0,0,false);
    delay(delaytime2);
lc.setLed(1,0,1,false);
    delay(delaytime2);  
lc.setLed(1,0,2,false);
    delay(delaytime2);   
lc.setLed(1,0,3,false);
    delay(delaytime2);   
lc.setLed(1,0,4,false);
    delay(delaytime2); 
lc.setLed(1,0,5,false);
    delay(delaytime2);   
lc.setLed(1,0,6,false);
    delay(delaytime2);   
lc.setLed(1,0,7,false);
    delay(delaytime2);

}

Dunno what the library does, but it looks like you only initialize the first chip in setup()?

Also check the power supply of the second chip, the voltage may be too low or distorted by long and thin cables and weak breadboard contacts.

Hello DrDiettrich and Arduino Forum,

In the sketch, the line

LedControl lc=LedControl(12,11,10,2);

12 = DIN
11 = Clock
10 = Load
2 = number of chips

The fourth parameter to the LedControl method, 2,
is the number of chips in the daisy chain
so I believe the second chip is initialized.

"check the power supply of the second chip" Is there
a method of checking the power supply with a multimeter?

Thanks.

Allen in Dallas

Yes, just measure the voltage at the Vcc & ground pins of both max chips. They should be the same.

Also try swapping the sequence of the chips in the data flow, ie. Arduino pin-->Din of chip 2, Dout of chip 2-->Din of chip 1. Does the flickering move to a different set of LEDs?

Then try physically swapping the two chips. Which LEDs flicker now?

You never init second chip. Need to shutdown false it.

Hello INTP and the Arduino Forum,

Hooray!
I got it to work.
In the 'setup' section changed existing to

lc.shutdown(0,false);
lc.shutdown(1,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,8);

Works like a champ.

Many thanks to INTP.
I was dead in the water on getting the sixty-fifth
LED to fire.

Allen in Dallas