# Max7219 - LED Matrix 8x8 (4 Stk.)

**URL:** <https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487>\
**Category:** Deutsch\
**Created:** [October 26, 2024, 3:35pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487 "2024-10-26T15:35:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![janiiix3](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/janiiix3/32/1125615_2.png) [@janiiix3](https://forum.arduino.cc/u/janiiix3)\
**Post date:** [October 26, 2024, 3:35pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/1 "2024-10-26T15:35:04Z")

</div>

Hallo Community,

hat jemand hier schon Erfahrungen mit den LED Anzeigen machen können?  
Ich habe diese Boards vom freundlichen bekommen -\>[\>\> LINK \<\<](https://www.amazon.de/Hailege-Matrix-Display-Arduino-Microcontroller/dp/B07YWRZ3FC/ref=sr_1_17?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=2THNO2ZQ5PMOB&dib=eyJ2IjoiMSJ9.kk23VAtieSHYe5vo7RECgiXY5Y9hy5fCbl2rScsAJwDgVoCsg9z5nrHlNeKYc2HyHx9B--1xdRV2o8nlsW2KtO60j0LU6VLoBwsA7fjYPtLfglzU9K-shDRd_YC86Uk27fAPinSZuuDT-GALAC7mk5wATRkM5q2ivrN8DIRwjHRXNdNfuvSyTZW6Mfoe8LwDM9gLj8fJxcWZloIwqyKQdck-e0UbG3iQTCIzs8iUkIhQnUjp3NP6sUCMu4eT6CqQL3RwLwZKJXPstN40dc_sOM1Et52EiNa210zEgIrLRXY.5gjpOsm5algoJ5ghrMsL8MJSCpzdLrHXf5zs4DUa4L8&dib_tag=se&keywords=led+matrix&qid=1729956709&sprefix=led+matrix%2Caps%2C107&sr=8-17)

Nun versuche ich vergebens mal etwas anzeigen zu lassen. Mal funktioniert es mal funktioniert es nicht richtig..

Das ganze habe ich auf einem ESP32C3 (SuperMini Board) getestet.  
Sicherheitshalber habe ich an die I/O´s LED´s angeschlossen um sicher zu gehen das sie auch das tun was ich verlange 😛

Hat jemand eine Idee woran das liegen könnte?

```arduino
enum _MAX7219_REGS
{
    NO_OP,
    DIGIT_0,
    DIGIT_1,
    DIGIT_2,
    DIGIT_3,
    DIGIT_4,
    DIGIT_5,
    DIGIT_6,
    DIGIT_7,
    DECODE_MODE,
    INTENSITY,
    SCAN_LIMIT,
    SHUTDOWN,
    DISPLAY_TEST = 0x0F
};

enum _MAX7219_SHUTDOWN
{
    SHUTDOWN_MODE,
    NORMAL_OPERATION
};

enum _MAX7219_DECODE_MODE
{
    MODE_1,
    MODE_2,
    MODE_3 = 0x0F,
    MODE_4 = 0xFF
};

enum _MAX7219_INTENSITY
{
    INTENSITY_1_32,
    INTENSITY_3_32,
    INTENSITY_5_32,
    INTENSITY_7_32,
    INTENSITY_9_32,
    INTENSITY_11_32,
    INTENSITY_13_32,
    INTENSITY_15_32,
    INTENSITY_17_32,
    INTENSITY_19_32,
    INTENSITY_21_32,
    INTENSITY_23_32,
    INTENSITY_25_32,
    INTENSITY_27_32,
    INTENSITY_29_32,
    INTENSITY_31_32,
};

enum _MAX7219_SCAN_LIMIT
{
    SL_DIGIT_0,
    SL_DIGIT_0_1,
    SL_DIGIT_0_1_2,
    SL_DIGIT_0_1_2_3,
    SL_DIGIT_0_1_2_3_4,
    SL_DIGIT_0_1_2_3_4_5,
    SL_DIGIT_0_1_2_3_4_5_6,
    SL_DIGIT_0_1_2_3_4_5_6_7,
};

#define MAX7219_BUILD_WORD(addr, cmd) (uint16_t)( ( addr << 8 ) | cmd )
#define MAX7219_GPIO_DOUT_PIN 0
#define MAX7219_GPIO_CS_PIN 1
#define MAX7219_GPIO_CLK_PIN 2
#define DISPLAY_SIZE 4

struct Digit
{
    uint8_t Addr;
    uint8_t Data[8];
};

void setup() {

  GPIO_FUNC0_OUT_SEL_CFG_REG |= 0x80;
  GPIO_FUNC1_OUT_SEL_CFG_REG |= 0x80;
  GPIO_FUNC2_OUT_SEL_CFG_REG |= 0x80;
  GPIO_FUNC8_OUT_SEL_CFG_REG |= 0x80;

  GPIO_ENABLE_REG |= (1<<0 | 1<<1 | 1<<2 | 1<<8);

  Max7219_Init();

}

void loop() {

  test();

}

void Max7219_CS_High()
{
  GPIO_OUT_REG |= 1<<MAX7219_GPIO_CS_PIN;
}

void Max7219_CS_Low()
{
  GPIO_OUT_REG &= ~1<<MAX7219_GPIO_CS_PIN;
}

void Max7219_Send( uint16_t Data )
{
    for ( uint8_t i = 0 ; i < 16; i++ )
    {
        GPIO_OUT_REG |= 1<<MAX7219_GPIO_CLK_PIN;
        
        if ( Data & 0x8000 )
        {
            GPIO_OUT_REG |= 1<<MAX7219_GPIO_DOUT_PIN;
        }
        else
        {
            GPIO_OUT_REG &= ~1<<MAX7219_GPIO_DOUT_PIN;
        }

        GPIO_OUT_REG &= ~1<<MAX7219_GPIO_CLK_PIN; 

        Data <<= 1;  
    }
}

void Max7219_Init()
{
  struct Digit Cnfg[4];

  Cnfg[0].Addr = DECODE_MODE;
  Cnfg[0].Data[0] = MODE_1;

  Cnfg[1].Addr = INTENSITY;
  Cnfg[1].Data[0] = INTENSITY_1_32;

  Cnfg[2].Addr = SCAN_LIMIT;
  Cnfg[2].Data[0] = SL_DIGIT_0_1_2_3_4_5_6_7;

  Cnfg[3].Addr = SHUTDOWN;
  Cnfg[3].Data[0] = NORMAL_OPERATION;

  Cnfg[4].Addr = DISPLAY_TEST;
  Cnfg[4].Data[0] = 0;

  
  for ( uint8_t x = 0 ; x < 4 ; x++ )
  {
      Max7219_CS_Low();
      Max7219_Send( MAX7219_BUILD_WORD( Cnfg[x].Addr , Cnfg[x].Data[0] ) );
      Max7219_CS_High();
  }
  

  for (uint8_t x = 0 ; x < 8 ; x++ )
  {
    Cnfg[x].Addr = DIGIT_0 + x;

    for (uint8_t y = 0 ; y < 8 ; y++ )
    {
      Cnfg[x].Data[y] = 0xc3;

      Max7219_CS_Low();
      Max7219_Send( MAX7219_BUILD_WORD( Cnfg[x].Addr, Cnfg[x].Data[y] ) );
      Max7219_CS_High();
    }
    
  }

}

void Max7219_Dsp_Test_On()
{
  Max7219_CS_Low();
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x01) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x01) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x01) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x01) );
  Max7219_CS_High();  
}

void Max7219_Dsp_Test_Off()
{
  Max7219_CS_Low();
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x00) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x00) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x00) );
  Max7219_Send( MAX7219_BUILD_WORD( DISPLAY_TEST, 0x00) );
  Max7219_CS_High();  
}

void test()
{
  struct Digit Cnfg[4];

  for (uint8_t x = 0 ; x < 8 ; x++ )
  {
    Cnfg[x].Addr = DIGIT_0 + x;

    Max7219_CS_Low();
    for (uint8_t y = 0 ; y < 8 ; y++ )
    {
      Cnfg[x].Data[y] = 0x00;
      Max7219_Send( MAX7219_BUILD_WORD( Cnfg[x].Addr, Cnfg[x].Data[y] ) );
    }
    Max7219_CS_High();
  }
}

```

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [October 26, 2024, 5:43pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/2 "2024-10-26T17:43:53Z")

</div>

> [@janiiix3](#):
>
> Mal funktioniert es mal funktioniert es nicht richtig..

Verwenden Sie Worte.

Verwenden Sie auch den "common" Pin der Matrizen richtig? Liefern Sie ausreichend Strom?

---

<div class="post-metadata">

**Author:** ![janiiix3](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/janiiix3/32/1125615_2.png) [@janiiix3](https://forum.arduino.cc/u/janiiix3)\
**Post date:** [October 26, 2024, 5:57pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/3 "2024-10-26T17:57:57Z")

</div>

Es ist ein fertiges PCB.  
Ich habe lediglich: SCK, DATA, CS angeschlossen.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 26, 2024, 6:13pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/4 "2024-10-26T18:13:28Z")

</div>

This is an English-only section of the forum. All posts and all replies should be in English. I will move this topic to the appropriate section for German. Please read the forum guide in the sticky posts before more rules get broken.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [October 26, 2024, 6:16pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/5 "2024-10-26T18:16:21Z")

</div>

Beschreiben Sie das gewünschte Ergebnis und das beobachtete Ergebnis.

Describe your desired result and your observed result.

---

<div class="post-metadata">

**Author:** ![kolaha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kolaha/32/966427_2.png) [@kolaha](https://forum.arduino.cc/u/kolaha)\
**Post date:** [October 26, 2024, 6:23pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/6 "2024-10-26T18:23:50Z")

</div>

> [@janiiix3](#):
>
> Ich habe lediglich: SCK, DATA, CS angeschlossen.

5V und GND ?

---

<div class="post-metadata">

**Author:** ![janiiix3](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/janiiix3/32/1125615_2.png) [@janiiix3](https://forum.arduino.cc/u/janiiix3)\
**Post date:** [October 26, 2024, 7:02pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/7 "2024-10-26T19:02:27Z")

</div>

Hehe, klar sonst würde ich keine LEDs von meinen Daten leuchten sehen..

---

<div class="post-metadata">

**Author:** ![uwefed](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/uwefed/32/213736_2.png) [@uwefed](https://forum.arduino.cc/u/uwefed)\
**Post date:** [October 26, 2024, 8:18pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/8 "2024-10-26T20:18:27Z")

</div>

Hier könnte nicht die Lösung versteckt sein?

> [@\[SOLVED\] Arduino Uno mit LED Matrix](https://forum.arduino.cc/t/solved-arduino-uno-mit-led-matrix/1314731):
>
> Heyhey! Ich versuche, meinen Nano mit einer 8x32 LED-Matrix zum Laufen zu bringen. Ich habe viele Versionen der Arduino IDE ausprobiert. Im Moment arbeite ich mit der Version 2.3.3. Ich verwende die Libraries Md\_parola (3.7.3) und MD\_Max72xx (3.5.1). Manchmal wird der Port, an dem mein Arduino angeschlossen ist nicht angezeigt, sobald ich ihn von der LED Matrix trenne, wird sie ab und an erkannt. Wenn ich den Code hochlade, leuchten nur zwei der 4 Matrixen und einige einzelne LED's Hier ist de…

Grüße Uwe

---

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [October 26, 2024, 8:59pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/9 "2024-10-26T20:59:56Z")

</div>

ist ja eine interessante Übung das ganze SPI-Bus Bitbanging zu Fuß zu Programmieren.

Ich benutze dafür fertige Bibliotheken.

Hier ein Demo-Code der von dem Beispiel auf das uwefed verlinkt hat abgeleitet ist.

Seltsamerweise werden die Buchstaben seitenverkehrt angezeigt.  
Da muss man den SPI-Bus des ESP32-C3 wohl irgendwie umkonfigurieren.

Es tut sich aber auf jedenfall etwas auf dem Display

> **[MAX7219-Test - Wokwi ESP32, STM32, Arduino Simulator](https://wokwi.com/projects/412840362362850305)**
>
> Run IoT and embedded projects in your browser: ESP32, STM32, Arduino, Pi Pico, and more. No installation required!

---

<div class="post-metadata">

**Author:** ![pucki007](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pucki007](https://forum.arduino.cc/u/pucki007)\
**Post date:** [October 27, 2024, 2:49pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/10 "2024-10-27T14:49:12Z")

</div>

Für das Teil gibt es eine prima LIBs.

> **[GitHub - MajicDesigns/MD\_MAX72XX: LED Matrix Library](https://github.com/MajicDesigns/MD_MAX72XX)**
>
> LED Matrix Library

Beachte das du bei den Beispielen max-device auf 4 setzen musst, da dein Block aus 4 Teilen besteht. Die LED-Blöcke kann man nämlich verbinden und durchadressieren.

Du musst in der Ini der Libs nur einstellen das du 4 Module hast.

Fertig ist.

Gruß

Pucki

---

<div class="post-metadata">

**Author:** ![agmue](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/agmue/32/750067_2.png) [@agmue](https://forum.arduino.cc/u/agmue)\
**Post date:** [October 27, 2024, 3:40pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/11 "2024-10-27T15:40:52Z")

</div>

> [@janiiix3](#):
>
> Mal funktioniert es mal funktioniert es nicht richtig..

Mir fehlt leider eine Glaskugel, daher kann ich nur raten, daß es sich um einen Wackelkontakt oder eine mangelnde Stromversorgung handelt. Vermutlich benötigst Du ein eigenes Netzteil.

> [@StefanL38](#):
>
> Da muss man den SPI-Bus des ESP32-C3 wohl irgendwie umkonfigurieren.

Nein, mit dem SPI-Bus hat das nichts zu tun, sondern mit einer unterschiedlichen Verdrahtung der Hardware, siehe nächsten Link.

> [@pucki007](#):
>
> Du musst in der Ini der Libs nur einstellen das du 4 Module hast.

Zusätzlich eventuell noch den [Hardwaretyp](https://majicdesigns.github.io/MD_MAX72XX/page_hardware.html):

```arduino
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

```

---

<div class="post-metadata">

**Author:** ![pucki007](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pucki007](https://forum.arduino.cc/u/pucki007)\
**Post date:** [October 27, 2024, 3:43pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/12 "2024-10-27T15:43:02Z")

</div>

jepp 😉

Gruß

Pucki

---

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [October 27, 2024, 4:27pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/13 "2024-10-27T16:27:37Z")

</div>

> [@agmue](#):
>
> Zusätzlich eventuell noch den [Hardwaretyp](https://majicdesigns.github.io/MD_MAX72XX/page_hardware.html):

Also diese Dokumentationen sind unvergleichlich ... --- ... knapp.  
Wo um alles in der Welt wird jetzt dieser enumeration-type eingestellt ???

Wieso muss man dazu jetzt die lib auf "moduleType\_t" durchsuchen?  
Wieso können die nicht einfach ein paar Zeilen dazu schreiben wie und wo man das macht?

```arduino
// hardware-types
// GENERIC_HW Use 'generic' style hardware modules commonly available.
// FC16_HW Use FC-16 style hardware module.
// PAROLA_HW Use the Parola style hardware modules.
// ICSTATION_HW Use ICStation style hardware module.

#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW //FC16_HW

```

---

<div class="post-metadata">

**Author:** ![janiiix3](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/janiiix3/32/1125615_2.png) [@janiiix3](https://forum.arduino.cc/u/janiiix3)\
**Post date:** [October 27, 2024, 5:40pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/14 "2024-10-27T17:40:37Z")

</div>

Ich konnte es selbst lösen.  
Es lag einfach daran das ich zu viele Bytes gesendet hatte.  
Danke an alle 👍

---

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [October 27, 2024, 6:35pm UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/15 "2024-10-27T18:35:55Z")

</div>

> [@janiiix3](#):
>
> Ich konnte es selbst lösen.  
> Es lag einfach daran das ich zu viele Bytes gesendet hatte.

Poste als Dankeschön noch den funktionierenden Sketch als Coe-section und markiere den thread als gelöst.

---

<div class="post-metadata">

**Author:** ![janiiix3](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/janiiix3/32/1125615_2.png) [@janiiix3](https://forum.arduino.cc/u/janiiix3)\
**Post date:** [November 3, 2024, 8:38am UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/16 "2024-11-03T08:38:37Z")

</div>

[ESP32C3\_GPIO.ino](https://forum.arduino.cc/uploads/short-url/4Q91YgKBvTyKUVL35CcjI3WUz51.ino) (17,9 KB)  
Anbei der Code.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 2, 2025, 8:39am UTC](https://forum.arduino.cc/t/max7219-led-matrix-8x8-4-stk/1315487/17 "2025-05-02T08:39:02Z")

</div>

Closed on May 2, 2025, 8:39am UTC

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