mrcodetastic / ESP32-HUB75-MatrixPanel-DMA

An Adafruit GFX Compatible Library for the ESP32, ESP32-S2, ESP32-S3 to drive HUB75 LED matrix panels using DMA for high refresh rates. Supports panel chaining.
MIT License
950 stars 211 forks source link

64x64 outdoor panel SM16208SJ RUC7258D 1/16 scan problem #468

Open primus192 opened 1 year ago

primus192 commented 1 year ago

Hello. As indoor panels became too dimm for our usecase, we ordered some 64x64 outdoor SM16208SJ RUC7258D 1/16 scan panels.

https://pl.aliexpress.com/item/1005004236016729.html?spm=a2g0o.order_list.order_list_main.5.14c61c24SwIuyw&gatewayAdapt=glo2pol

I tried several configuration but only the FM6124 config gives (kinda) good result.

Here is my loop code fragment to check panel:

for(int i =0;i<=63;i++) { virtualDisp->clearScreen(); virtualDisp->drawLine(i,0,i,63,virtualDisp->color565(255, 255, 255)); virtualDisp->flipDMABuffer(); delay(50); } for(int i =0;i<=63;i++) { virtualDisp->clearScreen(); virtualDisp->drawLine(0,i,63,i,virtualDisp->color565(255, 255, 255)); virtualDisp->flipDMABuffer(); delay(50); }

sliding bar on X coordinates gives OK result but the Y lines are broken. Im attaching video:

What should i try to do to make this panels work?

https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/assets/89576620/6b99409f-23b7-4431-8e9e-b9da91c5c014

primus192 commented 1 year ago

Maybe @board707 @rigorka @mrfaptastic some of you can help me with that?

primus192 commented 1 year ago

Ok. This panel is working with 1/8 scan example with FOUR_SCAN_64PX_HIGH option. Closing as completed.

board707 commented 1 year ago

This panel is working with 1/8 scan example

Why 1/8 scan? this is 1/16 scan panel

primus192 commented 1 year ago

This panel is working with 1/8 scan example

Why 1/8 scan? this is 1/16 scan panel

Idk. The video shows wrong operation on stock 1/16 scan config. Can i do something to make it work like this?

primus192 commented 1 year ago

I think this guy had the same panel: https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/345#issuecomment-1510401192

And he used FOUR_SCAN_64PX_HIGH and it is working for him too

board707 commented 1 year ago

Ok, it looks like all this "1/8" and "1/16" not more than labels and has nothing to do with real scan pattern

primus192 commented 1 year ago

Heah. I used "1/32" scan typical indoor 64x64 panel before and it was working OK with stock configuration. Now as the 64x64 "1/16" scan outdoor panel is much brighter i leave the config snippet for people here:

#define NUM_ROWS 1
#define NUM_COLS 1

#define PANEL_RES_X 64     // Number of pixels wide of each INDIVIDUAL panel module. 
#define PANEL_RES_Y 64     // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN NUM_ROWS*NUM_COLS      // Total number of panels chained one to another
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_NONE

void setup() {
        HUB75_I2S_CFG::i2s_pins _pins = { R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN };
        HUB75_I2S_CFG mxconfig(
            PANEL_RES_X*2,              // DO NOT CHANGE THIS
            PANEL_RES_Y/2,   // height
            PANEL_CHAIN,   // chain length
            _pins,   // pin mapping
            HUB75_I2S_CFG::FM6124    // driver chip
        );
        mxconfig.i2sspeed = mxconfig.HZ_20M;
        mxconfig.min_refresh_rate = 10;
        mxconfig.double_buff = true;
        mxconfig.clkphase = false;
        dma_display = new MatrixPanel_I2S_DMA(mxconfig);
        dma_display->begin();
        virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
        virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);
        measurement.begin();
        measurement.loop();
        u8g2 = new U8G2_FOR_ADAFRUIT_GFX();
        u8g2->begin(*virtualDisp);
        redrawMatrix();
    }

look at the difference between indoor (left) and outdoor (right) panel. It is awesome!

354396015_1259302268058305_2911846604525972988_n

board707 commented 1 year ago

Can you output a text to lower half of panel? No need to post pictures, just check

primus192 commented 1 year ago

Yes of course i checked that. All pixels are working even on lower half :)

primus192 commented 1 year ago

I have chained 6 this type of panels and i cannot get second row working. Is there anything i should do or check?

board707 commented 1 year ago

What has changed since you wrote

All pixels are working even on lower half :)

?

primus192 commented 1 year ago

It was one panel now it is 2x3 panels. fillScreen is working as intended and it lights up all six panels so i assume there is a problem with pixel remapping.

board707 commented 1 year ago

I think iI read something similar in issues recently, but can't found it now... It can be a memory problem - try to decrease the colour depth

primus192 commented 1 year ago

I got my colour depth set to minimum and same chain of indoor panels are working fine so this is not a problem :)

primus192 commented 1 year ago

Ok, so to define this problem better i am posting different configurations and output of the screen using chained panels example:

First, to check if all panels are communicating with ESP32 i tried to define the chain as 1 row 6 column to create one horizontal chain. Output is kinda ok (drawDisplayTest() produce some strange green rectangles). I could calculate all coordinates and use very long cable diagonally between rows to imitate my desired matrix arrangement but i think it is not the way:

/*--------------------- RGB DISPLAY PINS -------------------------*/
#define R1_PIN 0 //25
#define G1_PIN 18 //33
#define B1_PIN 2
#define R2_PIN 14
#define G2_PIN 12
#define B2_PIN 13
#define A_PIN 23
#define B_PIN 19
#define C_PIN 5
#define D_PIN 17
#define E_PIN 32
#define LAT_PIN 4
#define OE_PIN 15
#define CLK_PIN 16
#define BUTTON 39
/*--------------------- MATRIX LILBRARY CONFIG -------------------------*/

#define NUM_ROWS 1
#define NUM_COLS 7
#define PANEL_RES_X 64     // Number of pixels wide of each INDIVIDUAL panel module. 
#define PANEL_RES_Y 64     // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN NUM_ROWS*NUM_COLS      // Total number of panels chained one to another

#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_NONE
  /* Configure the serpetine chaining approach. Options are:
        CHAIN_TOP_LEFT_DOWN
        CHAIN_TOP_RIGHT_DOWN
        CHAIN_BOTTOM_LEFT_UP
        CHAIN_BOTTOM_RIGHT_UP
*/
#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>
MatrixPanel_I2S_DMA* dma_display = nullptr;
VirtualMatrixPanel* virtualDisp = nullptr;
void redrawMatrix() {

  // So far so good, so continue
  virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
  //virtualDisp->drawDisplayTest(); // draw text numbering on each screen to check connectivity

 // delay(1000);

   // draw blue text
   virtualDisp->setFont(&FreeSansBold12pt7b);
   virtualDisp->setTextColor(virtualDisp->color565(0, 0, 255));
   virtualDisp->setTextSize(3); 
   virtualDisp->setCursor(0, virtualDisp->height()- ((virtualDisp->height()-45)/2));    
   virtualDisp->print("ABCD");

   // Red text inside red rect (2 pix in from edge)
   virtualDisp->drawRect(1,1, virtualDisp->width()-2, virtualDisp->height()-2, virtualDisp->color565(255,0,0));

   // White line from top left to bottom right
   virtualDisp->drawLine(0,0, virtualDisp->width()-1, virtualDisp->height()-1, virtualDisp->color565(255,255,255));

   virtualDisp->drawDisplayTest(); // re draw text numbering on each screen to check connectivity
}

void setup() {
    HUB75_I2S_CFG::i2s_pins _pins = { R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN };
    HUB75_I2S_CFG mxconfig(
        PANEL_RES_X*2,              // DO NOT CHANGE THIS
        PANEL_RES_Y/2,   // height
        PANEL_CHAIN,   // chain length
        _pins,   // pin mapping
        HUB75_I2S_CFG::FM6124    // driver chip
    );
    mxconfig.i2sspeed = mxconfig.HZ_20M;
    mxconfig.min_refresh_rate = 10;
    mxconfig.clkphase = false;
    mxconfig.setPixelColorDepthBits(3);
    dma_display = new MatrixPanel_I2S_DMA(mxconfig);
    dma_display->begin();
    virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
    virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);
    redrawMatrix();
    }

358491944_1197923630989349_7243904198756397524_n

Now i change matrix type to 2x3 as intended and define chain type as TOP_LEFT_DOWN: 358520915_954597259082011_3020889284137223974_n

As You can see half of the matrix with ABC letters is kinda ok. The virtualDisp->drawDisplayTest(); produces some strange green lines on the other row.

mrcodetastic commented 1 year ago

Can you test the chain without using the Virtual display class please?

Use it as a normal 64x6 length chain of panels.

If all coords between 0,0 and 63, 383 display in the right spot, then it's not hardware related and is an issue with the virtual display class or something.

primus192 commented 1 year ago

Hi. I tested that already. It works even when i use virtualDisplay class as 1 row 6 columns configuration (one long horizontal display) and i can use coords X 0-383 Y 0-63, so the problem is with more than one row chaining of these panels.

As a workaround i mimicked the panel is 64x384, connected the rows with long diagonal cable and recalculated second row coordinates by subtracting 64 from Y axis and adding 192 to X axis.. But it creates problems with text wrapping that is longer than 192 pixels of course.

EDIT: VirtualMatrixPanel is needed to setPhysicalPanelScanRate to FOUR_SCAN_64PX_HIGH so there is a need to use it.

primus192 commented 1 year ago

Code with 1x6 matrix config:


/*--------------------- RGB DISPLAY PINS -------------------------*/
#define R1_PIN 0 //25
#define G1_PIN 18 //33
#define B1_PIN 2
#define R2_PIN 14
#define G2_PIN 12
#define B2_PIN 13
#define A_PIN 23
#define B_PIN 19
#define C_PIN 5
#define D_PIN 17
#define E_PIN 32
#define LAT_PIN 4
#define OE_PIN 15
#define CLK_PIN 16
#define BUTTON 39
/*--------------------- MATRIX LILBRARY CONFIG -------------------------*/

#define NUM_ROWS 1
#define NUM_COLS 6
#define PANEL_RES_X 64     // Number of pixels wide of each INDIVIDUAL panel module. 
#define PANEL_RES_Y 64     // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN NUM_ROWS*NUM_COLS      // Total number of panels chained one to another

#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_NONE
  /* Configure the serpetine chaining approach. Options are:
        CHAIN_TOP_LEFT_DOWN
        CHAIN_TOP_RIGHT_DOWN
        CHAIN_BOTTOM_LEFT_UP
        CHAIN_BOTTOM_RIGHT_UP
*/
#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>
MatrixPanel_I2S_DMA* dma_display = nullptr;
VirtualMatrixPanel* virtualDisp = nullptr;
void redrawMatrix() {

  // So far so good, so continue
  virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
  //virtualDisp->drawDisplayTest(); // draw text numbering on each screen to check connectivity

 // delay(1000);

   // draw blue text
   virtualDisp->setFont(&FreeSansBold12pt7b);
   virtualDisp->setTextColor(virtualDisp->color565(0, 0, 255));
   virtualDisp->setTextSize(3); 
   virtualDisp->setCursor(0, virtualDisp->height()- ((virtualDisp->height()-45)/2));    
   virtualDisp->print("ABCD");

   // Red text inside red rect (2 pix in from edge)
   virtualDisp->drawRect(1,1, virtualDisp->width()-2, virtualDisp->height()-2, virtualDisp->color565(255,0,0));

   // White line from top left to bottom right
   virtualDisp->drawLine(0,0, virtualDisp->width()-1, virtualDisp->height()-1, virtualDisp->color565(255,255,255));

   //virtualDisp->drawDisplayTest(); // re draw text numbering on each screen to check connectivity
}

void setup() {
    HUB75_I2S_CFG::i2s_pins _pins = { R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN };
    HUB75_I2S_CFG mxconfig(
        PANEL_RES_X*2,              // DO NOT CHANGE THIS
        PANEL_RES_Y/2,   // height
        PANEL_CHAIN,   // chain length
        _pins,   // pin mapping
        HUB75_I2S_CFG::FM6124    // driver chip
    );
    mxconfig.i2sspeed = mxconfig.HZ_20M;
    mxconfig.min_refresh_rate = 10;
    mxconfig.clkphase = false;
    mxconfig.setPixelColorDepthBits(3);
    dma_display = new MatrixPanel_I2S_DMA(mxconfig);
    dma_display->begin();
    virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
    virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);
    redrawMatrix();
    }

void loop() {

}

The drawDisplayTest() produce some green lines instead of numbering the display (virtualDisplay issue?) 358508255_111011138700964_4163420930939207637_n

Result when commented virtualDisp->drawDisplayTest():

357647451_1441426759974554_4640568515527692592_n

primus192 commented 1 year ago

Code with 2x3 config bottom left up chaining:

/*--------------------- RGB DISPLAY PINS -------------------------*/
#define R1_PIN 0 //25
#define G1_PIN 18 //33
#define B1_PIN 2
#define R2_PIN 14
#define G2_PIN 12
#define B2_PIN 13
#define A_PIN 23
#define B_PIN 19
#define C_PIN 5
#define D_PIN 17
#define E_PIN 32
#define LAT_PIN 4
#define OE_PIN 15
#define CLK_PIN 16
#define BUTTON 39
/*--------------------- MATRIX LILBRARY CONFIG -------------------------*/

#define NUM_ROWS 2
#define NUM_COLS 3
#define PANEL_RES_X 64     // Number of pixels wide of each INDIVIDUAL panel module. 
#define PANEL_RES_Y 64     // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN NUM_ROWS*NUM_COLS      // Total number of panels chained one to another

#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_BOTTOM_LEFT_UP
  /* Configure the serpetine chaining approach. Options are:
        CHAIN_TOP_LEFT_DOWN
        CHAIN_TOP_RIGHT_DOWN
        CHAIN_BOTTOM_LEFT_UP
        CHAIN_BOTTOM_RIGHT_UP
*/
#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>
MatrixPanel_I2S_DMA* dma_display = nullptr;
VirtualMatrixPanel* virtualDisp = nullptr;
void redrawMatrix() {

  // So far so good, so continue
  virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
  //virtualDisp->drawDisplayTest(); // draw text numbering on each screen to check connectivity

 // delay(1000);

   // draw blue text
   virtualDisp->setFont(&FreeSansBold12pt7b);
   virtualDisp->setTextColor(virtualDisp->color565(0, 0, 255));
   virtualDisp->setTextSize(3); 
   virtualDisp->setCursor(0, virtualDisp->height()- ((virtualDisp->height()-45)/2));    
   virtualDisp->print("ABCD");

   // Red text inside red rect (2 pix in from edge)
   virtualDisp->drawRect(1,1, virtualDisp->width()-2, virtualDisp->height()-2, virtualDisp->color565(255,0,0));

   // White line from top left to bottom right
   virtualDisp->drawLine(0,0, virtualDisp->width()-1, virtualDisp->height()-1, virtualDisp->color565(255,255,255));

   //virtualDisp->drawDisplayTest(); // re draw text numbering on each screen to check connectivity
}

void setup() {
    HUB75_I2S_CFG::i2s_pins _pins = { R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN };
    HUB75_I2S_CFG mxconfig(
        PANEL_RES_X*2,              // DO NOT CHANGE THIS
        PANEL_RES_Y/2,   // height
        PANEL_CHAIN,   // chain length
        _pins,   // pin mapping
        HUB75_I2S_CFG::FM6124    // driver chip
    );
    mxconfig.i2sspeed = mxconfig.HZ_20M;
    mxconfig.min_refresh_rate = 10;
    mxconfig.clkphase = false;
    mxconfig.setPixelColorDepthBits(3);
    dma_display = new MatrixPanel_I2S_DMA(mxconfig);
    dma_display->begin();
    virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
    virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);
    redrawMatrix();
    }

void loop() {

}

Result: 358808876_944330666854998_3732434339292983612_n

My thoughts: The problem can appear because of this not taking multiple rows into account:

if (panel_scan_rate == FOUR_SCAN_64PX_HIGH)
    {
        // https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/345#issuecomment-1510401192
        if ((virt_y & 8) != ((virt_y & 16) >> 1)) { virt_y = (virt_y & 0b11000) ^ 0b11000 + (virt_y & 0b11100111); }
    }

or because of this and virtualDisplay class not knowing what to do with this hacky config

    HUB75_I2S_CFG mxconfig(
        PANEL_RES_X*2,              // DO NOT CHANGE THIS
        PANEL_RES_Y/2,   // height
        PANEL_CHAIN,   // chain length
        _pins,   // pin mapping
        HUB75_I2S_CFG::FM6124    // driver chip
    );
mrcodetastic commented 1 year ago

The problem can appear because of this not taking multiple rows into account.

Yep. This is most likely the cause of the bug.

I'll take a look some time soon.

primus192 commented 1 year ago

The problem can appear because of this not taking multiple rows into account.

Yep. This is most likely the cause of the bug.

I'll take a look some time soon.

Thank you. Feel free to ask me to test it afterwards :) i am very grateful for this lib

cmair commented 1 year ago

@primus192 I had a similar(?) issue with my 64x32 "1/8" scan panel. I found that the y-coordinate is not processed correctly. You can find my fix here.

Maybe you need to change all occurrences of virt_y to coords.y within if ((virt_y & 8) != ((virt_y & 16) >> 1)) { virt_y = (virt_y & 0b11000) ^ 0b11000 + (virt_y & 0b11100111); } as well, but I can't test that change.

primus192 commented 10 months ago

The problem can appear because of this not taking multiple rows into account.

Yep. This is most likely the cause of the bug.

I'll take a look some time soon.

Any luck checking this?

jwee1369 commented 6 months ago

Hi @primus192 , thanks for sharing your work, it looks like the one i got is similar

https://www.aliexpress.us/item/3256805543853848.html?spm=a2g0o.order_list.order_list_main.5.44921802w0wZSh&gatewayAdapt=glo2usa

but i'm getting these weird squares (attached) and nothing seems to be working, wondering if you had this problem. Also, notice mine does not have the E pin

I also tried PANEL_RES_X, and PANEL_RES_Y in the config

Appreciate your input


#define PANEL_RES_X 64      // Number of pixels wide of each INDIVIDUAL panel module. 
#define PANEL_RES_Y 64     // Number of pixels tall of each INDIVIDUAL panel module.

#define NUM_ROWS 1 // Number of rows of chained INDIVIDUAL PANELS
#define NUM_COLS 1 // Number of INDIVIDUAL PANELS per ROW
#define PANEL_CHAIN NUM_ROWS*NUM_COLS    // total number of panels chained one to another

#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_NONE

// esp32 standard
#define R1_PIN  25
#define G1_PIN  26
#define B1_PIN  27
#define R2_PIN  14
#define G2_PIN  12
#define B2_PIN  13

#define A_PIN   23
#define B_PIN   19
#define C_PIN   5
#define D_PIN   17
#define E_PIN   -1 // IMPORTANT: Change to a valid pin if using a 64x64px panel.

#define CLK_PIN 16
#define LAT_PIN 4
#define OE_PIN  15

void setup() {

  HUB75_I2S_CFG::i2s_pins _pins={R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN};
  // Module configuration
  HUB75_I2S_CFG mxconfig(
    PANEL_RES_X*2,              // DO NOT CHANGE THIS
    PANEL_RES_Y/2,
    PANEL_CHAIN,    // Chain length
    _pins, // pin mapping
    HUB75_I2S_CFG::FM6124
  );

  mxconfig.i2sspeed = mxconfig.HZ_20M;
  mxconfig.min_refresh_rate = 10;
  mxconfig.double_buff = true;
  mxconfig.clkphase = false;

  dma_display = new MatrixPanel_I2S_DMA(mxconfig);
  dma_display->begin();

  virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
  virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);
  virtualDisp->fillScreen(virtualDisp->color565(255, 0, 0));

}

IMG_3540 IMG_3541 IMG_3542

primus192 commented 6 months ago

Check the name of both ICs and let me know :)

czw., 28 mar 2024 o 01:04 jwee1369 @.***> napisał(a):

Hi @primus192 https://github.com/primus192 , thanks for sharing your work, it looks like the one i got is similar

https://www.aliexpress.us/item/3256805543853848.html?spm=a2g0o.order_list.order_list_main.5.44921802w0wZSh&gatewayAdapt=glo2usa

but i'm getting these weird squares (attached) and nothing seems to be working, wondering if you had this problem. Also, notice mine does not have the E pin

I also tried PANEL_RES_X, and PANEL_RES_Y in the config

Appreciate your input

define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.

define PANEL_RES_Y 64 // Number of pixels tall of each INDIVIDUAL panel module.

define NUM_ROWS 1 // Number of rows of chained INDIVIDUAL PANELS

define NUM_COLS 1 // Number of INDIVIDUAL PANELS per ROW

define PANEL_CHAIN NUM_ROWS*NUM_COLS // total number of panels chained one to another

define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_NONE

// esp32 standard

define R1_PIN 25

define G1_PIN 26

define B1_PIN 27

define R2_PIN 14

define G2_PIN 12

define B2_PIN 13

define A_PIN 23

define B_PIN 19

define C_PIN 5

define D_PIN 17

define E_PIN -1 // IMPORTANT: Change to a valid pin if using a 64x64px panel.

define CLK_PIN 16

define LAT_PIN 4

define OE_PIN 15

void setup() {

HUB75_I2S_CFG::i2s_pins _pins={R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN}; // Module configuration HUB75_I2S_CFG mxconfig( PANEL_RES_X*2, // DO NOT CHANGE THIS PANEL_RES_Y/2, PANEL_CHAIN, // Chain length _pins, // pin mapping HUB75_I2S_CFG::FM6124 );

mxconfig.i2sspeed = mxconfig.HZ_20M; mxconfig.min_refresh_rate = 10; mxconfig.double_buff = true; mxconfig.clkphase = false;

dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); dma_display->clearScreen();

virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE); virtualDisp->clearScreen(); virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);

virtualDisp->fillScreen(virtualDisp->color565(255, 0, 0));

}

— Reply to this email directly, view it on GitHub https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/468#issuecomment-2024175580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLNJLEB3I3AYLRHWCF7HD3Y2NM7VAVCNFSM6AAAAAAZDLB2Q6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGE3TKNJYGA . You are receiving this because you were mentioned.Message ID: @.***>

board707 commented 6 months ago

Check the name of both ICs and let me know :)

better of all IC... most likely the panel has more than two IC types

The problem can appear because of this not taking multiple rows into account:

@primus192 , did you resolved the issue? Did you try the solution by @cmair ?

jwee1369 commented 6 months ago

Hi @primus192 @board707

seems like there are 48x SM16169S (16 each on R,G,B) and 3x MW245B. Both by Shenzhen Sunmoon, trying to get the english version datasheets

could not find the datasheet for SM16169S, i reached out to the seller and they say it's SM16237

Thanks!

IMG_3557

board707 commented 6 months ago

no, there should be a third one

board707 commented 6 months ago

could not find the datasheet for SM16169S, i reached out to the seller and they say it's SM16237

These drivers are not similar at all, the 16169 seems to be S-PWM type ( incompatible with the library) , but 16237 is a normal type that should work.

Also, there must be a third IC type on the panel, try to find it.

jwee1369 commented 6 months ago

Hi @board707 , cannot seem to find the third IC, what would this third one be?

Also, how could you tell if 16169 is S-PWM type, and what would a normal type be. Just so i can look out for or ask them in the future. I'm going to return these

Thanks!

board707 commented 6 months ago

cannot seem to find the third IC, what would this third one be?

Any HUB75 panel contains two required types of the chips - i) led driver and ii) multiplexor switch. The most panels has an additional IC - buffers, mosfets etc You found SM16169S - it is a driver, and MW245B - this is a buffer. So there should be another one - a multiplexor.

how could you tell if 16169 is S-PWM type

Usually it stated in the datasheet. Unfortunately, I not found the one for 16169, I only read that the 16169 is an analog of the 16136, which is S-PWM type. The S-PWM drivers has a different work principle than used in the library. This is a new type of drivers and datasheets for most of them are a trade secret. Therefore, there is very little information about them and their development is very slow

zhoyu458 commented 5 months ago

Hi @primus192, I have a 64x64 P3 outdoor panel (1/16 scan) with FM6126A chip, I followed your configuration with a few changes of the pin number, and the panel displays correctly except that the panel can not be turned off, even though I set the brightness to 0, apply clearScreen() or doing writePixel(x, y, 0). The panel always shows an orange background color. I have tried with different drivers, i2sspeed, color depth bit, E-pin set to -1 or a valid pin.

Below is the code

define SINGLE_SCREEN_WIDTH 64

define SINGLE_SCREEN_HEIGHT 64

define SCREEN_ROW_COUNT 1

define SCREEN_COL_COUNT 1

define SCREEN_COUNT 1

HUB75_I2S_CFG mxconfig( SINGLE_SCREEN_WIDTH * 2, // module width SINGLE_SCREEN_HEIGHT / 2, // module height SCREEN_COUNT // Chain length );

mxconfig.gpio.r1 = 25; mxconfig.gpio.g1 = 26; mxconfig.gpio.b1 = 27; mxconfig.gpio.r2 = 14; mxconfig.gpio.g2 = 17; mxconfig.gpio.b2 = 13; mxconfig.gpio.a = 32; mxconfig.gpio.b = 33; mxconfig.gpio.c = 21; mxconfig.gpio.d = 15; mxconfig.gpio.e = -1; mxconfig.gpio.lat = 4; mxconfig.gpio.oe = 22; mxconfig.gpio.clk = 16; mxconfig.clkphase = false;

mxconfig.driver = HUB75_I2S_CFG::FM6126A; mxconfig.i2sspeed = mxconfig.HZ_20M; mxconfig.min_refresh_rate = 10; mxconfig.setPixelColorDepthBits(3); dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); dma_display->setBrightness8(0); virtualDisp = new VirtualMatrixPanel((*dma_display), SCREEN_ROW_COUNT, SCREEN_COL_COUNT, SINGLE_SCREEN_WIDTH, SINGLE_SCREEN_HEIGHT, CHAIN_NONE); virtualDisp->setPhysicalPanelScanRate(FOUR_SCAN_64PX_HIGH);

virtualDisp->clearScreen();

Thank you

WechatIMG14