Parola zone problem

Hi,

I am configuring a display made of 32 8x8-matrices (MAX7219) and I want to split it to four zones to display different messages.

I started with the Parola Zone Display example and extended the MAX_DEVICES value to 32 and the MAX_ZONES value to 4, the zones are set up by

P.setZone(0, 0, 7); P.setZone(1, 8, 15); P.setZone(2, 16, 23); P.setZone(3, 24, 31);

With this setup I get no message displayed, the display stays blank. Only when I change the last zone to

P.setZone(3, 24, 30);

all four zones are displayed, but the last zone is only 7 matrices wide instead of 8.

The Parola Scrolling example displays over all 32 matrices, just the zones do not work as they should.

Is this a known issue, i.e. is the number of matrices limited for zones?

Any helpful answer would help me a lot...

Walter

Zones run independently. Worse case, by declaring overlapping modules between zones you get weird results. There is no limit for number of modules in zones.

Please make sure you have the latest version of the libraries as there were memory allocation issues on object creation with the latest IDE. The constant MAX_ZONES in MD_Parola.h sets the maximum number of zones (4 by default).

Also, please post all your code (between code tags) as the problem may be somewhere else in your code, despite what you think. Reducing the code to the minimum that shows the problem is also a good idea.

Thx for your reply.

Below there is the code I used; as I mentioned this is just the Parola_Zone_Display example, modified to 32 modules and 4 zones.
Parola version is 2.7.4, MX_MAX72xx version is 2.10.0., IDE version is 1.8.5.

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_DEVICES 32
#define MAX_ZONES 4

#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// set to 1 if we are implementing the user interface pot
#define USE_UI_CONTROL  0

#if USE_UI_CONTROL
#define SPEED_IN  A5
#endif // USE_UI_CONTROL

// Hardware SPI connection
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

#define SPEED_TIME  25
#define PAUSE_TIME  1000

// Turn on debug statements to the serial output
#define  DEBUG  0

#if  DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif

// Global variables
uint8_t  curText;
char  *pc[MAX_ZONES] =
{
  "JKL",
  "GHI",
  "DEF",
  "ABC",
};

textEffect_t  effect[] =
{
  PA_RANDOM,
  PA_PRINT,
  PA_SCAN_HORIZ,
  PA_SCROLL_LEFT,
  PA_WIPE,
  //PA_ROCKET,
  PA_SCAN_VERTX,
  PA_SCROLL_UP_LEFT,
  PA_SCROLL_UP,
  PA_FADE,
  PA_OPENING_CURSOR,
  PA_GROW_UP,
  PA_SCROLL_UP_RIGHT,
  PA_BLINDS,
  PA_CLOSING,
  PA_GROW_DOWN,
 // PA_PACMAN2,
  PA_SCAN_VERT,
  PA_SCROLL_DOWN_LEFT,
  PA_WIPE_CURSOR,
  PA_SCAN_HORIZX,
  PA_DISSOLVE,
  PA_MESH,
  PA_OPENING,
  PA_CLOSING_CURSOR,
  PA_SCROLL_DOWN_RIGHT,
  PA_SCROLL_RIGHT,
  PA_SLICE,
  PA_SCROLL_DOWN,
  //PA_PACMAN1,
};

uint8_t inFX[MAX_ZONES] = { 0, ARRAY_SIZE(effect) / 3, 2 * ARRAY_SIZE(effect) / 3 };
uint8_t outFX[MAX_ZONES] = { 0, ARRAY_SIZE(effect) / 3, 2 * ARRAY_SIZE(effect) / 3 };

#if USE_UI_CONTROL
void doUI(void)
{
  // set the speed if it has changed
  {
    int16_t	speed = map(analogRead(SPEED_IN), 0, 1023, 0, 250);

    if (speed != (int16_t)P.getSpeed())
    {
      P.setSpeed(speed);
      P.setPause(speed);
      PRINT("\nChanged speed to ", P.getSpeed());
    }
  }
}
#endif // USE_UI_CONTROL

void setup(void)
{
#if DEBUG
  Serial.begin(57600);
  PRINTS("[Parola Zone Display Demo]");
#endif

#if USE_UI_CONTROL
  pinMode(SPEED_IN, INPUT);
  doUI();
#endif // USE_UI_CONTROL
  P.begin(MAX_ZONES);
  P.setInvert(false);

  P.setZone(0, 0, 7);
  P.setZone(1, 8, 15);
  P.setZone(2, 16, 23);
  P.setZone(3, 24, 31);

  for (uint8_t i=0; i<MAX_ZONES; i++)
    P.displayZoneText(i, pc[i], PA_CENTER, SPEED_TIME, PAUSE_TIME, effect[inFX[i]], effect[outFX[i]]);
}

void loop(void)
{
#if USE_UI_CONTROL
  doUI();
#endif // USE_UI_CONTROL

  if (P.displayAnimate()) // animates and returns true when an animation is completed
  {
    for (uint8_t i=0; i<MAX_ZONES; i++)
    {
      if (P.getZoneStatus(i))
      {
        outFX[i] = (++outFX[i]) % ARRAY_SIZE(effect);
        if (outFX[i] == 0)
        inFX[i] = (++inFX[i]) % ARRAY_SIZE(effect);

        P.setTextEffect(i, effect[inFX[i]], effect[outFX[i]]);

        // Tell Parola we have a new animation
        P.displayReset(i);
      }
    }
  }
}

Try reducing the number of matrices in each zone as a test. MAybe start at 4, and increase by 1 each time until the problem appears. That may give me a clue.

What Arduino processor hardware are you running this on?

Ok, I tried the following (in the original Parola_Zone_Display example, lines 133ff):

P.setZone(0, 0, 3); P.setZone(1, 8, 11); P.setZone(2, 16, 19); P.setZone(3, 24, 27);

==> this works fine

P.setZone(0, 0, 6); P.setZone(1, 8, 14); P.setZone(2, 16, 22); P.setZone(3, 24, 30);

==> this works fine, too

P.setZone(0, 0, 7); P.setZone(1, 8, 15); P.setZone(2, 16, 23); P.setZone(3, 24, 30);

==> still working

but:

P.setZone(0, 0, 7); P.setZone(1, 8, 15); P.setZone(2, 16, 23); P.setZone(3, 24, 31);

==> does not work at all

Platforms used were Arduino Nano, Uno and Mega; all with the same result.

Ok, what about 3 zones using all the modules? Trying to figure out if it is the number of zones or modules per zone causing the issue.

What is the power supply for this setup?

Ok, tried the following:

3 zones, 13+12+7 modules: animation starts, but freezes after a few seconds
3 zones, 8+8+16 modules: same as above
3 zones, 13+12+6 modules: is functional, no freezing!!!
3 zones, 8+8+15 modules: is functional, no freezing!!!

So this seems to be a number-of-modules-issue rather than a zones issue. However, as mentioned before, the Parola_Scrolling example runs even with all 32 modules.

Power supply is 5V/26A, direcly connected to the power pins of each module, Arduino is USB-powered. Modules are 8x4 (8 PCBs with each 4 modules on it)

I'll look at this when I get time. This will take a while.

I have raised an issue on the repository website so that tracking when it is fixed or explained is easier for you, as I am unlikely to return to this thread easily.

https://github.com/MajicDesigns/MD_Parola/issues