Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EstarDyn 1.3 inch OLED I2C 128x64 compatibility #2561

Open
balthz opened this issue Jan 2, 2025 · 1 comment
Open

EstarDyn 1.3 inch OLED I2C 128x64 compatibility #2561

balthz opened this issue Jan 2, 2025 · 1 comment

Comments

@balthz
Copy link

balthz commented Jan 2, 2025

Hi!

In case anybody else is running into this: I managed to this OLED display working using https://github.com/durydevelop/arduino-lib-oled with the code

#include <oled.h>
OLED display = OLED(A2, A3, NO_RESET_PIN, 0x3c, 128, 64, true); // A2 data, A3 clock

void setup()
{
  Serial.begin(115200);

  Serial.printf("useOffset()\n");
  display.useOffset(true);
  Serial.printf("begin()\n");
  display.begin();
  Serial.printf("setTTYMode()\n");
  display.setTTYMode(true);
  Serial.printf("clear()\n");
  display.clear();
  Serial.printf("printf()\n");
  display.printf("Hi!");
  Serial.printf("displat()\n");
  display.display();
}

void loop()
{
}

Given that library doesn't leverage hardware I2C and I need low energy consumption, I wanted to try U8G2. However, I tried all IC2 128x64 constructors and didn't get it to work.

I did notice that https://github.com/durydevelop/arduino-lib-oled sends different data to the chip than e.g. with U8G2_SH1106_128X64_VCOMH0_F_SW_I2C u8g2(U8G2_R0, A3, A2, U8X8_PIN_NONE). To see this, I changed

https://github.com/durydevelop/arduino-lib-oled/blob/f29660f46bd523d7a724b0f2b5f86ef60dcb2546/src/oled.cpp#L188-L190

to

bool OLED::i2c_send(uint8_t byte)
{
    Serial.printf("i2c_send(");
    if (byte < 16) Serial.print("0");
    Serial.print(byte, HEX);
    Serial.printf(")\n");
    
    for (int_fast8_t bit = 7; bit >= 0; bit--)

Here's the output of this, with some annotations referring to the Serial.printfs in the above code. The first bytes are coming from https://github.com/durydevelop/arduino-lib-oled/blob/f29660f46bd523d7a724b0f2b5f86ef60dcb2546/src/oled.cpp#L260-L299 and differ from what U8G2_SH1106_128X64_VCOMH0_F_SW_I2C() produces.

useOffset()
begin()
i2c_send(78)
i2c_send(00)
i2c_send(AE)
i2c_send(D5)
i2c_send(80)
i2c_send(A8)
i2c_send(3F)
i2c_send(D3)
i2c_send(00)
i2c_send(40)
i2c_send(8D)
i2c_send(14)
i2c_send(20)
i2c_send(00)
i2c_send(A1)
i2c_send(C8)
i2c_send(DA)
i2c_send(12)
i2c_send(81)
i2c_send(80)
i2c_send(D9)
i2c_send(22)
i2c_send(DB)
i2c_send(20)
i2c_send(A4)
i2c_send(A6)
i2c_send(2E)

begin() -> display()
i2c_send(78)
i2c_send(00)
i2c_send(B0)
i2c_send(00)
i2c_send(10)

begin() -> send data
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times
i2c_send(00)
i2c_send(78)
i2c_send(00)
i2c_send(B1)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times
i2c_send(78)
i2c_send(00)
i2c_send(B3)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times
i2c_send(78)
i2c_send(00)
i2c_send(B6)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times

begin() -> set_power(true)
i2c_send(78)
i2c_send(00)
i2c_send(8D)
i2c_send(14)
i2c_send(AF)
setTTYMode()
clear()
printf()
i2c_send(78)
i2c_send(00)
i2c_send(B0)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00)
i2c_send(00)
i2c_send(00)
i2c_send(7F)
i2c_send(08)
i2c_send(08)
i2c_send(08)
i2c_send(7F)
i2c_send(00)
i2c_send(00)
i2c_send(44)
i2c_send(7D)
i2c_send(40)
i2c_send(00)
i2c_send(00)
i2c_send(00)
i2c_send(00)
i2c_send(2F)
i2c_send(00) // repeated many times
…
i2c_send(78)
i2c_send(00)
i2c_send(B3)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times
i2c_send(78)
i2c_send(00)
i2c_send(B6)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times
i2c_send(78)
i2c_send(00)
i2c_send(B7)
i2c_send(00)
i2c_send(10)
i2c_send(78)
i2c_send(40)
i2c_send(00) // repeated many times

Does anybody have more knowledge than me to point me to what changes U8G2 would be required to make this chip work?

@olikraus
Copy link
Owner

olikraus commented Jan 7, 2025

Which had been the full u8g2 code for your tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants