Weird issue with 64x64 Waveshare LED panel and Arduino Mega 2560

Hello all,

First time poster and very new to the Arduino world. Working an art project and decided to use a Waveshare 64x64 LED Matrix and use an Arduino Mega 2560 as they advise in the linked wiki page. I was hoping to just hook it up, load the example, and go from there.

The problem is that after hooking it up and loading their demo code, for the first minute some of the horizontal lines are black. After about 1 minute or so everything just clears up. The Waveshare code uses the RGBmatrixPanel.cpp code, modified to support the 64 rows with extra address line. I have also contacted Waveshare support, hoping to hear back.

I modified the demo code, available at the wiki link above, to just draw a simple white diagonal line down the display, to make the problem more obvious.

Here is what it looks like for about a minute after power on:

Then, after about a minute it looks fine:

I tried different pins for the address A,B,C,D,E lines, no effect. I tried tweaking some of the timing values in the RGBmatrixPanel.cpp code, no effect.

I even tried diffing the example version of the RGBmatrixPanel.cpp with the latest from their github repo, but nothing jumped out.

Anyone have any ideas I could explore? Could this be a hardware issue with the display?

Code and a schematic might help you get help.

Make sure Arduino and matrix share a common ground.

The board uses a HUB75 connector with 2 GND pins that I connected to the Arduino as the manufacturer directed. They are powered separately though, I am using a 20W 5V supply for the matrix, and the Arduino is using its own 9V power adapter.

Six AA batteries? Three 18650 batteries?

9V AC/DC adapter - sparkfun TOL-15314. i think its the one they recommended

Okay. I will assume you did all the physical checks for human error in connections.

Not many will download zip files (some will)... so per Post #2 @anon56112670 show your work here...

ok it seems like the problem state only happens if I power on the LED matrix first. If I power on the Arduino first, then the LED matrix, it seems to work correctly right out of the gate.

So that might be the fix. Can I just run the Arduino off 5V if I put the power in via the USB port?

Yes, USB powering the Arduino is okay. Use an external power supply for the matrix (don't use the Arduino as a power supply). Be sure to share grounds so signal levels have a reference.

I wonder if the code or the hardware does not put all the LEDs into a known state. There is a pattern in the failed startup, probably reflecting each (of eight) MAX7219 connection.

@darthwilliam1118
It may be a memory issue. Your matrix has a 64x64 = 4k pixels. The RGBMatrix library allocates a buffer, in which every two pixels requires 3 bytes RAM. So for such panel you need a 6Kbytes - 75% of total RAM, availiable on Arduino Mega.
I would recomended to use a ESP32, RP2040 or STM32 board with your matrix

Perhaps. Memory is tight but I think its ok. I just can't use double buffering.

yeah probably the case. I am going to try to control power to the LED matrix using a relay board controlled by the Arduino. This would ensure the Arduino always is powered on and stable before the LED matrix comes on.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.