Open digi55 opened 4 months ago
Hi Which exactly stm32F103RC ? How much kilobytes of RAM it has?
STM32F103RCT6 48Kb Ram , 256Kb Flash , 72Mhz
Please insert your code for STM32F103RCT6 with a two panels
/*-------------------------------------------------------------------------------------- Demo for RGB panels
DMD_STM32a example code for STM32
Draw bitmap example. ------------------------------------------------------------------------------------- */
//Number of panels in x and y axis
// 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) command do nothing
// ==== DMD_RGB pins ==== // mux pins - A, B, C... all mux pins must be selected from same port!
// uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C , DMD_PIN_D , DMD_PIN_E }; 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
// 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> // We use 64x32 matrix with 16 scans and 4bit color: DMD_RGB <RGB128x64plainS32,COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);
// bitmap images to show const uint16_t bitmaps[] = {pict1, pict2, pict3, pict4, pict5}; uint8_t ptr = 0; /-------------------------------------------------------------------------------------- setup Called by the Arduino architecture before the main loop begins --------------------------------------------------------------------------------------*/
void setup(void){
enableDebugPorts();
dmd.init();
}
/-------------------------------------------------------------------------------------- loop Arduino architecture main loop --------------------------------------------------------------------------------------/
void loop(void) { if (ptr == (sizeof(bitmaps)/ sizeof(bitmaps[0]))) ptr =0;
// initial brightness
uint8_t b=BRIGHTNESS_DEFAULT;
dmd.setBrightness(b);
// draw image starting from 0,0, width 64 height 32 // dmd.drawRGBBitmap(dmd.width() - 80, 0, bitmaps[ptr], 80, 80); dmd.drawRGBBitmap(dmd.width() - 128, 0, bitmaps[ptr], 128, 128);
// show the image during 15sec delay(3000);
/ // fading to dark while (b) { dmd.setBrightness(b); delay(100); b--; } /
// blank screen 2sec dmd.clearScreen(true); delay(200);
// increment image pointer ptr++; }
Sorry for the delay in testing. Unfortunately, I don't have such processors for real tests. After looking at the code, I didn't find any problems.
Hi,
I also don't think there is any problem with the code anyway.
Because there is no problem with the 100Mhz STM32F411CE. (1 panel P2.5 128x64 or 2panel 128x128)
When only 1 panel is used, also there is no problem with the 72Mhz stm32F103RC. But, When I using 2 panels, image flickering occurs. I think 72Mhz is not enough to scan 2 panels.
I wanted to ask, Do you have any advice to fixed this flickering problem when using 2 panels? (128x128)
I think 72Mhz is not enough to scan 2 panels.
Unfortunately, "the frequency is not enough" - helps nothing in that case. There may be problems in the code - for example, the update is too frequent for such a large amount of data. The fact is that I designed the library for the F103C series, which simply do not have enough memory to work with such panels. Therefore, the code for STM32F1 has never been tested on such big screens. Unfortunately, for now I can’t figure out how to solve the problem without real tests on the F103R-series controller, that I don't have.
I understand, Thank you so much for your helps.
Hi I ordered a board with an F103RE controller from Ali, delivery in a month. I'll try to figure out the problems. I'll let you know when I have the results.
Thank you so much !
Hi @digi55 I tested the board with F103RE controller, set the screen of 128x128 pixels. I observed some image jitter, especially on long lines of diodes. I think this is what you observed and described as a flickering. The most likely cause of artefacts is the low frame rate that F103 mcu can provide. On the F411 board, the FPS on such a screen will be approximately 80, while on the F103 it will be only 40-50. Update 40 times per second is most likely gives the jitter that the eye notices in the picture on the matrix. I'll try to increase the output speed a little and report the result. But it is unlikely that the speed can be increased significantly.
Hi @board707 Yes, this is exactly the problem I'm talking about. With the 128x128 P2.5 panel, there is a slight flicker because the refresh rate in F103 is not enough. Thank you very much for your interest. I hope this little acceleration will be enough. I'm looking forward to the result.
Hi @digi55 Unfortunately, I did not find a way to increase the speed of the STM32F1 controllers in my library. As I remember, you use STM32F1, not F4, because F4 does not have EEPROM. It might be easier to run EEPROM on F4 than to speed up F1 :)
By the way. I don’t remember, I already asked you, where are you from?
Hi @board707 yes, I am using stm32F103RCT6. Everything is ok with stm32F411CE, only problem is does not have EEPROM support. I think, I don't have another choice. I need to use 32F411 and an external EEPROM. I am from Istanbul / Turkey
I need to use 32F411 and an external EEPROM.
I'll see if we can use EEPROM emulation on the F411 in the same way as it was done on the F103, but I'm not sure I have enough knowledge for that. Perhaps using an external EEPROM will be the simplest solution.
By the way - I remember you asked about panels with DP3364 and SM16380 drivers. Do you still have these panels at your disposal? Perhaps I will be able to add them to the library, could I will ask you to run some tests on these panels?
Hi @board707 While looking for compatible 128x64 P2.5 panels for our library, I purchased several different samples. I returned some of the ones that were not compatible. I'm not sure which ones there are right now. I have to check. Of course, I would be happy to help you.
Hi again @board707 I decided to use STM32F411RE (64 pin) and 24c16 eeprom to use on P2.5 (128x64) panel But, there is only STM32F411CEU (48 pin) among the arduino board options. I want to use STM32F411RE (64 Pin). Do you have any advice on how I can do this?
I want to use STM32F411RE (64 Pin). Do you have any advice on how I can do this?
The core for F411 already in the Clark STM32 package. To work with another version of the F411 chip you have to add a new board variant to the STM32F4/variants folder with full description of the pins, interfaces, memory etc
I just added the missing pins, in variants/blackpill_f411.h I hope it works. Because everything looks the same, except the number of pins.
Hi, @board707 Unfortunately, the pin additions I made did not work.
And I do not know exactly what to do. Can you help me with adding the STM32F411RET6 (64 Pin) processor?
As far as I know, the 411RE and CE differ only in the number of pins. This means that your controller should work with the library if you compile the code for the blackpil 411CE board (and of course, you should only use the pins that the CE has). First, try to permorm such a test - if it passes, then we can start adding pins. If the library does not work, then the problem is somewhere else.
When I upload code by selecting CE, some pins work. For example, when I connect an LED, I can turn it on and off. But when I connect it to the P4 panel, I cannot get an image. Because the signal is very weak on some pins.
Because the signal is very weak on some pins.
Do you mean the pins, that exist only on RE chip? You should use only ones, that exits both on CE and RE. These pins should works.
The pins I used for the P4 panel are available on both. I am using the pins you gave in the sample file.
The situation is not clear for me, sorry. It's hard to solve such issues remotely. I don't have a proper controller to test.
Remind me, what's the reason for your choice of this particular controller? Why can't you use a standard 411CE blackpill?
Because, I need a 64 pin processor. I designed a motherboard with STM32F411RE processor. The motherborad is ready now. But the problem is that this processor option is not available in Arduino. I want to use P4 and P2.5 panels with this motherboard.
I apologize for what is written below, maybe I understand something incorrectly. However, in my opinion, if you use the same pins on the 411RE as on the CE, the library should work on the RE and CE the same way. If it does not work for you, then this may indicate an error in the design of the board. Or maybe the difference between the controllers is greater than we thought. In any case, until you able to run the library on the RE chip with the same settings. as the CE - adding support for additional pins does not make sense.
By the way, on what the clock frequency do you run the 411RE on your PCB?
I am using a 25Mhz crystal like on the blackpill. Now I will test all the pins one by one and try to find out which ones have problem.
I am using a 25Mhz crystal like on the blackpill.
Do you also use a clock multiplication like on the blackpill? What is the resulting core frequency? The library is written considering 100 MHz core clock.
yes, I am using 100 Mhz
Hi again, I found the source of the problem. A simple soldering error on pcb. Now everything works, except the PD2 pin. P4 and P2.5 RGB Panels are also fine. I haven't been able to activate the I2C2 port yet. This is necessary for the EEPROM. Thank you very much for your help and support.
all other pins are OK PD2 pin is not working, do you have any advice?
PD2 pin is not working, do you have any advice?
Is there such a pin on the blackpill 411? Below is a list of all blackpill pins defined in the STM32 Arduino package:
enum {
PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15,
PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB12=(PB10+2),PB13,PB14,PB15,
PC13=(32+13),PC14,PC15,
BOARD_NR_GPIO_PINS
};
I don't see a PD2 here - so it is a quite expecting that the pin doesn't work.
enum { PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15, PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB12=(PB10+2),PB13,PB14,PB15, PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13,PC14,PC15, PD2,PH0,PH1, BOARD_NR_GPIO_PINS };
in this way, I added all the pins needed for 64 pin (STM32F411RE). All of them working. Only PD2 does not work. I don't get any errors during compilation. But, it not working. I don't know why
Firstly, I think you added the pins not quite correctly, probably it should be edited this way:
enum {
PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15,
PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB12=(PB10+2),PB13,PB14,PB15,
PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13,PC14,PC15,
PD2=(48+2),
PH0 = (64 +0) ,PH1,
BOARD_NR_GPIO_PINS
};
In addition, it is not enough to just edit the list. You need to add to the other code work with pins on the PD and PH ports, which are not in the standard blackpill
Thank you very much @board707 , PD2 pin finally worked.
I couldn't find an explanation anywhere on how to activate I2C2 (PB10, PB3).
TwoWire Wire2 (2, I2C_FAST_MODE); // I2C2 ( scl=PB10, sda=PB3)
AT24C02 EEPROM(AT24C_ADDRESS_0);
uint8_t BRIGHTNESS_adres = 20; uint8_t BRIGHTNESS = 0;
void setup() { Wire.begin(); delay(30); BRIGHTNESS = EEPROM.read(BRIGHTNESS_adres);
}
void loop() {
}
With this code, stm32F103RC and 24c02 eeprom work without any problems.
But it freezes with stm32F411. When I check with an oscilloscope, there is no signal on the relevant pins.
I'm sorry, I know I'm asking you too many questions, but I don't have much experience with the stm32 family. Do you have any advice on this?
Please attach the file at24c02.h, I would run some tests
Thank you.
Thank you too
Hi Sorry for delay with answer. When you added the pins, did you edit the existing variants/blackpill_f411.h file in place or did you create a new variant for your mcu? in any case, please show the resulting file
/**
/**
//#define Port2Pin(port, bit) ((port-'A')*16+bit)
//#define BOARD_USART6_TX_PIN PA11 // USB_DM //#define BOARD_USART6_RX_PIN PA12 // USB_DP
//#define BOARD_NR_GPIO_PINS 42
enum { PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15, PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB12=(PB10+2),PB13,PB14,PB15, PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13=(32+13),PC14,PC15, PD2=(48+2), PH0=(64+0),PH1, BOARD_NR_GPIO_PINS };
Hi, @board707 I edited the existing variants/blackpill_f411.h file.
Pay attention to these lines in your file:
#define BOARD_NR_I2C 1
#define BOARD_I2C1_SCL_PIN PB6
#define BOARD_I2C1_SDA_PIN PB7
#define BOARD_I2C1A_SCL_PIN PB10
#define BOARD_I2C1A_SDA_PIN PB3
The first line is indicated that the controller has only one I2C interface. Additionally, the last two lines defines a I2C1A interface, which is incorrect.
To use a two interfaces, try changing this piece like this:
#define BOARD_NR_I2C 2
#define BOARD_I2C1_SCL_PIN PB6
#define BOARD_I2C1_SDA_PIN PB7
#define BOARD_I2C2_SCL_PIN PB10
#define BOARD_I2C2_SDA_PIN PB3
and test it again.
I made the necessary correction and
When I checked with an oscilloscope, There is still no signal on the SCL2 (PB10) pin. I can finally see a signal on the SDA2 (PB3) pin.
So it means that second I2C not worked again?
Ok, I'll try to think of something else :)
Unfortunately, I2C2 still didn't work.
But after this fix, I can now see a signal from PB3. I still don't understand why there is no signal from PB10 ((
Did you pullup SCL and SDA to 3.3v ?
Hi I tested P2.5(128x64) RGB Panel with stm32F103RCT6 72Mhz and blackpill stm32F411CE 100Mhz
stm32F411CE with 1 panel(128x64) or 2 panels (128x128) without Noise and Flickering , Correct Colors , every test results OK.
stm32F103RC with 1 panel(128x64) without Noise and Flickering, Correct Colors , every test results OK.
stm32F103RC with 2 panels (128x128) without Noise and Correct Colors. But, have Flicker problem.
Is it possible to solve the flickering problem when using 2 panels?