Looped CLK on Max7219's

Hello

I have a fairly large PCB, with 5x Max7219's onboard, driving 5x rows of 8, seven segment displays.

Using the 'LedControl.h' library. All going fine.

At first, I daisy chained the 5x Max7219's together. Data out to the following ones data in.
They all shared the same clock and the same load line.

Declared below:

LedControl lc=LedControl(5,4,3,5); // Data, CLK, Load and number of IC's

This worked fine on the breadboard during testing.

But...

When transferred to the (probably noisy) pcb, I have data corruption issues over time.
I have smoothed the supply as best I can, but talking to the last IC sometimes corrupts the earlier chips.

So, I though I have more than enough pins and programming space, I will talk to each IC individually.

So I declared:

LedControl lc1=LedControl(5,4,3,1);
LedControl lc2=LedControl(6,4,3,1);
LedControl lc3=LedControl(7,4,3,1);
LedControl lc4=LedControl(8,4,3,1);
LedControl lc5=LedControl(9,4,3,1);

Individual Data lines, everything else shared.
Doesn't work? I just get all the segments illuminated (so bad/no data).

But, if I declare:

LedControl lc1=LedControl(5,4,3,1);
LedControl lc2=LedControl(7,6,3,1);
LedControl lc3=LedControl(9,8,3,1);
LedControl lc4=LedControl(11,10,3,1);
LedControl lc5=LedControl(13,12,3,1);

Then it appears to work.
Just wondered why I have to give each display its own CLK as well? All the diagrams I have found show them shared.

Is it a library thing maybe?

Clearly the clock is more important than the "load" signal though you may have to add some delay to that.

It is not clear, but you suggest you are using 40 MAX7219s. You really would need to buffer the clock line (OK, and latch) with a 74HC14 - one inverter driving five to give five buffered outputs for 8 displays each. Keep wiring short and keep all lines bunched together from one part to the next, no loops.

I have experience with up to 8 7219 daisy chained, even 12 with another library. This works stable without any issues.
So I assume your wiring is out of specs.

How long is your wiring from the Arduino to the first 7219
how long are the wires between each further 7219
What's your power source is looking like?
Best make a schematic drawing and a real picture of your setup.

in general, if you don't want to daisy chain your displays you should use individual CS (load) lines. That's the third parameter.

No - not 40 Max7219's, only 5. Each max 7219 is driving 8x individual 7 segment displays.
So, there are a total of 5 rows of 8 displays (if that makes sense).

Imagine:

Row 1: 88888888
Row 2: 88888888
Row 3: 88888888
Row 4: 88888888
Row 5: 88888888

Just found a diagram showing the load line held low with a 10k. Will try that in the morning.
I have enough pins. Think I might just give each IC their own pins entirely (CLK, Load and Data).

The run from the 2560p to the display is probably 200mm. I can't shorten that, as the display is on the lid of a hinged box, with the processor in the bottom.

Five MAX7219s can be operated in a chain directly with no problems at all. It is usual to operate at the very least eight in a row for a "Times Square" display. No requirement for buffering unless you do something very strange with the wiring. Is the wiring longer than 1 metre?

No. Wiring is now 160mm (I shortened it).

Not sure what the issue is. Anyway, its a 2560p - LOADS of pins, so I have given each IC it's own LOAD and DataIn. They all just share the clock signal.

Seems to work fine, so I will stick with that.