MD_MAX72xx library - Can it support two CS lines, two strings of modules?

Hi:

I am trying to understand library capability for Max7219 8x8 matrix modules.
I want to make a dual timezone clock display.
I also want to do hours, minutes, seconds, and a label for UTC or local time.
So I am thinking about 2 or 3 of the "4-in-1" 8x8 matrix modules (8 to 12 positions?) for
each timezone line, so I can fit all the characters on the display. But when I tried the example
library test programs for a single long string of FC-16 "8x8" matrix modules, they start to
corrupt, probably due to noise and signal line loading, and may require a number of 74HC04
line buffer ICs added. (Or use shorter module strings.) It will also take a lot longer in milli-
seconds to update a very long display module string.

One thought; Does this library support using multiple CS select lines for making
two separate shorter strings of the 8x8 matrix modules? I was thinking something
similar to;

#define MAX_DEVICES 12
#define CLK_PIN 13 // or SCK
#define DATA_PIN 11 // or MOSI
#define CS1_PIN 10 // SS for module string one.
#define CS2_PIN 9 // SS for module string two.

D_MAX72XX mx1 = MD_MAX72XX(CS_PIN, MAX_DEVICES); // Moudle string "mx1" UTC Time
D_MAX72XX mx2 = MD_MAX72XX(CS_PIN, MAX_DEVICES); // Moudle string "mx2" Local Time

That way, one of the above strings could be for each timezone and label.
Each would be shorter, hence take less time to update.

But if the library does support this, then how do I treat the MAX_DEVICES variable?
Is that the max number of devices in ONE string, like 12 or 16, or is it the sum total
of all modules used in both strings of devices?

[Disclaimer: I am very new at working with Arduino. I may simply be not using this
correctly, or have the wrong idea all together. Please feel free to laugh first, and then
point me in another direction for the project.]

Cheers,

Neal

It can handle this. You need to create different instances of the MD_MAX72xx object with different CS pins. The MAX_DEVICES can be different for each instance - they are independent and only relevant for that instance.

An alternative way to do this is to use the MD_Parola library over the top of MD_MAX72xx and simply use 2 display zones.

But when I tried the example
library test programs for a single long string of FC-16 "8x8" matrix modules, they start to
corrupt, probably due to noise and signal line loading, and may require a number of 74HC04
line buffer ICs added. (Or use shorter module strings.)

I have used 5 in series with no corruption. I guess it must be how you have wired them - here is mine Fun and Games, and a New Library – Arduino++ - as everything but the DATA line can be wired in parallel, so the longest string of modules is only 4 per signal.

It will also take a lot longer in milli-seconds to update a very long display module string.

Your concern about updates speed is not really relevant - if you are just updating the time each second there will be no appreciable extra load if you are doing 4 or 8 modules in series. A few milliseconds every second is not noticeable unless you have other really time critical activities you are doing.

Nealix:
Is that the max number of devices in ONE string, like 12 or 16, or is it the sum total

it is per one object ("string" how you call it)

under the asumption, that both displays should have the same width:

#define   MAX_DEVICES   6  //per object
#define CLK_PIN 13  // or SCK
#define DATA_PIN 11  // or MOSI
#define CS_PIN 10  // or SS

MD_MAX72XX mx1 = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

#define CLK2_PIN 9  
#define DATA2_PIN 8 
#define CS2_PIN 7  

MD_MAX72XX mx2 = MD_MAX72XX(DATA2_PIN, CLK2_PIN, CS2_PIN, MAX_DEVICES);

You are dealing with SPI bus communications so CLK and DATA can be the same. The device is selected by CS, so only this needs to be unique.

OK, but do clk and data "HAVE" to be the same?
I really like the example that Noiasca posted above, because having fewer matrix devices on
each set of CLK and DATA lines reduces the amount of loading, noise, and spikes for each one.
I will try out what Noiasca posted. I like the idea of isolating the two sets of signals, if the
Arduino can handle that.

Cheers,

Neal

OK, but do clk and data "HAVE" to be the same?

No they can be different.

However, I would recommend using hardware SPI over the 'bit bashing ' approach as it is faster for updates. On an Uno, for example, this is only one set of pins. On other hardware there may be multiple SPI pins you can use.

I agree, technically you can (and should) use HW-SPI with different CS lines.
My example should show that each object can be different.