board707 / DMD_STM32

STM32Duino library for RGB, Monochrome and Two-color led matrix panels
GNU General Public License v3.0
54 stars 18 forks source link

RGB P5 MODULE PIN CONNECTION #87

Closed tahafathi2013 closed 2 months ago

tahafathi2013 commented 4 months ago

im use p5 rgb module. But i have not pin E on my module. Module have R1 - G1 B1 - GND R2 - G2 B2 - GND A - B C - D CLK - LAT OE - GND

IMG_20240305_144147

tahafathi2013 commented 4 months ago

IMG_20240305_163735

IMG_20240305_163725

IMG_20240305_163717

IMG_20240305_163644

tahafathi2013 commented 4 months ago

https://github.com/board707/DMD_STM32/assets/19773695/c6e91bf9-3cfa-425d-8874-62212ecb3464

board707 commented 4 months ago

Hi, you have a 16scan panel, it is not need a E pin.

If you have a problem with the library with your panel, please show your test code with all connections defined.

tahafathi2013 commented 4 months ago

im use this code :

`/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board

Pattern test for 32x16 1/2 1/4 RGB panels ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Output buffering - false

define ENABLE_DUAL_BUFFER false

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB4

define DMD_PIN_D PB3

define DMD_PIN_E PB8

// put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D , DMD_PIN_E };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PB0

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { PA15, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH>

// For pattern testing use one of matrix below: // RGB32x16plainS4 - 32x16 1/4 Binary mux // RGB32x16plainS4_DIRECT - 32x16 1/4 DIRECT mux // RGB32x16plainS2_DIRECT - 32x16 1/2 Binary mux // example: // #define RGB80x40plainS20 5,80,40,20,0 // 5 mux pins(A B C D E), 80x40, scan 1/20, pattern 0 // // pattern_ID is unique number for pattern design // pattern ID between 0 and 31 and after 255 are reserved for library use // and from 32 to 127 - for user panels, added by author // for new panels added yourself use pattern_ID between 128 and 255 // DMD_RGB <RGB64x32plainS16 , 4> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

uint16_t bg = 0; // background - black uint16_t fg = 0; // foreground

void setup(void) { dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(50); }

void loop(void) { // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j,i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg); } `

im connected led panel to stm32 pins:

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB4

define DMD_PIN_D PB3

define DMD_PIN_E PB8

and connected this pins :

uint8_t custom_rgbpins[] = { PA15, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

my panel dont have sclk pin to connect PB7 but im connect this pin to PA15

board707 commented 4 months ago

Don.t confuse the CLK and the SCLK pins. The library SCLK pin is the same as LAT pin on the panel. You should connect PA15 to CLK and PB7 to LAT.

tahafathi2013 commented 4 months ago

pin connection : P5 - STM32 R1 - A0 G1 - A1 B1 - A2

R2 - A3 G2 - A4 B2 - A5

A - B6 B - B5 C - B4 D - B3

CLK - A15 LAT - B7 OE - B0

MY CODE :

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board

Pattern test for 32x16 1/2 1/4 RGB panels ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Output buffering - false

define ENABLE_DUAL_BUFFER false

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB4

define DMD_PIN_D PB3

define DMD_PIN_E PB8

// put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D , DMD_PIN_E };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PB0

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { PA15, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH>

// For pattern testing use one of matrix below: // RGB32x16plainS4 - 32x16 1/4 Binary mux // RGB32x16plainS4_DIRECT - 32x16 1/4 DIRECT mux // RGB32x16plainS2_DIRECT - 32x16 1/2 Binary mux

DMD_RGB <RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

uint16_t bg = 0; // background - black uint16_t fg = 0; // foreground

void setup(void) { dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(50); }

void loop(void) { // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j,i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg); }

BUT NOT WORKIN . . . .

https://github.com/board707/DMD_STM32/assets/19773695/6589fc9d-25f0-476e-8e4b-c2d605282fae

tahafathi2013 commented 3 months ago

how fix it???

https://github.com/board707/DMD_STM32/assets/19773695/1942a67b-1a56-4b0e-a513-076fde59806f

board707 commented 3 months ago

Sorry, l am not home now.

tahafathi2013 commented 3 months ago

Ok No problem. When you at home chek this problem and help me to fix it.please

board707 commented 3 months ago

Do you use a st-link to upload the code to the stm32?

tahafathi2013 commented 3 months ago

No im using serial programmer

tahafathi2013 commented 3 months ago

how fix it problem??

tahafathi2013 commented 3 months ago

IMG_20240307_021649

tahafathi2013 commented 3 months ago

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

// Fonts includes

include "st_fonts/UkrRusArial14.h"

pragma GCC diagnostic ignored "-Wnarrowing"

pragma GCC diagnostic ignored "-Woverflow"

include "gfx_fonts/GlametrixLight12pt7b.h"

include "gfx_fonts/GlametrixBold12pt7b.h"

pragma GCC diagnostic warning "-Wnarrowing"

pragma GCC diagnostic warning "-Woverflow"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Enable of output buffering // if true, changes only outputs to matrix after // swapBuffers(true) command // If dual buffer not enabled, all output draw at matrix directly // and swapBuffers(true) cimmand do nothing

define ENABLE_DUAL_BUFFER false

define LED_PIN PC13

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB4

define DMD_PIN_D PB3

define DMD_PIN_E PB8

// CLK, R0, G0, B0, R1, G1, B1

define DMD_PIN_R0 PA0

define DMD_PIN_G0 PA1

define DMD_PIN_B0 PA2

define DMD_PIN_R1 PA3

define DMD_PIN_G1 PA4

define DMD_PIN_B1 PA5

define DMD_CLK PA15

// put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A, DMD_PIN_B, DMD_PIN_C, DMD_PIN_D };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PA7

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { DMD_CLK, DMD_PIN_R1, DMD_PIN_G1, DMD_PIN_B1, DMD_PIN_R0, DMD_PIN_G0, DMD_PIN_B0 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH> // We use 64x32 matrix with 16 scans and 4bit color: DMD_RGB<RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); // other options are: // - 32x16 matrix with 8scans // - 80x40 matrix with 20scans // - 64x64 matrix with 32scans // Color depth - , or

// --- Define fonts ---- // DMD.h old style font DMD_Standard_Font UkrRusArial_F(UkrRusArial_14); /// GFX font with sepatate parts for Latin and Cyrillic chars DMD_GFX_Font GlametrixL((uint8_t)&GlametrixLight12pt7b, (uint8_t)&GlametrixLight12pt8b_rus, 0x80, 13);

uint16_t bg = 0; // background - black uint16_t fg = 50; // foreground

/-------------------------------------------------------------------------------------- setup Called by the Arduino architecture before the main loop begins --------------------------------------------------------------------------------------/

void setup(void) { // initialize DMD objects dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(200); }

/-------------------------------------------------------------------------------------- loop Arduino architecture main loop --------------------------------------------------------------------------------------/

void loop(void) {

// fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j, i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg);

}

tahafathi2013 commented 3 months ago

I remove DMD_PIN_E

tahafathi2013 commented 3 months ago

IMG_20240306_214419

board707 commented 3 months ago

Try to use pb8 to pin D and pb10 as pin C. Also you have an incorrect order of RGB pins: pins R0G0B0 should be first and then R1 G1 B1

tahafathi2013 commented 3 months ago

I try it but not working yet. When my hand near wire of clk pin

https://github.com/board707/DMD_STM32/assets/19773695/fb0f8e36-ec3b-4ae3-92df-6cf85afbe95a

IMG_20240307_025954

tahafathi2013 commented 3 months ago

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

// Fonts includes

include "st_fonts/UkrRusArial14.h"

pragma GCC diagnostic ignored "-Wnarrowing"

pragma GCC diagnostic ignored "-Woverflow"

include "gfx_fonts/GlametrixLight12pt7b.h"

include "gfx_fonts/GlametrixBold12pt7b.h"

pragma GCC diagnostic warning "-Wnarrowing"

pragma GCC diagnostic warning "-Woverflow"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Enable of output buffering // if true, changes only outputs to matrix after // swapBuffers(true) command // If dual buffer not enabled, all output draw at matrix directly // and swapBuffers(true) cimmand do nothing

define ENABLE_DUAL_BUFFER false

define LED_PIN PC13

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB10

define DMD_PIN_D PB8

// CLK, R0, G0, B0, R1, G1, B1

define DMD_PIN_R0 PA0

define DMD_PIN_G0 PA1

define DMD_PIN_B0 PA2

define DMD_PIN_R1 PA3

define DMD_PIN_G1 PA4

define DMD_PIN_B1 PA5

define DMD_CLK PA15

// put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A, DMD_PIN_B, DMD_PIN_C, DMD_PIN_D };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PA7

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { DMD_CLK, DMD_PIN_R0, DMD_PIN_G0, DMD_PIN_B0, DMD_PIN_R1, DMD_PIN_G1, DMD_PIN_B1 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH> // We use 64x32 matrix with 16 scans and 4bit color: DMD_RGB<RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); // other options are: // - 32x16 matrix with 8scans // - 80x40 matrix with 20scans // - 64x64 matrix with 32scans // Color depth - , or

// --- Define fonts ---- // DMD.h old style font DMD_Standard_Font UkrRusArial_F(UkrRusArial_14); /// GFX font with sepatate parts for Latin and Cyrillic chars DMD_GFX_Font GlametrixL((uint8_t)&GlametrixLight12pt7b, (uint8_t)&GlametrixLight12pt8b_rus, 0x80, 13);

uint16_t bg = 0; // background - black uint16_t fg = 50; // foreground

/-------------------------------------------------------------------------------------- setup Called by the Arduino architecture before the main loop begins --------------------------------------------------------------------------------------/

void setup(void) { // initialize DMD objects dmd.init(); fg = dmd.Color888(0, 255, 0); dmd.setBrightness(200); }

/-------------------------------------------------------------------------------------- loop Arduino architecture main loop --------------------------------------------------------------------------------------/

void loop(void) { fg = dmd.Color888(0, 0, 255); // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j, i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg);

fg = dmd.Color888(0, 255, 0); // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j, i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg);

fg = dmd.Color888(255, 0, 0); // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j, i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg);

}

board707 commented 3 months ago

Sorry, I don't have any additional ideas.

tahafathi2013 commented 3 months ago

DMD_RGB<RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); IN this line code need to change RGB64x32plainS16, COLOR_4BITS????

why when CLK pin touched by my finger turned on half?

board707 commented 3 months ago

why when CLK pin touched by my finger its working ?

The matrix code uses a high frequency pulses (dozen megahertz) and it is very sensitive to unreliable connections. Do not use separate wires, use dedicated 16pin connector.

tahafathi2013 commented 3 months ago

Choose wich cpu spee? Im use 16 pin connector or wires but dont work it. My panel dont have pin E but im remove pin E from code. What is configure without pin E?? Please get me example without pin E to test screen

board707 commented 3 months ago

Pin E is not used for matrices with 16 scans or lower, so this setting doesn't matter for your configuration. Honestly, I don't see any problems with your pins setup. I don't have an idea why it not works.

tahafathi2013 commented 3 months ago

ok your examples why not working adafruit gfx 1.11 ?? what your panel models tested by your examples stm32 f103c8t6c???

board707 commented 3 months ago

The library works with Adafruit Gfx v 1.7 , the link is in the Readme. But your question surprised me, if you would to use incorrect adafrit gfx version, the code doesn't compile. The library tested with dozens of different panels. Your panel looks compatible, your code is correct , and your connections is right. It should work. Sorry for inconvenience, but I don't know how to help you.

tahafathi2013 commented 3 months ago

It may be because of uploading the code through serial? It means that it has not been transmitted through the correct serial? Could it be because of the (https://github.com/rogerclarkmelbourne/Arduino_STM32)?

tahafathi2013 commented 3 months ago

I change pin numbers to this but not working this time use st link programmer . but not working again.

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board

Pattern test for 32x16 1/2 1/4 RGB panels ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Output buffering - false

define ENABLE_DUAL_BUFFER false

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB10

define DMD_PIN_D PB8

//#define DMD_PIN_E PB8 // put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PB0

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { PA15, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH>

// For pattern testing use one of matrix below: // RGB32x16plainS4 - 32x16 1/4 Binary mux // RGB32x16plainS4_DIRECT - 32x16 1/4 DIRECT mux // RGB32x16plainS2_DIRECT - 32x16 1/2 Binary mux

DMD_RGB <RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

uint16_t bg = 0; // background - black uint16_t fg = 0; // foreground

void setup(void) { dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(50); }

void loop(void) { // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j,i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg); }

tahafathi2013 commented 3 months ago

IMG_20240310_135930

When programmed with stlink

tahafathi2013 commented 3 months ago

When press reset key moving leds.

https://github.com/board707/DMD_STM32/assets/19773695/bee7594e-a650-46df-a0c3-855354a1219b

digi55 commented 3 months ago

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board

Pattern test for 32x16 1/2 1/4 RGB panels ------------------------------------------------------------------------------------- */

include "DMD_RGB.h"

//Number of panels in x and y axis

define DISPLAYS_ACROSS 1

define DISPLAYS_DOWN 1

// Output buffering - false

define ENABLE_DUAL_BUFFER false

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!

define DMD_PIN_A PB6

define DMD_PIN_B PB5

define DMD_PIN_C PB4

define DMD_PIN_D PB3

define DMD_PIN_E PB8

// put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D , DMD_PIN_E };

// pin OE must be one of PB0 PB1 PA6 PA7

define DMD_PIN_nOE PB0

define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { PA6, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH>

// For pattern testing use one of matrix below: // RGB32x16plainS4 - 32x16 1/4 Binary mux // RGB32x16plainS4_DIRECT - 32x16 1/4 DIRECT mux // RGB32x16plainS2_DIRECT - 32x16 1/2 Binary mux // - 80x40 matrix with 20scans

DMD_RGB <RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); //DMD_RGB <RGB80x40plainS20, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); //DMD_RGB <RGB128x64plainS32, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

uint16_t bg = 0; // background - black uint16_t fg = 0; // foreground

void setup(void) { enableDebugPorts(); dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(50); }

void loop(void) { // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j,i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg); }

digi55 commented 3 months ago

Hi, Try this Code. Working without problem with me.

digi55 commented 3 months ago

Thank you so much @board707

tahafathi2013 commented 3 months ago

/*-------------------------------------------------------------------------------------- Demo for RGB panels

DMD_STM32a example code for STM32F103xxx board

Pattern test for 32x16 1/2 1/4 RGB panels ------------------------------------------------------------------------------------- */ #include "DMD_RGB.h"

//Number of panels in x and y axis #define DISPLAYS_ACROSS 1 #define DISPLAYS_DOWN 1

// Output buffering - false #define ENABLE_DUAL_BUFFER false

// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port! #define DMD_PIN_A PB6 #define DMD_PIN_B PB5 #define DMD_PIN_C PB4 #define DMD_PIN_D PB3 #define DMD_PIN_E PB8 // put all mux pins at list uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D , DMD_PIN_E };

// pin OE must be one of PB0 PB1 PA6 PA7 #define DMD_PIN_nOE PB0 #define DMD_PIN_SCLK PB7

// Pins for R0, G0, B0, R1, G1, B1 channels and for clock. // By default the library uses RGB color order. // If you need to change this - reorder the R0, G0, B0, R1, G1, B1 pins. // All this pins also must be selected from same port! uint8_t custom_rgbpins[] = { PA6, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1

// Fire up the DMD object as dmd<MATRIX_TYPE, COLOR_DEPTH>

// For pattern testing use one of matrix below: // RGB32x16plainS4 - 32x16 1/4 Binary mux // RGB32x16plainS4_DIRECT - 32x16 1/4 DIRECT mux // RGB32x16plainS2_DIRECT - 32x16 1/2 Binary mux // - 80x40 matrix with 20scans

DMD_RGB <RGB64x32plainS16, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); //DMD_RGB <RGB80x40plainS20, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER); //DMD_RGB <RGB128x64plainS32, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

uint16_t bg = 0; // background - black uint16_t fg = 0; // foreground

void setup(void) { enableDebugPorts(); dmd.init(); fg = dmd.Color888(0, 0, 255); dmd.setBrightness(50); }

void loop(void) { // fill the matrix with points row by row for (int i = 0; i < dmd.height(); i++) { for (int j = 0; j < dmd.width(); j++) { dmd.drawPixel(j,i, fg); delay(30); } } // clear the screen dmd.fillScreen(bg); }

what use board?? im using bluepill it work on bluepill?

digi55 commented 3 months ago

Yes, Iam using also P5 panel like yours and bluepill. Be careful about pin number

tahafathi2013 commented 3 months ago

IMG_20240310_152859

I using your code but not working . Can you upload image from your wire connections an your panel details. My panel not have E pin.

digi55 commented 3 months ago

Picture won't help since I'm using a FLAT cable. Pin numbers are as seen in the sample code I sent. PinE is not required on this panel.

tahafathi2013 commented 3 months ago

i when use fg = dmd.Color888(255, 255, 255); not change the color.

tahafathi2013 commented 3 months ago

Picture won't help since I'm using a FLAT cable. Pin numbers are as seen in the sample code I sent. PinE is not required on this panel.

my wire connections same as sample code.but not working

digi55 commented 3 months ago

This code fills the panel with blue dots.

tahafathi2013 commented 3 months ago

I change the colors

fg = dmd.Color888(255, 255, 255) But not working.

digi55 commented 3 months ago

send a picture of your connections

digi55 commented 3 months ago

I will check for you

tahafathi2013 commented 3 months ago

Are you install and configure stm boards from https://github.com/rogerclarkmelbourne/Arduino_STM32 ??? Change any thing on your board like resistors?

I burn bootloader by cub programmer. And upload the code by stlink.

tahafathi2013 commented 3 months ago

IMG_20240310_154859

IMG_20240310_154849

digi55 commented 3 months ago

in my code CLK PIN = PA6 you are usingPA15, please change it

tahafathi2013 commented 3 months ago

I change it but not working yet.

IMG_20240310_161523

digi55 commented 3 months ago

Sorry ,I don't have any advice

tahafathi2013 commented 3 months ago

Sorry ,I don't have any advice

Is it possible that the micro or the micro flash memory is damaged?

IMG_20240310_162435

This my config for bluepill

tahafathi2013 commented 3 months ago

I have sometimes error when upload project

IMG_20240310_162705