I would like to run a display (dollatek 2.42-inch 128x64-oled - ssd1309 driven display) on my Heltec board (ESP32-S3) with the constructor "HW" via I2C. I have to mention that the Heltec board has already an onboard display and in this case I use the U8G2 library (constructor HW).
Back to my problem: With the constructor "SW", the external display works fine, but it is too slow for the application. If I change the constructor here to HW, the display remains black. Note: the onboard display is deactivated.
What should I do to solve the problem?
Run a I2C Scanner sketch and see if both are detected.
Can you give links to the products ?
If that display can do SPI mode, then you could try that. Perhaps a software SPI is possible.
How did you deactivate the onboard display ?
Did you use the software I2C with your own pins ? Which pins do you use for the hardware I2C ?
The software I2C of the U8G2 library is indeed slow, I have not looked into it why it is slow. Most OLED display allow a higher speed than the default 100kHz.
Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE
I would like to answer your questions:
I use the ESP32 board from Heltec (WiFi Kit 32 (V3) – Heltec Automation).
Yes, this display supports both SPI and I2C. You can configure it by re-soldering the resistors.
I only address the external display with the library U8G2. This means that the onboard display is deactivated.
For IIC pins, you can use any idle GPIO pins. You just need to initialize these pins as IIC pins. (https://www.espressif.com.cn/sites/default/files/documentation/esp32-s3_datasheet_en.pdf)
The first goal is to run a I2C Scanner sketch with changed pins that detects the display.
What is the reason not to use the SPI bus ?
Can you show the code that changes the I2C pins ?
Do you know if anyone in the world has a working I2C bus with that Heltec board ?
Heltec calls it a "ESP32" and sometimes they are specific calling it a "ESP32-S3FN8", that is confusing. Everyone calls that a ESP32-S3.
So the onboard OLED I2C is at GPIO17 and GPIO18, but they are not available on the pins of the board.
This is their I2C library: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/esp32/libraries/Wire/src
The external display runs fine via the I2C bus, but too slowly, because I can only use the U8G2 library with the constructor SW. It would definitely be faster with the HW constructor. And the question is, why is only SW supported in this case?
Of course I can also use SPI. But then I have to change the display again.
The software I2C of the U8G2 library has nothing to do with a hardware I2C bus. The software I2C is just two digital pins going up and down in software, just like blinking a led in software.
To get the hardware I2C going, the first thing is to get a I2C Scanner sketch working with the hardware I2C.
If no one in the world has the hardware I2C bus working for a external I2C module on the Heltec board, then maybe it is not possible.
The U8G2 library supports the hardware I2C bus, and as a extra, it has also software I2C. It supports both. Somehow it can not use your specific hardware I2C bus on your Heltec board. The U8G2 library works, but your specific hardware I2C bus does not work. Maybe the software is still in development and has bugs, maybe your code to change the pins is wrong. I don't know.
Thank you very much for your advice.
I am in contact with the manufacturer of the board. They don't want to or can't understand the problem. The answer is always that you can use any GPIO. I did that and it works, just not at the speed I wanted, as I said before. I assume the problem lies in the Heltec architecture.
You could also try to use the hardware pin remapping feature of u8g2. It is not supported by all boards but ESP32 might work here.
The pin remapping is described here below the table.
So the constructor might look like this:
..._HW_I2C( U8X8_PIN_NONE, CLKPIN, DATAPIN );