Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P5 RVB 64x32 1/8 scan with ICN2038S controller... and mess! #500

Open
veryslow opened this issue Sep 13, 2023 · 21 comments
Open

P5 RVB 64x32 1/8 scan with ICN2038S controller... and mess! #500

veryslow opened this issue Sep 13, 2023 · 21 comments
Labels
weird panel Looks like yet another panel type that isn't 1/16 or 1/32 ABCD addressed.

Comments

@veryslow
Copy link

Hi,
I'm fabrice and trying to deal with panels that I received from eagerled.
They are P5 RVB 64x32 1/8 scan with ICN2038S controller, and seem to act as double 64x16 panels...

I did not notice that they were 1/8 scan and I've been digging for 2 weeks with an ESP32 WROOM trying every combinations in the library, changing pins, adjusting variables without any success yet.
The panels are functionnal, I have a HD-D16 asynchronous controller from HUIDU that works well and gives me technical datas on the panel structure (see screen captures below). Nevertheless, I cannot manage to show any line without messy blocks...

I've been following this feed, with no success...
I'm an amateur programmer with some skills but the library is a bit to complex for me to manage and modify it for my needs.

I also wonder if my pin configuration is ok, considering some pin limits in the ESP32 (I tried different ones based on default pins configurations from library), the actuel one is :
#define A_PIN 23
#define B_PIN 19
#define C_PIN 5
#define D_PIN -1
#define E_PIN -1

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

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

here are pictures frome the huidu configuration software that may help and 4 pictures of the panel itself.
I plan to create A 6 panels linear display to make scrolling texts updated by wifi for a theatre company (begat.org).

Thanks by advance of any help, I've been almost pulling all my hair!

face_1200
back_1200
back_zoom_1200
panel_configuration
panel_structure
back_zoom_HUB75_1200

@board707
Copy link
Contributor

They are P5 RVB 64x32 1/8 scan with ICN2038S controller,

Every panel contains at least two types of chips, the ICN2038 is only one from it. Knowing the second chip type is required to handle the matrix properly. Please try to read the headings in the other chips on the panel.

here are pictures from the huidu configuration software that may help

Is the panel works with this config?

@veryslow
Copy link
Author

Hi, thanks for your answer.
Yes, the panel works well with this config, It comes with a config file from the manufacturer (here is the xml file also).
P5-8S-64X32-SM16208-512X32-4KAI.ssx.zip

and checking the chips, I see that the ICN2038 is in fact a SM16208S and the other chip is a MW245B.

thkx!

fabrice

@board707
Copy link
Contributor

board707 commented Sep 14, 2023

I see that the ICN2038 is in fact a SM16208S and the other chip is a MW245B.

No, the MW245B is not "the other chip" of the interest, it is just a buffer. Your panel should contains yet another driver.

But it is not so important already. According to screenshot of the huidu software configuration screen, the panel has a standard drivers, supported by the library. All what you need - correct transform of the pixel coordinates.

I'm sorry, but I can't offer you more useful advice, since I have no experience working with complex matrices in this library

@mrcodetastic
Copy link
Owner

The best bet is to simply make a script that draws a pixel to y coordinate zero, x coordinate 0, 1, 2 etc, and then repeat the same for Y coordinate one, X coordinate 0, one, 2 etc and etc.

From this you might be able to reverse engineer the pixel mapping approach to the panel, there's so many permutations of these panels now I don't bother even coding for them anymore, as long as it works electrically, it's a waste of time.

@veryslow
Copy link
Author

Thank you very much for your answers,

If I manage to understand the panel permutations, where in the code could I implement that specificity?
I was thinking of make a correspondance map or algorithm but I don't even know where to insert it in the library...
COUld you give me some guidelines if it's not too tricky?

thank you,
fabrice

@board707
Copy link
Contributor

there's so many permutations of these panels now I don't bother even coding for them anymore, as long as it works electrically, it's a waste of time.

In most cases the mapping is not more than two-three lines of code.
So far, I have been able to find transformations for all the matrices that came to me - as long as their drivers were compatible with the code. Although sometimes this process may be quite tricky :)

@board707
Copy link
Contributor

@veryslow
Do as @mrfaptastic advises - run an example with filling the panel with one color pixel by pixel along horizontal lines and post a video of this process. Perhaps I can advise you something

@veryslow
Copy link
Author

veryslow commented Sep 16, 2023

Thank you very much for your answers,

I run this code (you know it!) with a pause 1000ms tu understand what happens with the pixels inrelation with the coordinates...
It seems that pixels are writing one on each others, adding their brightness...

led01.mp4

 // default pins: 
  #define A_PIN  23
  #define B_PIN  19
  #define C_PIN  5
  #define D_PIN  -1
  #define E_PIN  -1
  
  #define R1_PIN  25
  #define R2_PIN  14
  #define G1_PIN  26
  #define G2_PIN  12
  #define B1_PIN  27
  #define B2_PIN  13
  
  #define LAT_PIN 4
  #define OE_PIN  15
  #define CLK_PIN 16

  // Panel configuration
  #define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module. 
  #define PANEL_RES_Y 32 // 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
  
  // ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
    
  // Change this to your needs, for details on VirtualPanel pls read the PDF!
  #define SERPENT false
  #define TOPDOWN false
  
  // placeholder for the matrix object
  MatrixPanel_I2S_DMA *dma_display = nullptr;
  
  /******************************************************************************
   * Setup!
   ******************************************************************************/
  void setup()
  {
    delay(250);
   
    Serial.begin(115200);
    Serial.println(""); Serial.println(""); Serial.println("");
    Serial.println("*****************************************************");
    Serial.println("*         1/4 Scan Panel                            *");
    Serial.println("*****************************************************");
  
  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,              // DO NOT CHANGE THIS
                PANEL_RES_Y,              // DO NOT CHANGE THIS
                NUM_ROWS*NUM_COLS           // DO NOT CHANGE THIS
                //,_pins            // Uncomment to enable custom pins
    );
    mxconfig.driver = HUB75_I2S_CFG::ICN2038S;  
    mxconfig.latch_blanking=1;
    mxconfig.clkphase = false; // Change this if you see pixels showing up shifted wrongly by one column the left or right.
    // OK, now we can create our matrix object
    mxconfig.i2sspeed =HUB75_I2S_CFG::HZ_20M;

    dma_display = new MatrixPanel_I2S_DMA(mxconfig);
  
    // let's adjust default brightness to about 75%
    dma_display->setBrightness8(10);    // range is 0-255, 0 - 0%, 255 - 100%
  
    // Allocate memory and start DMA display
    if( not dma_display->begin())
      Serial.println("****** !KABOOM! I2S memory allocation failed ***********");

    dma_display->clearScreen();
    delay(500);

   }

  void loop() 
  {
      uint16_t color = dma_display->color565(50, 50,50); //blue
      
      for (int i = 0; i < PANEL_RES_X; i++)
     // for (int i = 0; i <128; i=i+2)
      {
         for (int f = 0; f < PANEL_RES_Y; f++)
       //for (int f = 0; f < 64; f=f+1)
        {
            dma_display->drawPixel(i,f, color);
            Serial.print("drawPixel: ");
            Serial.print("(");
            Serial.print(i, DEC);
            Serial.print(",");
            Serial.print(f, DEC);
            Serial.println(")");
            delay(1000);
          }
      }
      delay(5000);
      dma_display->clearScreen();

  } // end loop```

@veryslow
Copy link
Author

and here it is at normal speed (with a 10ms pause between each iteration).

20230916_105242_720p.mp4

@board707
Copy link
Contributor

You do it in incorrect order, the first (outer) loop should be by Y direction and the inner loop by X.

According to the video your problem is not (or not only) with geometry. You have a problem with multiplexing - either with your ABC connections or with multiplexor chip. I have to ask you again to find the ID of all the chips on the matrix.

(Excuse my English, I don't have a translator on the phone)

@veryslow
Copy link
Author

Hi,
after cutting, sanding and varnish dilution, I've found the hidden ICN2012!
ANd here is the video with the panel running the good x,y loop!

ICN2012_1200

20230916_143452_edit.mp4

@board707
Copy link
Contributor

Thank you for uploading the new video. But the conclusion still the same - you have a multiplexing problem. Look to the picture - the panel is filled in by two lines with two lines gaps between it. It looks like the C pin is not worked or not connected.

@veryslow
Copy link
Author

Thank you! I did this mistake while soldering and soldering wires again and again!
Now I can fill the complete surface, that's great, but still lost with messy display.

If I want a complete horizontal line, I have to define a 128 wide panel forr 16 high...

20230916_165916_edit.mp4

@board707
Copy link
Contributor

Perfect !
Now you are ready to tune a pixel mapping to your panel.

@veryslow
Copy link
Author

veryslow commented Sep 16, 2023

Yes! Can yout tell me where int the library I can tune this mapping?
I did a new test ans realised that the panel seems considered as a 128x16 ...

With an adaptated code, I get a full-filled screen, with an organisation of pixels like in the sreen capture I posted before...
The thing is that I don't know where to program a mapping translation...

20230916_172613_edit.mp4
20230916_172754_edit.mp4

 // default pins: 
  #define A_PIN  23
  #define B_PIN  19
  #define C_PIN  5
  #define D_PIN  -1
  #define E_PIN  -1
  
  #define R1_PIN  25
  #define R2_PIN  14
  #define G1_PIN  26
  #define G2_PIN  12
  #define B1_PIN  27
  #define B2_PIN  13
  
  #define LAT_PIN 4
  #define OE_PIN  15
  #define CLK_PIN 16

  // Panel configuration
  #define PANEL_RES_X 128 // Number of pixels wide of each INDIVIDUAL panel module. 
  #define PANEL_RES_Y 16 // 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
  
  // ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
    
  // Change this to your needs, for details on VirtualPanel pls read the PDF!
  #define SERPENT false
  #define TOPDOWN false
  
  // placeholder for the matrix object
  MatrixPanel_I2S_DMA *dma_display = nullptr;
  
  /******************************************************************************
   * Setup!
   ******************************************************************************/
  void setup()
  {
    delay(250);
   
    Serial.begin(115200);
    Serial.println(""); Serial.println(""); Serial.println("");
    Serial.println("*****************************************************");
    Serial.println("*         1/4 Scan Panel                            *");
    Serial.println("*****************************************************");
  
  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,              // DO NOT CHANGE THIS
                PANEL_RES_Y,              // DO NOT CHANGE THIS
                NUM_ROWS*NUM_COLS           // DO NOT CHANGE THIS
                //,_pins            // Uncomment to enable custom pins
    );
    mxconfig.driver = HUB75_I2S_CFG::SHIFTREG;  
    mxconfig.latch_blanking=1;
    mxconfig.clkphase = false; // Change this if you see pixels showing up shifted wrongly by one column the left or right.
    // OK, now we can create our matrix object
    mxconfig.i2sspeed =HUB75_I2S_CFG::HZ_10M;

    dma_display = new MatrixPanel_I2S_DMA(mxconfig);
  
    // let's adjust default brightness to about 75%
    dma_display->setBrightness8(10);    // range is 0-255, 0 - 0%, 255 - 100%
  
    // Allocate memory and start DMA display
    if( not dma_display->begin())
      Serial.println("****** !KABOOM! I2S memory allocation failed ***********");

    dma_display->clearScreen();
    delay(500);

   }

  void loop() 
  {
      uint16_t color = dma_display->color565(50, 50,50); //blue
      
      for (int y = 0; y < PANEL_RES_Y; y++)
     // for (int i = 0; i <128; i=i+2)
      {
         for (int x = 0; x < PANEL_RES_X; x++)
       //for (int f = 0; f < 64; f=f+1)
        {
            dma_display->drawPixel(x,y, color);
            Serial.print("drawPixel: ");
            Serial.print("(");
            Serial.print(x, DEC);
            Serial.print(",");
            Serial.print(y, DEC);
            Serial.println(")");
            delay(100);
          }
      }
      delay(5000);
      dma_display->clearScreen();

  } // end loop```

@board707
Copy link
Contributor

Can yout tell me where int the library I can tune this mapping?

This is a question to the author, @mrfaptastic

@veryslow
Copy link
Author

Hi, after a lot of tests, I finally switched to hzeller library for Raspberry pi...
I wrote a scrappy algorithm to map the pixels for this P5 panel. I understood that the relevent thing is that they ae OUTDOOR panels with strange mapping... I did not consider this caracteristic as pertinent but it was apparently central.

here is the code for mapping in hzeller's library (If it can help anyone with thi s kinf of panels)
Panels are adressed as 128x16 matrix, and the code converts 64x32 coordinates to this 128x16 esoteric structure!

void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
    int pix_nb = x+(y*64);
    *matrix_x = ((((pix_nb%64)/4)+1)*8)-((((pix_nb%1024)/512)+1)*4)+(pix_nb%4);
    *matrix_y = ((pix_nb/64)%8)+((pix_nb/1024)*8);
 

I'm still interested in the way I could implement this code in ESP32-HUB75-MatrixPanel-DMA library!

Thanks for all your answers, and I come back in this issue if I find a way to do it with ESP32.

@board707
Copy link
Contributor

board707 commented Sep 18, 2023

Panels are adressed as 128x16 matrix, and the code converts 64x32 coordinates to this 128x16 esoteric structure!

Addressing the matrix as different size is not seems correct for me. Does this transform supports a chaining for more than one panel?

If you ready to change your main board to rp2040 or stm32, I could help you with your panels.

@veryslow
Copy link
Author

Yes, no problem with chaining after remapping!

@board707
Copy link
Contributor

Perfect

@mrcodetastic
Copy link
Owner

mrcodetastic commented Sep 18, 2023

Yes! Can yout tell me where int the library I can tune this mapping?

Look at the Chained Panels example (Virtual Matrix Panel) for examples.

These panels seem to act like thinner chained panels within....can use the Virtual Matrix Panel class to either use an existing mapping that might work or add another option.

@mrcodetastic mrcodetastic added the weird panel Looks like yet another panel type that isn't 1/16 or 1/32 ABCD addressed. label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
weird panel Looks like yet another panel type that isn't 1/16 or 1/32 ABCD addressed.
Projects
None yet
Development

No branches or pull requests

3 participants