LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel

But what I need to do with these FC16 LED matrixes' ?
I have also big RGB Led display (~50 cm x 100 cm) contained 16 RGB LEDs 256 * 128 (64 * 32pixels) connected together :slight_smile:

1 Like

Hi, everyone. I hope I'm posting this in the right place.
I've got a 32x8 LED display attached to an Arduino Uno running the following program:

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

// Hardware SPI:
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 3

// Create a new instance of the MD_MAX72XX class:
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
  // Intialize the object:
  myDisplay.begin();
  // Set the intensity (brightness) of the display (0-15):
  myDisplay.setIntensity(0);
  // Clear the display:
  myDisplay.displayClear();
  myDisplay.setTextAlignment(PA_CENTER);
  myDisplay.print("Ralphie");
}

void loop() {
}

It displays "Ralphie" but it flickers. Eventually the display goes haywire or blank.
3 possibilities occur to me:

  • The display is unreliable,
  • The Uno is unreliable,
  • The Uno is talking to the display at too high a frequency.

I don't think it's a power supply problem because I get the same results whether the Uno is running off USB (connected to a Raspberry Pi 4) or a PP3 NiMH (outputting nearly 9V when the program is running).

Does anyone have any suggestions?
I've tried to figure out how to change the hardware SPI speed but it has defeated me.
I might try driving the display from a Raspberry Pi but the closest I've come to that is talking to 1 MAX7219 connected to 4 7-segment displays using wiringPi (sorry for the Pi-talk!).

Can you send a link to your led display?
I am thinking it is a ws2812 not max 72xx

Like this

Ah-ha! A multimeter tells me it's >2 megohms between CLK/DATA/CS and VCC (or GND).
Pull up resistors needed! I'll probably mutilate some unfortunate resistor SIP.

I think you need to define more pins.
Have you found an example that uses code similar to yours?

Thanks for the reply, papalanc.
I took my code from makerguides.com "MAX7219 LED dot matrix display Arduino tutorial" and deleted the body of loop().
I tweaked the code you suggest thus:

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

but I'm not sure whether it's working or not! When the display "stays still" for a while, it doesn't flicker.

Prepare to have your mind blown :grinning:
I accidentally disconnected the Arduino's 5V from the display and... it still works but dimmer and without the flickering! (but it's noticeably dimmer).
I guess the display is taking power from CLK, DIN, or CS when any of them is high...
but I'm flummoxed.

Oh, I put 10k pull-ups on CLK, DIN, and CS but that didn't make any difference.

Why don't you try the code from the guy who wrote it :slight_smile:
I think you need to define the other pins

#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 HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 11

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

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

I have only used esp devices, but his code works on them.

Hello world

You have it set to zero?

You can get examples in arduino

Thanks for the suggestion about examples. I hadn't thought of that. I tried Parola_HelloWorld but it doesn't display anything for me. (I tried it with CS connected to pin 10 and with it connected to pin 3.)
I'm guessing the argument to setIntensity goes straight to the MAX7219s' intensity registers, where 0 means "power the LEDs 1/32 of the time".
I tried setIntensity(1) but that still flickers.
I tried defining CLK_PIN and DATA_PIN but that didn't make any difference. (I think 13 and 11 are the defaults anyway: hardware SPI.)

Well I found a uno and you code works.
cs pin 3
clk pin 13
data pin 11
your code also works if you put cs on pin 10 even with intensity at zero. it is brighter at 5

Funny, hello world does not work. the display is random as in parts of the letters are on diff segments

I found one post that said spi on a uno only works with short cables?

Can I talk you into an esp32 Then you can send data to the display over wifi

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

// Hardware SPI:
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 3

// Create a new instance of the MD_MAX72XX class:
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
  // Intialize the object:
  myDisplay.begin();
  // Set the intensity (brightness) of the display (0-15):
  myDisplay.setIntensity(0);
  // Clear the display:
  myDisplay.displayClear();
  myDisplay.setTextAlignment(PA_CENTER);
  myDisplay.print("Ralphie");
}

void loop() {
}

Hello

This is my problem hardware type FC16 not parolla for the hello world example

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

Probably not! I've used too many different sorts of microcontroller already. My brain is full :slight_smile:
I have an Arduino Nano. I might try that next.

It works on my Nano! (And doesn't need pull-up resistors or CLK_PIN or DATA_PIN defined.)
I guess the SPI on my Uno is dodgy. (I'll stick a label on it.)
Why it worked on the Uno without 5V being connected to the display will remain a mystery!
Thanks for all your suggestions, papalanc.

Congrats on the nano !
A Wemos D1 R32 would really not be a learning curve. It even looks like a UNO. Just select it as the device in Arduino IDE. It may even be cheaper than an UNO.

There is an example for MAX72XX_Message_ESP32 that creates a web page so you can send msgs to the board. So much more fun when you can send stuff to it from afar :slight_smile:

And thanks @marco_c for all the great examples !

I have seen this also. There is some kind of leakage between the signal pins and the power supply for the chip. Obviously, not recommended to run it this way as the digital I/O pins are not built to provide contunuous power.

I was experiencing this same problem, and found the solution to be slowing down the SPI bus. I reached out to @marco_c in a private message, which he answered, so I have quoted his response to me above.

If you look at the documentation for the MAX7219, it states that it is susceptible to this type of EMI and the solution is the MAX7221, but the modules are cheap and easy to obtain, so it costs too much for the MAX7221 chips.... I slowed down the SPI bus to as slow as it can go...

_spiRef.beginTransaction(SPISettings(125000, MSBFIRST, SPI_MODE0));
1 Like