Yes, the Arduino can supply current for 2 matrixes. I have powered four, with 9V source. 12V was too much, the regulator would over heat and shutdown.

Theoretically, to have two MAX7219 driving a dual color common cathode matrix one would wire it like this, and multiplex the outputs by alternately putting each part in shutdown mode:

"When the MAX7219 is in shutdown mode, the scan oscillator is halted, all segment current sources are pulled to ground, and all digit drivers are pulled to V+, thereby blanking the display."

The diodes isolate each part from the common cathode so the MAX7219s do not interfere with each other when sinking cathode current.

As a hardware engineer, I would use SPI.transfer()s to communicate to each part, with a seperate ssPin to each part so that you could update one or the other.SCK - to MAX7219 CLK pin 13MOSI - MAX7219 DIN pin 1ssPin - to MAX7219 LOAD pin 12

Or, daisy chain them and write a loop that updated the 8 registers on each one every so many mS for animations.I don't follow this fascinintion with using the equivalent of shiftout() for sending data to the parts:

If I'd wire your matrix I'd make it like this (I changed the SEG connections only):This way I think the multiplex would be better handled by the driver (and the LedControl library, I think). Lines would be lines and cols=cols... easier to address them individually.

I have sort of figured out how to patch it but I can't get it to work; I patched the source file with GnuWin32 and it almost works but it says that hunk #4 failed at 219 whereas hunk 1, 2, 3 and 5 are successful. It says that I should use the -p or --strip option but I don't know how they work.

Would it be possible for somebody to upload the patched source file? It would be of great help.

ok I have got it working perfectly but I am having some confusion with the value for the ISET resistor; I origionally used a 28k ohm resistor which is what the data sheet recommends but the 7 segment display was fairly dim so I tested it with a multimeter and each segment was drawing only 2 mA so I played around with the resistance value and I finally got each segment to run at 10 mA with a value of 2.2k which is much lower than it should be. Is it possible that using the MAX7219 as a common anode display driver drasticaly changes the value required for the ISET resistor?

I made sure that the software brightness control was at the maximum value of 15 and I have no resistors between the IC and the 7 segment display by the way.

Edit: Each segment draws 10mA only when 1 digit is activated, they progressively draw less current and get dimmer as more digits are activated until they only draw 4.25mA with all 8 digits activated, strangely the current draw per segment is unaffected if other segments on the same digit are activated (e.g. displaying a number 1 draws 20mA, a number 8 draws 70mA).

My patch for LedControl is attached. It's completely backwards compatible with existing code. To use it with common anode displays, you only have to add a boolean option to the object creation. The transposition is handled completely by the library.

I am currently rewriting and significantly expanding LedControlMS. I only have 8 8x8 single-color LEDs matrices right now. 8 more coming and I have an external 5v supply so running them will not be a problem.

With the time I have, it will be a couple of weeks. Won't have that reverse polarity patch put in unless I can find hardware to try it out with.

This is not as elaborate as MD_Parola (yet or maybe ever) but I find I cannot get very far reading that code. Mine is much more transparent and easy to modify. In the spirit of LedControl libraries.

Full width coarse and smooth scrolling is working with variable rate from WAY too fast to read to as slow as you want it. Also up and down scrolling either by individual matrix or in order scrolling or or down in unison or by arbitrary step size and also speed variable.

I want to tame the crawling (horizontal movement) and let the user easily control it and put in things like flying individual characters in and out (left and right) at user selectable speed, justification and other stuff. So it will do more scroll and crawl functions soon. And you can easily add your own 8x8 characters. There is room for another 125 or so. Already has all ASCII upper/lower and special characters plus degree symbol, US Cent sign and 3 grids.

Will post somewhere when I am ready to upload it somewhere. Probably my web site. The extreme speed is limited to AVR chips right now (Uno and many others) on arbitrary pins 8-13. Will also investigate hardware SPI this week. Having fun and writing code... Anyone know about "creeping featurism". That's what's happening here! Can be a good thing... sometimes...

One little strangeness on capacitors. If you use large ones, they do a good job of filtering but also add some inductance. To take care of that, you have to add a smaller one in parallel to balance it out. Seems wrong but you will see it a lot.

That's what the MAX7219 datasheet calls for, 0.1uF and 10uF together on the VCC pin.

Quote

To minimize power-supply ripple due to the peak digitdriver currents, connect a 10μF electrolytic and a 0.1μFceramic capacitor between V+ and GND as close tothe device as possible. The MAX7219/MAX7221 shouldbe placed in close proximity to the LED display, andconnections should be kept as short as possible tominimize the effects of wiring inductance and electromagneticinterference. Also, both GND pins must beconnected to ground.

10 MHz serial interface allows for Fast SPI interfacing (SPI divisor set to 2) for nearly 1byte/uS transfers. I use that when I use the chip:

hello LordPants,i came across your post, i am working on common anode double digit 7 segment so i need to know please where should i put the patch you share in the beginning is it in the LedControl same library or i must create a copy and name it differently ? because my project will contain 4 Common Anode double digit 7-segment and 1 single digit CC 7-segment and 19 LEDs so it's gonna have 2 MAX7219 driving these, the first MAX7219 will be driving the 4 double digit 7-segemt and the other MAX will do the rest

I'm working on a project that uses lots of 7-segment LED displays, and I'm using the MAX7219 IC for its wonderful multiplexing and constant current features. Since the displays I found were common anode (not the common cathode the MAX7219 datasheet specifies), I had to modify the LedControl library a bit to accommodate them. I will share my methods and code here to get feedback before I upload any updated libraries.

The 7219 can be easily used with common anode displays, as long as things are wired up "backwards." In other words, since the pins for DIG-0 through DIG-7 are current sinks and the pins for SEG-DP through SEG-G are current sources, they can be swapped to provide appropriate power to a common anode display. Wiring should be:

Now since the 7219 scans digit-by-digit, and we've swapped digits with segments, it's now going to scan segment-by-segment on the common anode displays, unless we modify the data we're sending to it. The data for the entire display is represented by an 8-byte array, with each byte corresponding to one digit and each bit corresponding to one segment. To get it to work to our wiring scheme, we have to flip it: we transpose the bit matrix.

Here are the two matrices for displaying "01234567" with no decimal points on an 8-digit display (in NO DECODE mode, which LedControl uses). Each row of the matrix is stored as a byte in an array (in LedControl, it's in the status[] array).

My patch for LedControl is attached. It's completely backwards compatible with existing code. To use it with common anode displays, you only have to add a boolean option to the object creation. The transposition is handled completely by the library.

I'm working on a project that uses lots of 7-segment LED displays, and I'm using the MAX7219 IC for its wonderful multiplexing and constant current features. Since the displays I found were common anode (not the common cathode the MAX7219 datasheet specifies), I had to modify the LedControl library a bit to accommodate them. I will share my methods and code here to get feedback before I upload any updated libraries.

The 7219 can be easily used with common anode displays, as long as things are wired up "backwards." In other words, since the pins for DIG-0 through DIG-7 are current sinks and the pins for SEG-DP through SEG-G are current sources, they can be swapped to provide appropriate power to a common anode display. Wiring should be:

Now since the 7219 scans digit-by-digit, and we've swapped digits with segments, it's now going to scan segment-by-segment on the common anode displays, unless we modify the data we're sending to it. The data for the entire display is represented by an 8-byte array, with each byte corresponding to one digit and each bit corresponding to one segment. To get it to work to our wiring scheme, we have to flip it: we transpose the bit matrix.

Here are the two matrices for displaying "01234567" with no decimal points on an 8-digit display (in NO DECODE mode, which LedControl uses). Each row of the matrix is stored as a byte in an array (in LedControl, it's in the status[] array).

My patch for LedControl is attached. It's completely backwards compatible with existing code. To use it with common anode displays, you only have to add a boolean option to the object creation. The transposition is handled completely by the library.

hello Boris, at the end i managed to make this library work from Lord Of The Pants, what you have to do is take the patch file, name it as follow "common-anode.patch" then put it in LedControl folder, then go to LedControl.h open it with notepad or else and put this line or make sure it's there at the top of the file after the comments "#include <common-anode.patch>" copy the other files of course and rewrite the original files and you are good to go