SOLVED: Max7219 daisy chain mystery

Hi,
I know there are many threads about 7segment displays and the Max7219.
But non of those seem to address what I’m currently seeing and I’m hoping to get some input on how to go on from here.

The setup is the following:
2 max7219 daisy chained on a PCB.
Power is coming from an external source which has a common GND.

Now the challenge is that this does work if I connect it to an Arduino Mega 2560.

But if I connect the same PCB to an Arduino Mega 2560 Pro board, only the first 8 digits work. the second set is always blank.

I also did try it with 2 different Mega Pro’s and it’s exactly the same behavior.

Now I do get that those are not the original ones. But except for some pins which do not work at times I didn’t have big problems before and it works with everything else I have connected.

Anyone knows what could explain this wired issue? I have a hard time to understand what could cause this difference as we are talking about having 3 pins here which don’t really have any load.
(Btw, nothing else is connected while I try this.)

I assume you meant weird issue, if not, wire it correctly. :wink:

Are you shure that both Megas run the same code?

Yes you are right. weird it is :slight_smile:

I’m 100% positive it runs the same code. Checked that multiple times.

You don’t supply the code and not even information which pins you are using.

My guesses are exhausted and my crystal ball cloudy.

One more guess: the pin headers of the pro are not soldered correctly.

I have used many pin variants.
But as it does work with one arduino, but only partly with the other Arduino, I’m not sure how the pins could be the issue, as it does the right think in one of the displays.

When it comes to code, I run Mobiflight here. But it’s the same if I run my own sketch. Also here, I’m not sure how this could be a SW issue as it does work fully in one, and partly on the other one.
But I’m happy to learn more if my assumption is wrong here :slight_smile:

I don’t.

You could try a sketch that only exercises the displays,
if it is the hardware the error should persist.

I encountered failing max communication (mostly on the second device) in a noisy
environment (switched pumps and relais).

Yes probably makes sense to write a small sketch.
I will do that asap to ensure it’s really not the SW part.

When it comes to the noisy part I see that. But as it’s a consistent behavior between the 2 arduino’s I guess that’s not the big issue right now.

I have now created a minimal scratch.

#include <Arduino.h>
#include "LedControl.h"
LedControl lc = LedControl(20,24,22,2); // Data, clk, load, moduleNum

void setup() {
 lc.shutdown(0,false); lc.shutdown(1,false);
 lc.setIntensity(0,8); lc.setIntensity(1,8);
 lc.clearDisplay(0);  lc.clearDisplay(1);
 for(int i=0;i<=7;i++) {
   lc.setDigit(0,i,i,false);
   lc.setDigit(1,i,i,false);
 }
}

void loop() {
  // put your main code here, to run repeatedly:
}

And amazingly enough I see the same behavior.
It works with one arduino, but not with the 2nd and 3rd one :frowning:
Those only populate the first module…

Anyone every seen anything like that. It’s driving me crazy.

There is nothing else connected?

Did you try it with pins without special functions?
On 20 there could be a difference with the pullup.

Nothing else connected. And did try many other pin’s as well.

That is indeed weird.

Can you try it with different max modules?

If not, what happens when you switch the order of the modules?

Thanks for all the help.
But switching the modules ends up in the same situation.
The last thing I could think of is some voltage problem or some wired short within the PCB. Trying to go through that right now.
Depressing…

Finally I solved the issue. Thanks Whandall for helping me on the way. Really appreciated :slight_smile:
The problem was the DOUT - > DIN line. I still do not exactly why. Must be some short on the PCB depending on the voltage…
If I cut the legs of the IC and connect dout with din with a wire patch it now works.