Arduino and Max 7219 to control 256 LEDs in a linear display.

Thread Starter

allenpitts

Joined Feb 26, 2011
96
Hello AAC forum,

Using Arduino and Max 7219 to control 256 LEDs in a linear display.
The desired effect is indicated in this animated GIF.

(Only 157 LEDs are shown in the animated GIF in the interest of time
and because it is thought that 157 LEDs are enough to indicate the idea.)
A Max 7219 controls 64 LEDs on a PCB. Four boards are planned.
Have successfully connected two PCBs and have 128 light working
correctly.
The problem came when connecting the third board. Have connected the first
eight LEDs on the third board. They will not light.
This the schematic of the Arduino to Max 7219. Not showing boards because they are tested and the third board is the same as the first two PCBs and they are working. Also have swapped out boards.

Checked the software and hardware over and over. Finally went back to the software
and found in the code when the line
LedControl lc=LedControl(12,11,10,3);
is changed to
LedControl lc=LedControl(12,11,10,2);
(more complete copy of sketch listed herewith below)
the LEDs on the third board light simultaneously
with first eight LEDs on the second board.
The fourth value in the LEDControl argument according to
https://playground.arduino.cc/Main/LedControl/#SingleMatrixControl
controls the number of Maxim 7219s in the daisy chain.
When the value is changes from 3 to 2 the ICs think there are
two ICs and turns on the LEDs on the third board. This proves
that the voltage the Clock and the Load are correct. (I think.)
But can't figure out if there are three boards why, when
the third board is connected the third board stops working.
When connecting the second board had trouble because it was not realized that
lc.shutdown(1,false); line had to be added. Also it is believed
that the setIntensity values has to be set for each board
although there is not much literature on these values.
Any idea why the third board won't go positive?
Thanks.
Allen in Dallas

PS If someone in the Dallas area is willing to help w this I will and work out a generous hourly rate for consultation.
pittsallen@usa.net

+++++++++ begin Arduino sketch +++++++++++++++++
//Sketch to run two groups of 64 LEDs plus 8 on 3rd brd
#include "LedControl.h"
LedControl lc=LedControl(12,11,10,3);
unsigned long delaytime=500;
unsigned long delaytime2=70;
void setup() {
lc.shutdown(0,false);
lc.shutdown(1,false); //second board
lc.shutdown(2,false); //second board
/* Set the brightness to a medium values */
lc.setIntensity(0,6);
lc.setIntensity(1,6);
lc.setIntensity(2,6);
/* and clear the display */
lc.clearDisplay(0);
lc.clearDisplay(1);
lc.clearDisplay(2);
}
void loop() {
lc.setLed(0,0,0,true); //first octect
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,1,0,true); //octect 2
delay(delaytime2);
lc.setLed(0,1,1,true);
delay(delaytime2);
lc.setLed(0,1,2,true);
delay(delaytime2);
lc.setLed(0,1,3,true);
delay(delaytime2);
lc.setLed(0,1,4,true);
delay(delaytime2);
lc.setLed(0,1,5,true);
delay(delaytime2);
lc.setLed(0,1,6,true);
delay(delaytime2);
lc.setLed(0,1,7,true);
delay(delaytime2);

//lc.clearDisplay(0);
lc.setLed(0,2,0,true); //octect 3
delay(delaytime2);
lc.setLed(0,2,1,true);
delay(delaytime2);
lc.setLed(0,2,2,true);
delay(delaytime2);
lc.setLed(0,2,3,true);
delay(delaytime2);
lc.setLed(0,2,4,true);
delay(delaytime2);
lc.setLed(0,2,5,true);
delay(delaytime2);
lc.setLed(0,2,6,true);
delay(delaytime2);
lc.setLed(0,2,7,true);
delay(delaytime2);

lc.setLed(0,3,0,true); //octect 4
delay(delaytime2);
lc.setLed(0,3,1,true);
delay(delaytime2);
lc.setLed(0,3,2,true);
delay(delaytime2);
lc.setLed(0,3,3,true);
delay(delaytime2);
lc.setLed(0,3,4,true);
delay(delaytime2);
lc.setLed(0,3,5,true);
delay(delaytime2);
lc.setLed(0,3,6,true);
delay(delaytime2);
lc.setLed(0,3,7,true);
delay(delaytime2);
//lc.clearDisplay(0);
lc.setLed(0,4,0,true); //octect 5
delay(delaytime2);
lc.setLed(0,4,1,true);
delay(delaytime2);
lc.setLed(0,4,2,true);
delay(delaytime2);
lc.setLed(0,4,3,true);
delay(delaytime2);
lc.setLed(0,4,4,true);
delay(delaytime2);
lc.setLed(0,4,5,true);
delay(delaytime2);
lc.setLed(0,4,6,true);
delay(delaytime2);
lc.setLed(0,4,7,true);
delay(delaytime2);

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

//lc.clearDisplay(0);
lc.setLed(0,6,0,true); //octect 7
delay(delaytime2);
lc.setLed(0,6,1,true);
delay(delaytime2);
lc.setLed(0,6,2,true);
delay(delaytime2);
lc.setLed(0,6,3,true);
delay(delaytime2);
lc.setLed(0,6,4,true);
delay(delaytime2);
lc.setLed(0,6,5,true);
delay(delaytime2);
lc.setLed(0,6,6,true);
delay(delaytime2);
lc.setLed(0,6,7,true);
delay(delaytime2);

lc.setLed(0,7,0,true); //octect 8
delay(delaytime2);
lc.setLed(0,7,1,true);
delay(delaytime2);
lc.setLed(0,7,2,true);
delay(delaytime2);
lc.setLed(0,7,3,true);
delay(delaytime2);
lc.setLed(0,7,4,true);
delay(delaytime2);
lc.setLed(0,7,5,true);
delay(delaytime2);
lc.setLed(0,7,6,true);
delay(delaytime2);
lc.setLed(0,7,7,true);
delay(delaytime2);
//lc.clearDisplay(0);

//second board lines 292 thru 564
lc.setLed(1,0,0,true); //octect 9
delay(delaytime2);
lc.setLed(1,5,1,true); //out of sequence one
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,1,3,true);// out of sequence 2
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,1,0,true); //octect 10
delay(delaytime2);
lc.setLed(1,1,1,true);
delay(delaytime2);
lc.setLed(1,1,2,true);
delay(delaytime2);
lc.setLed(1,1,3,true);
delay(delaytime2);
lc.setLed(1,1,4,true);
delay(delaytime2);
lc.setLed(1,1,5,true);
delay(delaytime2);
lc.setLed(1,3,6,true); //Out of seq 2
delay(delaytime2);
lc.setLed(1,1,6,true);
delay(delaytime2);
lc.setLed(1,1,7,true);
delay(delaytime2);

//lc.clearDisplay(1);
lc.setLed(1,2,0,true); //octect 11
delay(delaytime2);
lc.setLed(1,2,1,true);
delay(delaytime2);
lc.setLed(1,2,2,true);
delay(delaytime2);
lc.setLed(1,2,3,true);
delay(delaytime2);
lc.setLed(1,2,3,true);
delay(delaytime2);
lc.setLed(1,2,4,true);
delay(delaytime2);
lc.setLed(1,5,5,true);//Out of seq 3
delay(delaytime2);
lc.setLed(1,2,6,true);
delay(delaytime);
lc.setLed(1,5,6,true);//Out of seq 4
delay(delaytime2);
lc.setLed(1,2,5,true);
delay(delaytime2);
lc.setLed(1,2,7,true);
delay(delaytime2);

lc.setLed(1,3,0,true); //octect 12
delay(delaytime2);
lc.setLed(1,5,6,true);
delay(delaytime);
lc.setLed(1,3,1,true);
delay(delaytime2);
lc.setLed(1,3,2,true);
delay(delaytime2);
lc.setLed(1,3,3,true);
delay(delaytime2);
lc.setLed(1,3,4,true);
delay(delaytime2);
lc.setLed(1,3,5,true);
delay(delaytime2);
lc.setLed(1,3,6,true);
delay(delaytime2);
lc.setLed(1,3,7,true);
delay(delaytime2);
//lc.clearDisplay(1);

lc.setLed(1,4,0,true); //octect 13
delay(delaytime2);
lc.setLed(1,4,1,true);
delay(delaytime2);
lc.setLed(1,4,2,true);
delay(delaytime2);
lc.setLed(1,4,3,true);
delay(delaytime2);
lc.setLed(1,4,4,true);
delay(delaytime2);
lc.setLed(1,4,5,true);
delay(delaytime2);
lc.setLed(1,4,6,true);
delay(delaytime2);
lc.setLed(1,4,7,true);
delay(delaytime2);

lc.setLed(1,5,0,true); //octect 14
delay(delaytime2);
// used for OO seq 1
lc.setLed(1,5,2,true);
delay(delaytime2);
lc.setLed(1,5,3,true);
delay(delaytime2);
lc.setLed(1,5,4,true);
delay(delaytime2);
// used for out of seq 3
lc.setLed(1,5,6,true);
delay(delaytime2);
lc.setLed(1,5,7,true);
delay(delaytime2);
// lc.clearDisplay(1);
lc.setLed(1,6,0,true); //octect 15
delay(delaytime2);
lc.setLed(1,6,1,true);
delay(delaytime2);
lc.setLed(1,6,2,true);
delay(delaytime2);
lc.setLed(1,6,3,true);
delay(delaytime2);
lc.setLed(1,6,4,true);
delay(delaytime2);
lc.setLed(1,6,5,true);
delay(delaytime2);
lc.setLed(1,6,6,true);
delay(delaytime2);
lc.setLed(1,6,7,true);
delay(delaytime2);

lc.setLed(1,7,0,true); //octect 16
delay(delaytime2);
lc.setLed(1,7,1,true);
delay(delaytime2);
lc.setLed(1,7,2,true);
delay(delaytime2);
lc.setLed(1,7,3,true);
delay(delaytime2);
lc.setLed(1,7,4,true);
delay(delaytime2);
lc.setLed(1,7,5,true);
delay(delaytime2);
lc.setLed(1,7,6,true);
delay(delaytime2);
lc.setLed(1,7,7,true);
delay(delaytime2);

//lc.clearDisplay(1);
lc.setLed(2,0,0,true); //octect 9
delay(delaytime2);
lc.setLed(2,0,1,true);
delay(delaytime2);
lc.setLed(2,0,2,true);
delay(delaytime2);
lc.setLed(2,0,3,true);
delay(delaytime2);
lc.setLed(2,0,4,true);
delay(delaytime2);
lc.setLed(2,0,5,true);
delay(delaytime2);
lc.setLed(2,0,6,true);
delay(delaytime2);
lc.setLed(2,0,7,true);
delay(delaytime2);

lc.setLed(2,1,0,true); //octect 10
delay(delaytime2);
lc.setLed(2,1,1,true);
delay(delaytime2);
lc.setLed(2,1,2,true);
delay(delaytime2);
lc.setLed(2,1,3,true);
delay(delaytime2);
lc.setLed(2,1,4,true);
delay(delaytime2);
lc.setLed(2,1,5,true);
delay(delaytime2);
lc.setLed(2,3,6,true); //Out of seq 2
delay(delaytime2);
lc.setLed(2,1,6,true);
delay(delaytime2);
lc.setLed(2,1,7,true);
delay(delaytime2);

//lc.clearDisplay(2);
lc.setLed(2,2,0,true); //octect 11
delay(delaytime2);
lc.setLed(2,2,1,true);
delay(delaytime2);
lc.setLed(2,2,2,true);
delay(delaytime2);
lc.setLed(2,2,3,true);
delay(delaytime2);
lc.setLed(2,2,3,true);
delay(delaytime2);
lc.setLed(2,2,4,true);
delay(delaytime2);
lc.setLed(2,2,6,true);
delay(delaytime);
lc.setLed(2,2,5,true);
delay(delaytime2);
lc.setLed(2,2,7,true);
delay(delaytime2);

lc.setLed(2,3,0,true); //octect 12
delay(delaytime2);
lc.setLed(2,3,1,true);
delay(delaytime2);
lc.setLed(2,3,2,true);
delay(delaytime2);
lc.setLed(2,3,3,true);
delay(delaytime2);
lc.setLed(2,3,4,true);
delay(delaytime2);
lc.setLed(2,3,5,true);
delay(delaytime2);
lc.setLed(2,3,6,true);
delay(delaytime2);
lc.setLed(2,3,7,true);
delay(delaytime2);
//lc.clearDisplay(1);

lc.setLed(2,4,0,true); //octect 13
delay(delaytime2);
lc.setLed(2,4,1,true);
delay(delaytime2);
lc.setLed(2,4,2,true);
delay(delaytime2);
lc.setLed(2,4,3,true);
delay(delaytime2);
lc.setLed(2,4,4,true);
delay(delaytime2);
lc.setLed(2,4,5,true);
delay(delaytime2);
lc.setLed(2,4,6,true);
delay(delaytime2);
lc.setLed(2,4,7,true);
delay(delaytime2);

lc.setLed(2,5,0,true); //octect 14
delay(delaytime2);
lc.setLed(2,5,1,true);
delay(delaytime2);
lc.setLed(2,5,2,true);
delay(delaytime2);
lc.setLed(2,5,3,true);
delay(delaytime2);
lc.setLed(2,5,4,true);
delay(delaytime2);
// used for out of seq 3
lc.setLed(2,5,6,true);
delay(delaytime2);
lc.setLed(2,5,7,true);
delay(delaytime2);
// lc.clearDisplay(1);
lc.setLed(2,6,0,true); //octect 15
delay(delaytime2);
lc.setLed(2,6,1,true);
delay(delaytime2);
lc.setLed(2,6,2,true);
delay(delaytime2);
lc.setLed(2,6,3,true);
delay(delaytime2);
lc.setLed(2,6,4,true);
delay(delaytime2);
lc.setLed(2,6,5,true);
delay(delaytime2);
lc.setLed(2,6,6,true);
delay(delaytime2);
lc.setLed(2,6,7,true);
delay(delaytime2);

lc.setLed(2,7,0,true); //octect 16
delay(delaytime2);
lc.setLed(2,7,1,true);
delay(delaytime2);
lc.setLed(2,7,2,true);
delay(delaytime2);
lc.setLed(2,7,3,true);
delay(delaytime2);
lc.setLed(2,7,4,true);
delay(delaytime2);
lc.setLed(2,7,5,true);
delay(delaytime2);
lc.setLed(2,7,6,true);
delay(delaytime2);
lc.setLed(2,7,7,true);
delay(delaytime2);

lc.clearDisplay(0);
delay(delaytime);
lc.clearDisplay(1);
delay(delaytime);
lc.clearDisplay(2);

}

+++++++++ end Arduino sketch ++++++++++++
 

Thread Starter

allenpitts

Joined Feb 26, 2011
96
Hello AAC Forum,

Added video of the first two boards for context.

Allen Pitts, Dallas Texas
 

Sensacell

Joined Jun 19, 2012
2,438
Show how you have the 8 LEDs connected to the driver.

It may be that you have connected the LED's wrong for a less-than-fully populated driver.
 
Last edited:

Thread Starter

allenpitts

Joined Feb 26, 2011
96
Hello AAC forum and sensacell,

Sensacell you nailed it. Started at
lcSetLED(2,0,0,true)
Should be
LcSetLED(2,7,0,true)
Started at wrong end of PCB.

Thanks.

Allen in Dallas
 
Top