Go Down

Topic: Let's Share a Problem Solving of 32*32 1/4 Scan Rate LED Display Panel. (Read 4739 times) previous topic - next topic

WalidAli

Hello Everyone,

I have asked about my problem many times everywhere and I couldn't have it solved yet.
For that I decided to make this topic for everyone who wants to share and challenge solving this problem.

If you succeed with whatever please share everyone.

To participate you will only  need:

Connect as follows:
CLK    To    8 
LAT    To   10
OE     To    9
A        To    A0
B        To    A1
C        To    A2 *(I don't have it on my panel)
D        To    A3 *(I don't have it on my panel)
R1       To   2
G1       To   3
B1       To   4
R2      To   5
G2      To   6
B2      To   7
GND   To   GND

*My Panel Has only A & B Where C & D are grounded and not there.

Copy this code and paste it in new Arduino Sketch:
Code: [Select]

#include <gamma.h>
#include <RGBmatrixPanel.h>
#include <avr/pgmspace.h>

#include <Adafruit_GFX.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>



#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT 10
#define OE  9
#define A   A0
#define B   A1
#define C   A2
#define D   A3
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 2);


char inChar;                // Temp char storage
int num;
char tmpchr1;

uint64_t index = 0;
uint64_t index1 = 0;         
bool newPrint;
int r;
int g;
int b;

void setup() {
  pinMode(11,OUTPUT);
  pinMode(12,OUTPUT);
  Serial.begin(9600);
  digitalWrite(13, HIGH);
  matrix.begin();
  matrix.setTextSize(1);
  matrix.fillScreen(00);
  matrix.setTextColor(matrix.Color333(0,7,0));

  delay(100);
  matrix.print(00);
  digitalWrite(11, HIGH);
  digitalWrite(12, HIGH);
}


void loop() {
 
  // Check the availability of new input
    while(Serial.available())
    {

Loop1:
      num = Serial.parseInt();
      num = constrain(num, 0, 9999);
      Serial.print(num);

    if (num < 3)
        {
          goto Loop1;
          }

    if (num < 10)
    {
     if (num < 9)
        {
          r = 0;
          g = 7;
          b = 0;

          digitalWrite(11, HIGH);
          }     
     else
        {
          r = 7;
          g = 7;
          b = 0;
          digitalWrite(12, LOW);

          }
    }
     
     if (num > 10)
        {
          r = 7;
          g = 0;
          b = 0;
          digitalWrite(11, LOW);

          }
         
        matrix.fillScreen(matrix.Color333(0, 0, 0));    // Delete the whole panel
        matrix.setCursor(0,0);                          // Set the top left position of the first line
        matrix.setTextColor(matrix.Color333(r,g,b));
        matrix.print(num);
        if (num < 3)
        {
          matrix.fillScreen(matrix.Color333(0, 0, 0));
          digitalWrite(12, LOW);
          delay(50);
          digitalWrite(12, HIGH);
          }
       
        newPrint = false;                               // New RGB print disabled

        delay(500);
        matrix.fillScreen(matrix.Color333(0, 0, 0));
          //digitalWrite(12, LOW);
         // delay(50);
          digitalWrite(11, HIGH);
    }
    index = 0;                              // Restart the storage of characters from 0
    index1 = 0;
    //
    delay(500);
    matrix.fillScreen(matrix.Color333(0, 0, 0));
 
          digitalWrite(11, HIGH);
}


Because my project is all about getting numbers from Serial Port, for that I'm sending the numbers from the Arduino program directly from: Tools>Serial Monitor

I just write some numbers on the Serial Monitor upper text box and make sure they look good on the display panel.

You can change font size from this line ( 1, 2 or 3 )

Code: [Select]
matrix.setTextSize(1);

Now let's see what happened with me:

Typing number 4 one time with font size 1: (If not shown see attachment LED Panel1)



Typing number 4 three times with font size 1: (If not shown see attachment LED Panel2)



Typing number 4 one time with font size 2: (If not shown see attachment LED Panel3)



Have fun trying the code with your panel if it's ¼ Scan Rate
And I think it will work fine if your panel is 16x32.

Please share your experience and surprise me if it works with your 32x32 Display Panel.

If you have the (32x32 ¼ scan rate Dip Type) one which has A & B pins and no C & D,
You are more than welcome to solve this issue together,

Thank you everyone and I'm waiting for your results.

WalidAli

Here are the C++ files that modified by Ruud (Many Thanx to him) to make Adafruit_GFX_Library compatible with 1/4 Scan Mood:
*This modification worked fine with my 32*16 Dip type 1/4 LED Panel




RGBmatrixPanel.h
Code: [Select]

#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
 #include "pins_arduino.h"
#endif
#include "Adafruit_GFX.h"

class RGBmatrixPanel : public Adafruit_GFX {

 public:

  // Constructor for 16x32 panel:
  RGBmatrixPanel(uint8_t a, uint8_t b, uint8_t c,
    uint8_t sclk, uint8_t latch, uint8_t oe, boolean dbuf, uint8_t pwidth);
    /* Parameters
    a, b, c are the pins used for addressing the rows
    cclk, latch and oe are the pins used for Serial Clock, Latach and Output Enable
    dbuf enables double buffering. This will use 2x RAM for frame buffer, but will give nice smooth animation
    pwidth is the number of Panels used together in a multi panel configuration
    */

  // Constructor for 32x32 panel (adds 'd' pin): (THIS HAS NOT BEEN TESTED WITH MULTIPLE PANELS)
  RGBmatrixPanel(uint8_t a, uint8_t b, uint8_t c, uint8_t d,
    uint8_t sclk, uint8_t latch, uint8_t oe, boolean dbuf, uint8_t pwidth);

  void
    begin(void),
    drawPixel(int16_t x, int16_t y, uint16_t c),
    fillScreen(uint16_t c),
    updateDisplay(void),
    swapBuffers(boolean),
    dumpMatrix(void),
getPtrAddress(void);
  uint8_t
    *backBuffer(void);
  uint16_t
    Color333(uint8_t r, uint8_t g, uint8_t b),
    Color444(uint8_t r, uint8_t g, uint8_t b),
    Color888(uint8_t r, uint8_t g, uint8_t b),
    Color888(uint8_t r, uint8_t g, uint8_t b, boolean gflag),
    ColorHSV(long hue, uint8_t sat, uint8_t val, boolean gflag);

  // Printing
 private:

  uint8_t *matrixbuff[2];
  uint8_t nRows, nPlanes, backindex, nPanels, nMultiplexRows, nCounter;
  boolean swapflag, written;
   
  // Init/alloc code common to both constructors:
  void init(uint8_t rows, uint8_t a, uint8_t b, uint8_t c,
    uint8_t sclk, uint8_t latch, uint8_t oe, boolean dbuf, uint8_t pwidth);

  // PORT register pointers, pin bitmasks, pin numbers:
  volatile uint8_t
    *latport, *oeport, *addraport, *addrbport, *addrcport, *addrdport;
  uint8_t
    sclkpin, latpin, oepin, addrapin, addrbpin, addrcpin, addrdpin,
    _sclk, _latch, _oe, _a, _b, _c, _d;

  // Counters/pointers for interrupt handler:
  volatile uint8_t row, plane;
  volatile uint8_t *buffptr;
};





In Attachment you can find the RGBmatrixPanel.cpp, Open with Visual Studio or you can view it with Notepad. *It's too big to post the code here.

WalidAli

Someone says it's a wiring problem!!  :smiley-confuse:
I'm confused now and really can't tell why it works fine with 16*32 but not with 32*32.
Did anyone test the 1/4 modified library examples with 32*32 1/4 scan Mode?

I really need to know where I should start fixing?
Where I should look at??

Grumpy_Mike

I think your main problem is
Quote
If you have the (32x32 ¼ scan rate Dip Type) one which has A & B pins and no C & D
First off it is a fairly woolly description. Secondly the odds against anyone having exactly the same hardware are slim.

You might get more help if you provide a link to the data sheet of your display device or at least where you could buy one.

However it looks like the library you are using is simply not designed to do what you want to do, so either get one that is or if there is not one then just write the code yourself.

WalidAli

I think your main problem isFirst off it is a fairly woolly description. Secondly the odds against anyone having exactly the same hardware are slim.

You might get more help if you provide a link to the data sheet of your display device or at least where you could buy one.

However it looks like the library you are using is simply not designed to do what you want to do, so either get one that is or if there is not one then just write the code yourself.
Thank you for your advice I really wanted to make everything clear and available.
Sorry If I'm overdoing it.

Here is the link to the product: Check Here
I tryid my best to get a data sheet for but unfortunately they don't provide and they don't know what I'm talking about not even the word Arduino.

in the attachment the is a picture of what it could be 32x16 scan rate type of scanning.

Grumpy_Mike

Quote
Sorry If I'm overdoing it.
Yes I think you are.
The ¼ scan from what I can tell is just the duty cycle, that is the ratio of on to off time of any individual LED. This has nothing to do with how you drive it from software but how the device is flashing the LEDs on and off.

Quote
I tryid my best to get a data sheet for but unfortunately they don't provide and they don't know what I'm talking about not even the word Arduino.
Without a data sheet you will struggle. Basically they should not be selling a device with no data sheet and you should not be buying one from them if they can't supply a data sheet. The page dosn't even tell you how many LED clusters there is horizontally and vertically.

How are you wiring this up to the Arduino and is your external power supply up to the job?

Quote
in the attachment the is a picture of what it could be 32x16 scan rate type of scanning.
Is that what your device does? What you have drawn is a picture of an 8 by 4 row "up raster". From the pictures in your first post it looks like you don't have that because in LED Panel 2 there are 9 LEDs in a row lit, I would not expect that if the scanning was like you said.

You must approach this one step at a time, you need to establish how you can turn on any individual LED on the matrix before you can even think of displaying characters or numbers. Only when you have done this can you address how display large numbers on the whole of the display. I suspect that you can not do this with the Adafruit libraries as these are designed for a different layout.

I think you have a hard job of reverse engineering in front of you and unless you can find some one who has done it before I think you might struggle.

WalidAli


Quote
Without a data sheet you will struggle. Basically they should not be selling a device with no data sheet and you should not be buying one from them if they can't supply a data sheet.
Every time I ask them they send something not related and it seems like they don't understand What is Data sheet or Schematic so I tried to contact the original factory in Taiwan and still waiting, Original company called EPISTAR btw..

Quote
How are you wiring this up to the Arduino and is your external power supply up to the job?
CLK    To    8
LAT    To   10
OE     To    9
A        To    A0
B        To    A1
C        To    A2 *(I don't have it on my panel)
D        To    A3 *(I don't have it on my panel)
R1       To   2
G1       To   3
B1       To   4
R2      To   5
G2      To   6
B2      To   7
GND   To   GND
If that's what you mean, And the power supply is 20Amp max

Quote
You must approach this one step at a time, you need to establish how you can turn on any individual LED on the matrix before you can even think of displaying characters or numbers. Only when you have done this can you address how display large numbers on the whole of the display. I suspect that you can not do this with the Adafruit libraries as these are designed for a different layout.

This is something I modified online trying to solve it LED CHAR

and this is the code I'm using to test

Code: [Select]




uint64_t row1[128];
//uint32_t row2[32];

uint64_t temp;

int LP = 8;            // Latch Pin
int ClkP = 12;         // Clock Pin
int R1P = 11;          // R1 Pin
int B1P = 10;          // B1 Pin
int G1P = 9;           // G1 Pin
int R2P = 7;           // R2 Pin
int B2P = 6;           // B2 Pin
int G2P = 5;           // G2 Pin
int AP = 2;            // A Pin
int BP = 3;            // B Pin
int CP = 4;            // C Pin
int OEP = 13;          // OE Pin
int row = 0;
uint64_t i;

void setup() {
//set pins to output so you can control the shift register
pinMode(LP, OUTPUT);
pinMode(ClkP, OUTPUT);
pinMode(R1P, OUTPUT);
pinMode(B1P, OUTPUT);
pinMode(G1P, OUTPUT);
pinMode(R2P, OUTPUT);
pinMode(B2P, OUTPUT);
pinMode(G2P, OUTPUT);
pinMode(AP,OUTPUT);
pinMode(BP,OUTPUT);
pinMode(CP,OUTPUT);
pinMode(OEP,OUTPUT);

digitalWrite(AP, LOW);
digitalWrite(BP, LOW);
digitalWrite(CP, LOW);
digitalWrite(LP, LOW);
digitalWrite(OEP, LOW);
row=0;
temp =  0x0000000000000000000000000001;  

//------------------------Paste here:

                      
row1[0]=0xC0C0C0FF030303FFC3C3C7FFC3C3C3FF;                        
row1[1]=0XC0C0C0FF030303FFC3C3CFC0C3C3C303;                      
row1[2]=0xC0C0C0C003030303C3C3DFC1C3C3C3C3;                      
row1[3]=0xC0C0C0C003030303C3C3DFC3C3C3C3C3;                      
row1[4]=0xC0C0C0C003030303DFDFC3C3FBFBC3C3;                      
row1[5]=0xC0C0C0C003030303C0DFC3C303FBC3C3;                      
row1[6]=0xFFC0C0C0FF030303FFDFC3C3FFFBC3C3;                      
row1[7]=0xFFC0C0C0FF030303FFDFC3C3FFFBC3C3;                      

//row1[8]=0xFfffffffffffffff;                      
//row1[9]=0xFfffffffffffffff;                      
//row1[10]=0xC3C3DFC1C3C3C3C3;                        
//row1[11]=0xC3C3DFC3C3C3C3C3;                        
//row1[12]=0xDFDFC3C3FBFBC3C3;                        
//row1[13]=0xC0DFC3C303FBC3C3;                        
//row1[14]=0xFFDFC3C3FFFBC3C3;                        
//row1[15]=0xFFDFC3C3FFFBC3C3;                                    
//----------------------------up to here
}

void loop() {
for(row=0; row<4; row++){
   for (i = 0; i < 128; i++)  {
      digitalWrite(B1P, 0);
      digitalWrite(R1P, 0);
      digitalWrite(G1P, !!(row1[row] & (temp << (127-i))));
      digitalWrite(B2P, !!(row1[row+4] & (temp << (127-i))));
      digitalWrite(R2P, 0);
      digitalWrite(G2P, 0);
      digitalWrite(ClkP, HIGH);
      digitalWrite(ClkP, LOW);
      }  
   digitalWrite(OEP, HIGH);
   digitalWrite(LP, HIGH);  
   digitalWrite(AP, !!(row & B00000001));
   digitalWrite(BP, !!(row & B00000010));
   digitalWrite(CP, !!(row & B00000100));
   digitalWrite(OEP, LOW);
   digitalWrite(LP, LOW);  
 shiftOut1(R1P, B1P, G1P, R2P, B2P, G2P, ClkP);
}
}

void shiftOut1(uint64_t R1P1, uint64_t B1P1, uint64_t G1P1, uint64_t R2P1, uint64_t B2P1, uint64_t G2P1, uint64_t ClkP1)
{
}    


It worked printing on the right half of the panel and the other half is totally blank. Check Attachment please.

Quote
I think you have a hard job of reverse engineering in front of you and unless you can find some one who has done it before I think you might struggle
Yes I'm,
This one was the worst REV engineering I've ever had.

WalidAli

I just took some back pictures of the panel you can find them in attachments.

WalidAli

I have two LED panels p10 32*16 1/4 Hub75 and are compatible with RGB adafruit GFX library.

I want to use them above each other and make them work as 32x32 and controlled by Arduino Uno or Mega.
So one number when printed on will be shown as if it's 32x32 Panel, one big whole number.

Does any one has the wiring diagram for that or what should I use or add to make it work?


This idea worked with me using Huidu LED controller Hub08 converted by wiring to Hub75 then converted to control two panels 32x16 one above the other.

I draw funny connections that might need an extra explanation to figure out and are attached below any how.
Check them and ask me I will do my best to make it work if you need it.

So If there is any possibility I can do it with Arduino, please I need to know how?
Thank you.


WalidAli

Quote
Threads merged.
While they are totally different subjects and non of them been solved!!

metuman

Hello, thank you for sharing the information. I have been working on the RGB panel produced with the specified library and I can use all the functions. But there's something I can not and can not do. I can not adjust the brightness I want to adjust the brightness with LDR but this is not mentioned in the library at all Does anyone have any information on this topic?
Thank you in advance for the convulsions. My English is not very good. I can give hope.

Grumpy_Mike

The photos in reply #8 show only one driver PCB yet on the web page to the product it shows four of these driver PCBs. That suggests to me that the supplier has not sent you what was advertised.

WalidAli

The photos in reply #8 show only one driver PCB yet on the web page to the product it shows four of these driver PCBs. That suggests to me that the supplier has not sent you what was advertised.
Sorry that was my fault.  :smiley-confuse:

I just corrected the Product Link in reply #4

Thank you  :D

Grumpy_Mike

The key to this problem is the driver module. Does it contain any model numbers that you can search for?
Can you post a close up sharp picture showing the connections?
Can you post a schematic of how you have wired it up?

It is too pricey for me to buy one and see.

Go Up