board707 / DMD_STM32

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

P2.5 (128x64) RGB Panel with stm32F103RCT6 and stm32F411CE test results #111

Open digi55 opened 4 months ago

digi55 commented 4 months ago

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?

digi55 commented 1 month ago

yes of course

board707 commented 1 month ago

I don't have any new ideas just now... I'll test it with my blackpill.

board707 commented 1 month ago

You could use a SoftWire on I2C2 pins - I just tested and it works fine for me. Init the Wire interface this way:

#include <SoftWire.h>
SoftWire SWire(PB10, PB3, SOFT_FAST);

See the example STM32F4/libraries/Wire/examples/i2c_scanner_softwire for details.

digi55 commented 1 month ago

I guess the SoftWire library is not compatible with the at2cxxx library. Again, there is no signal on the pins.

board707 commented 1 month ago

As a test try to run an i2c_scanner script - is your AT24xx chip visible?

digi55 commented 1 month ago

I tested all the examples. wire and Hwire unfortunately do not work. Only softWire is working. Do you have any advice on how to make the at24cxxx library compatible with SWire?

board707 commented 1 month ago

Do you have any advice on how to make the at24cxxx library compatible with SWire?

I will see it

board707 commented 1 month ago

try this code:

#include <SoftWire.h>
SoftWire SWire(PB10, PB3, SOFT_FAST);

#include <at24c02.h>
AT24C02 EEPROM(AT24C_ADDRESS_0, SWire);

uint8_t BRIGHTNESS_adres = 20;
uint8_t BRIGHTNESS = 0;

void setup() {
SWire.begin();
delay(30);
BRIGHTNESS = EEPROM.read(BRIGHTNESS_adres);

}

void loop() {}

with library attached to the message arduino-library-at24cxxx-main-b707.zip PS please test only the class for at24c02, the other library classes remain unfixed.

digi55 commented 1 month ago

Now, everything is OK with SoftWire and yours edited at24cxxx library. thank you so much @board707

board707 commented 1 month ago

I also finally managed to fix the support for the second hardware I2C. if SoftWire doesn't suit you, I can send you the fixes for the Arduino_STM32 package. May be, you lookup for programmer for your project? :)

digi55 commented 1 month ago

I would be very happy if you could also send me the necessary fixes for Hardware I2C2. I am grateful for your help and support.

digi55 commented 1 month ago

For the stm32 family, an external eeprom is a must. Because although there is an eeprom emulation in the F1 series, after about 200 writes, an overflow occurs in the eeprom and the system crashes.

The external eeprom did not cause any problems in the F1 series. Everything worked as it should.

But you also saw that there was a problem in the F411, the hardware I2C1 and I2C2 did not work. And I could not find the reason. With your help, the software I2C worked very well. The F411 series is a very powerful processor, it works very well with P2.5 panels with a speed of 100Mhz.

board707 commented 1 month ago

there was a problem in the F411, the hardware I2C1 and I2C2 did not work.

Didn't the first i2c1 work too? I have no problems with it

digi55 commented 1 month ago

yes hardware I2C1 and I2C2 did not work. I wonder why I2C2 is not working

board707 commented 1 month ago

hardware I2C1 and I2C2 did not work.

I think you are mistaken, I2C1 worked from the start. I checked it before I started fixing I2C2. Besides, I had projects with blackpill boards before which use a i2c1 and it worked. But with i2c2 there really were problems in the STM32 code. I think you just made some mistake when you run your tests I2C1.

Added: I'll show you the edits for fixing the I2C2 a little later, I need to finish the corrections in all the files.

digi55 commented 1 month ago

It may be possible, I tried a lot. I remember testing it with I2C1 at one point. I think there are many bugs in the stm32 library for arduino.

board707 commented 1 month ago

Hi I just updated my fork of Arduino_STM32 package, fixing a support of second I2C channel for STM32F4 boards. Also I add a third I2C3 interface for F401/F401 controllers on pins PA8 (SCL) and PB4(SDA). The code was tested on hardware (I2C EEPROM module FR24C04 on blackpill F401 board).

To use a new package you need to download it from this link: https://github.com/board707/Arduino_STM32/tree/HardWire2 You just need to copy your definition of the additional pins for F411RE controller.

digi55 commented 1 month ago

Finally hardware I2C2 working :) Many Thanks @board707

board707 commented 3 weeks ago

Hi Our changes of I2C2 has been merged in main trunk of Arduino_STM32 package https://github.com/rogerclarkmelbourne/Arduino_STM32 So you can replace my fork with main package now.

Could you please send me all files, that you changed while define an additional pins for F411RE mcu? Did you change anything specific to manage PD and PH pins to work?

digi55 commented 3 weeks ago

/**

/**

ifndef _BOARD_BLACKPILL_F411H

define _BOARD_BLACKPILL_F411H

//#define Port2Pin(port, bit) ((port-'A')*16+bit)

define CLOCK_SPEED_MHZ 96

define BOARD_LED_PIN PC13

define BOARD_USB_DM_PIN PA11

define BOARD_USB_DP_PIN PA12

define BOARD_NR_USARTS 3

define BOARD_USART1_TX_PIN PA9

define BOARD_USART1_RX_PIN PA10

define BOARD_USART2_TX_PIN PA2

define BOARD_USART2_RX_PIN PA3

//#define BOARD_USART6_TX_PIN PA11 // USB_DM //#define BOARD_USART6_RX_PIN PA12 // USB_DP

define BOARD_NR_I2C 3

define BOARD_I2C1_SCL_PIN PB6

define BOARD_I2C1_SDA_PIN PB7

define BOARD_I2C1A_SCL_PIN PB8

define BOARD_I2C1A_SDA_PIN PB9

define BOARD_I2C2_SCL_PIN PB10

define BOARD_I2C2_SDA_PIN PB3

define BOARD_I2C3_SCL_PIN PA8

define BOARD_I2C3_SDA_PIN PB4

define BOARD_NR_SPI 3

define BOARD_SPI1_NSS_PIN PA4

define BOARD_SPI1_SCK_PIN PA5

define BOARD_SPI1_MISO_PIN PA6

define BOARD_SPI1_MOSI_PIN PA7

define BOARD_SPI2_NSS_PIN PB12

define BOARD_SPI2_SCK_PIN PB13

define BOARD_SPI2_MISO_PIN PB14

define BOARD_SPI2_MOSI_PIN PB15

define BOARD_SPI3_NSS_PIN PA15

define BOARD_SPI3_SCK_PIN PB3

define BOARD_SPI3_MISO_PIN PB4

define BOARD_SPI3_MOSI_PIN PB5

//#define BOARD_NR_GPIO_PINS 32

define BOARD_NR_PWM_PINS 22

define BOARD_NR_ADC_PINS 16

define BOARD_NR_USED_PINS 43 // ala42 not set yet

define BOARD_JTMS_SWDIO_PIN PA13

define BOARD_JTCK_SWCLK_PIN PA14

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 };

endif

digi55 commented 3 weeks ago

Hi, @board707 I just added the missing pins to blackpill_f411.h. I didn't just test the PH0 and PH1 pins. Apart from that, I checked all the other pins and they work fine.

board707 commented 3 weeks ago

Thank you

digi55 commented 3 weeks ago

Thank you too