Replies: 6 comments
-
Always try to use the Hardware variant of the constructor (HW instead of SW):
Also note, that the argument sequence is different:
|
Beta Was this translation helpful? Give feedback.
-
Very nice! It did the job! Flashes quite fast! |
Beta Was this translation helpful? Give feedback.
-
Now my SSD1327 works well, Thanks a lot! Now I have another issue. The ESP32 has two I2C buses, 4(SDA), 15(SCK) and 21(SDA), 22(SCK). The default is 21, 22. The DEV board is Heltec Wi-FI kit 32, comes with a SSD1306 128x64 OLED on 4/15 port. I replaced it by bigger SSD1327 and now works flawlessly by U8G2_SSD1327_WS_128X128_F_HW_I2C and u8g2.setBusClock(4000000). Meantime, I connected a RTC module DS3231 at 21/22 port. If I enable both OLED and DS3231, the DS3231 could not be recognized.
Code:
u8g2.setBusClock(4000000);
u8g2.begin(/* menu_select_pin= */ 37, /* menu_next_pin= */ U8X8_PIN_NONE, /* menu_prev_pin= */ U8X8_PIN_NONE, /* menu_up_pin= */ 39, /* menu_down_pin= */ 35, /* menu_home_pin= */ 36);
u8g2.setFontMode(1);
Serial.begin(115200);
//Wire.begin(21,22);
Wire1.begin( 4, 15); //Wire.begin(SDA, SCL)
//Wire.begin( );
SPI.begin(); // For SD card reader
If I disable OLED, the DS3231 can be recognized and works well. Once OLED is enabled, the DS3231 seems could not be recognized on 4/15 port. Is there any way I can designate the DS3231 to use 21/22 port, meantime to designate U8G2 to use 4/15? The constructor for DS3231 is:
DS3231 iclock; // RTC time module
Thanks a lot!
Always try to use the Hardware variant of the constructor (HW instead of SW):
U8G2_SSD1327_EA_W128128_F_HW_I2C
U8G2_SSD1327_WS_128X128_F_HW_I2C
Also note, that the argument sequence is different:
U8G2_SSD1327_EA_W128128_F_HW_I2C u8g2(rotation, resetpin, clockpin, datapin)
U8G2_SSD1327_WS_128X128_F_HW_I2C u8g2(rotation, resetpin, clockpin, datapin)
|
Beta Was this translation helpful? Give feedback.
-
BTW, the OLED is using 4Mhz as you suggested while DS3231 is using maximum up to 400kHz, so they cannot share one same I2C bus but using 2 I2C buses. Pls suggest.
Always try to use the Hardware variant of the constructor (HW instead of SW):
U8G2_SSD1327_EA_W128128_F_HW_I2C
U8G2_SSD1327_WS_128X128_F_HW_I2C
Also note, that the argument sequence is different:
U8G2_SSD1327_EA_W128128_F_HW_I2C u8g2(rotation, resetpin, clockpin, datapin)
U8G2_SSD1327_WS_128X128_F_HW_I2C u8g2(rotation, resetpin, clockpin, datapin)
|
Beta Was this translation helpful? Give feedback.
-
Often this is a problem of the device library, which is not able to deal with multiple speeds on the same bus. |
Beta Was this translation helpful? Give feedback.
-
Fortunately I have two i2c buses here on the ESP32, I’m using OLED on 4/15 port, and ds3231 on 21/22 port, is it possible 4/15 running on 4mhz and 21/22 on 400khz? The issue is how to tell each of them to use corresponding port? Thx!
Yixin
… On May 19, 2022, at 3:21 AM, olikraus ***@***.***> wrote:
Often this is a problem of the device library, which is not able to deal with multiple speeds on the same bus.
In such a case it often helps to reduce the speed of u8g2 to the same speed of the RTC lib: https://github.com/olikraus/u8g2/wiki/u8g2reference#setbusclock
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
My project is based on ESP32 + SSD1306 which works well and flashes fast. NExt, I'd like to upgrade to a bigger screen: Waveshare SSD1327. The issue begins.
I’m using U8G2_SSD1327_EA_W128128_F_SW_I2C u8g2(U8G2_R0, /* clock=/ 15, / data=/ 4, / reset=*/ U8X8_PIN_NONE); to drive my Waveshare SSD1327 but low flash rate. Even if I added the u8g2.setBusClock(4000000), no improvement. Same code running on SSD1306 (using SSD1306 constructor), the code flashes very fast.
I found a old post said U8G2_SSD1327_WS_128X128_F_SW_I2C is added which is designed for Waveshare SSD1327.
After upgrading to latest U8G2, in the example code of full buffer-selectionlist.ino, I didn’t find U8G2_SSD1327_WS_128X128_F_SW_I2C. I suppose the constructor is available and I manually added it to my code, still runs slow, the GUI shows me line by line. Any solution? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions