I thought I would share this with you all, it may help someone.
I’ve been trying to get 12 MAX7219 modules running concurrently for quite a while before I design a PCB to use 0.56” 8 digit 7-segment displays. I’m using the HCMAX7219 library, and despite the Hobby Components web page on the HCMAX7219 library claiming that you can daisy chain 12+ modules, I have found through trial and error that I can only successfully get up to 8 modules running from the same instance.
In hardware I daisy chained 6 modules with the DIN, CS, and CLK pins, and connected the VCC and GND pins directly from the power supply, which is also powering the Arduino via the 5V & GND pins. The power supply is a bench power supply supplying 5V and up to 2Amps.
Software is using the HCMAX7219 library, two instances each controlling 6 MAX7219 modules via separate CS pins and shared DIN and CLK pins.
Hmmm. I have no idea from where the "HCMAX7219" library comes, so cannot help much. Since it starts with "HC", I must assume it is something unique to Hobby Components and I would have to find them if I wanted to figure it out. Maybe not just now!
It would be useful to know what sort of "Arduino" it is. If it was an ESP8266 or some other 3.3 V system you would be
Looks like that library has a setting in the header file that needs to be changed for the number of MAX7219 ICs in the chain.
/***************************** USER CONFIGURATION ****************************/
/* CHANGE THIS VALUE IF YOU ARE DASY CHAINING MORE THAN ONE DRIVER */
#define NUMBEROFDRIVERS 1
marco_c:
Looks like that library has a setting in the header file that needs to be changed for the number of MAX7219 ICs in the chain.
/***************************** USER CONFIGURATION ****************************/
/* CHANGE THIS VALUE IF YOU ARE DASY CHAINING MORE THAN ONE DRIVER */ #define NUMBEROFDRIVERS 1
Did you change this to 12?
No, changed it to 6. I couldn’t get a single instance of the HCMAX7219 to control more than 8 MAX7219 modules, so I created two separate instances; one using CS pin connected to D9 and the other CS using D10, both controlling 6 modules.
Paul__B:
So the actual question was, when you were attempting to to "get 12 MAX7219 modules running concurrently", did you in fact set NUMBEROFDRIVERS to 12?
Yes, but I found that I could only control up to a maximum of 8 modules from a single instance. I progressively added 1 module at a time incrementing the NUMBEROFDRIVERS in the class header by 1 to match the number of modules connected.
Interesting topic. What, incidentally, is the limiting factor for the maximum number of MAX7219/21 chips that can be daisychained together in a single chain, assuming your code/library supports it ?
With most shift register type designs, there is no limit specified, but some signal buffering may be required.
I have seen retailers of some modules which use these chips advising against chaining too many together.
It could also be that some MAX clones do not perform identically to the real thing.