Problem with max7219

Hello,
i have a max7219 board with 8x32 leds (4 8x8 leds).
I'm running the example program from MD_Parola (it does not matter which one - the problem appears with all of them). And the first two 8x8 panels work fine, but the last two light up at a 100% (some LEDs do not light at all), and not matter what i do I'm not able to display text on them.

(Info: The 8x8 panels are fine, i switched them back and forth and the problem existed. And i know that i need to change the direction of the text, but thats not my problem.

See photo for example.


)

Thanks for any help!

Post your sketch, please. Which Arduino are you using?

Is there a configuration parameter in the example sketch where you configure how many LED matrix panels you have ? (4 in your case)

1 Like

I used this sketch, and i specified FC16_HW and MAX_DEVICE 4:

Im using a arduino nano.

very likely this is not correct for your hardware:

#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 11

it seems you have only 4 devices
it seems you have FC16_HW modules

1 Like

Thats my fault, missed to mention that i've already done this. But still the problem exists.

My guess is that the chip has gone bad?

a) carefully change the first and last LED module.
What happens?

Try the following sketch and check that the 4-8x8 LED Matrix Display Unit shows:- 23.56 which (Fig-1) is being shown by my NANO now. Note that I have taken care of the comments of post #5 @noiasca.

// Including the required Arduino libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 10

// Create a new instance of the MD_Parola class with hardware SPI connection
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

float number = -23.57;
char buffer[20]; // Make sure the buffer is large enough

void setup()
{
  myDisplay.begin();
  myDisplay.setIntensity(0);
  myDisplay.setTextAlignment(PA_CENTER);
  myDisplay.displayClear();
  delay(2000);
  //------------------

  // Convert the float to ASCII with 2 decimal places of precision
  floatToASCII(number, buffer, 2);

  myDisplay.print(buffer);
}

void loop() {}

void floatToASCII(float num, char *buffer, int precision)
{
  // Handle the case where the number is negative
  if (num < 0) 
  {
    *buffer++ = '-';
    num = -num;
  }

  // Extract the integer and fractional parts
  int intPart = (int)num;
  float fracPart = num - (float)intPart;

  // Convert the integer part to ASCII
  int length = snprintf(buffer, 10, "%d", intPart);
  buffer += length;

  // Add the decimal point
  *buffer++ = '.';

  // Convert the fractional part to ASCII with the specified precision
  for (int i = 0; i < precision; i++) 
  {
    fracPart *= 10;
    int digit = (int)fracPart;
    *buffer++ = '0' + digit;
    fracPart -= digit;
  }

  // Null-terminate the string
  *buffer = '\0';
}

image
Figure-1:

If you switched them around and the problem persisted, probably not.

Try a slower SPI clock
Put as last statement in setup():
SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0))

Thanks for the reply! As written in my question I already swapped the modules back and forth and swapped them, nothing has changed. The pannels on position 3/4 always were on.

Are you using a pre-assembled 4-8x8 LED Matrix Module Like Fig-1 of post #8 or you have 4 seperate Modules and making cascade connection among them?

Please, post a picture of your display unit.

Thanks for your help!

Still the same problem:


Doesn't this imply that it is a Problem with the chip? I Mean i only swapped the LED-Pannel, the 4 chips stayed always at the same position - so i can eliminate that it is a Problem with the LED itself. (See next answer for photo of my LED).


Yes im using a pre-assembled board with already soldered chips and connections.


I thought you had the individual modules, so it could be the IC,
Did you try the slower clock?

Sorry did not add this to my answer:

Yes I've tried it, but then the first two panels simply are black/show at most a line (depending on the speed) and the other two 8x8 panels are the same as before, i.e. on at 100%.

carefully check the lines between 2nd and 3rd module,
they might be broken.
You could add some solder to them.

if this isn't working, connect testwise your lines directly on the 3rd module ... does the 3rd module work then?

If not - consider the 3rd IC broken and buy a new set ...

Did Idea 1 and 2, but it still does not work.

Now i don't think it's worth more hustle, since those boards are not that expensive.

Still thanks for all of your Help! You are great!

Well before you buy new modules and you want to do more debugging, then cut the traces between the 2nd and 3rd module and apply the power and signals to the 2rd module. See if the 2nd and 3rd modules work.

That's why I keep at least two for every item.

1 Like