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
899 stars 201 forks source link

How to know driver led #599

Open mjmokhtar opened 4 months ago

mjmokhtar commented 4 months ago

/* Various LED Driver chips might need some specific code for initialisation/control logic

*/

include

include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"

define CLK_PULSE digitalWrite(_cfg.gpio.clk, HIGH); digitalWrite(_cfg.gpio.clk, LOW);

/**

void MatrixPanel_I2S_DMA::fm6124init(const HUB75_I2S_CFG& _cfg){

if SERIAL_DEBUG

    Serial.println( F("MatrixPanel_I2S_DMA - initializing FM6124 driver..."));
#endif
bool REG1[16] = {0,0,0,0,0, 1,1,1,1,1,1, 0,0,0,0,0};    // this sets global matrix brightness power
bool REG2[16] = {0,0,0,0,0, 0,0,0,0,1,0, 0,0,0,0,0};    // a single bit enables the matrix output

for (uint8_t _pin:{_cfg.gpio.r1, _cfg.gpio.r2, _cfg.gpio.g1, _cfg.gpio.g2, _cfg.gpio.b1, _cfg.gpio.b2, _cfg.gpio.clk, _cfg.gpio.lat, _cfg.gpio.oe}){
    pinMode(_pin, OUTPUT);
    digitalWrite(_pin, LOW);
}

digitalWrite(_cfg.gpio.oe, HIGH); // Disable Display

// Send Data to control register REG1
// this sets the matrix brightness actually
for (int l = 0; l < PIXELS_PER_ROW; l++){
    for (uint8_t _pin:{_cfg.gpio.r1, _cfg.gpio.r2, _cfg.gpio.g1, _cfg.gpio.g2, _cfg.gpio.b1, _cfg.gpio.b2})
      digitalWrite(_pin, REG1[l%16]);   // we have 16 bits shifters and write the same value all over the matrix array

    if (l > PIXELS_PER_ROW - 12){         // pull the latch 11 clocks before the end of matrix so that REG1 starts counting to save the value
        digitalWrite(_cfg.gpio.lat, HIGH);
    }
    CLK_PULSE
}

// drop the latch and save data to the REG1 all over the FM6124 chips
digitalWrite(_cfg.gpio.lat, LOW);

// Send Data to control register REG2 (enable LED output)
for (int l = 0; l < PIXELS_PER_ROW; l++){
    for (uint8_t _pin:{_cfg.gpio.r1, _cfg.gpio.r2, _cfg.gpio.g1, _cfg.gpio.g2, _cfg.gpio.b1, _cfg.gpio.b2})
      digitalWrite(_pin, REG2[l%16]);   // we have 16 bits shifters and we write the same value all over the matrix array

    if (l > PIXELS_PER_ROW - 13){       // pull the latch 12 clocks before the end of matrix so that reg2 stars counting to save the value
        digitalWrite(_cfg.gpio.lat, HIGH);
    }
    CLK_PULSE
}

// drop the latch and save data to the REG1 all over the FM6126 chips
digitalWrite(_cfg.gpio.lat, LOW);

// blank data regs to keep matrix clear after manipulations
for (uint8_t _pin:{_cfg.gpio.r1, _cfg.gpio.r2, _cfg.gpio.g1, _cfg.gpio.g2, _cfg.gpio.b1, _cfg.gpio.b2})
   digitalWrite(_pin, LOW);

for (int l = 0; l < PIXELS_PER_ROW; ++l){
    CLK_PULSE
}

digitalWrite(_cfg.gpio.lat, HIGH);
CLK_PULSE
digitalWrite(_cfg.gpio.lat, LOW);
digitalWrite(_cfg.gpio.oe, LOW); // Enable Display
CLK_PULSE

}

this I got from your source can you explain to me how to change that code for another specification led matrix (p8 or p10) cause the driver is different I gues

i still stuck until today https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/540

board707 commented 4 months ago

p8 and p10 is not a specifications, it is just a distance between LEDs in mm Read the driver type written on the chips

mjmokhtar commented 4 months ago

i see but how we know about driver led ? i ve check and i change it, and it doesn't working

board707 commented 4 months ago

What are the chips on your panel?

mjmokhtar commented 4 months ago

icn2088p i dont know what bit and configuration code it same or not but I ve use panel p8 and 1/4 s

thanks Mr

board707 commented 4 months ago

Sorry, I know nothing about this driver . Are you sure that is not a 2038 ?

mjmokhtar commented 4 months ago

pardon me mr actually is 20238p