u8g2 icon indicating copy to clipboard operation
u8g2 copied to clipboard

Doesn't work with ESP32-C3

Open berkut0 opened this issue 1 year ago • 11 comments

I tried almost every combination on my Wemos C3 mini and none of the options worked. I've tried putting an I2C address, changing SDA and SCL, combining settings, but all to no avail. There is some kind of bug, as there are libraries that work with the same device fine

For example, that works: https://github.com/ThingPulse/esp8266-oled-ssd1306

berkut0 avatar Jul 17 '23 20:07 berkut0

Which constructor did you use

olikraus avatar Jul 18 '23 12:07 olikraus

I tried all combinations of 128x64 I2C with different pin combinations.

Screenshot

berkut0 avatar Jul 18 '23 18:07 berkut0

I think it's related https://github.com/olikraus/u8g2/issues/1720 I went the same way, tried setting I2C address, manipulating pins, wiring But certainly the issue in not in the wiring or i2c address - there are libraries that work with known pins and address

berkut0 avatar Jul 23 '23 06:07 berkut0

For u8g2 the i2c address has to be multiplied by 2 (see reference manual).

olikraus avatar Jul 23 '23 11:07 olikraus

You're amazing! Thank you so much!

I'm not sure where to find this in the reference manual (I've searched and haven't found it). But it works!

Doubled I2C address works!

berkut0 avatar Jul 23 '23 18:07 berkut0

Here: https://github.com/olikraus/u8g2/wiki/u8g2reference#seti2caddress

See the argument description. There are also several issues related to this question.

olikraus avatar Jul 23 '23 18:07 olikraus

Should it always be doubled, no matter if it's C3 or another chip?

berkut0 avatar Jul 23 '23 21:07 berkut0

Yes.

olikraus avatar Jul 24 '23 11:07 olikraus

Thank you! I don't want to be intrusive, but I feel like there's a certain heterogeneity. Let's say it's necessary. Can we make this more obvious, at least in examples? I have never worked with an i2c device where the address had to be doubled. I'm not the kind of experienced developer who can say that it's not a common thing, but it really feels like a very specific detail

berkut0 avatar Jul 25 '23 00:07 berkut0

Maybe, the Bus clock, in Standard in arduino esp32 it is fixed to 1MHz.. the ssd1306 has a Maximum specification on 400Khz. I cant find the u8G2 init to 400khz in source.

You can try u8g2.setBusClock(400000); before u8G2.begin()?

My fail? I dont have a C3 to Test it.

schuppeste avatar Nov 08 '23 19:11 schuppeste

Thank you! I don't want to be intrusive, but I feel like there's a certain heterogeneity. Let's say it's necessary. Can we make this more obvious, at least in examples? I have never worked with an i2c device where the address had to be doubled. I'm not the kind of experienced developer who can say that it's not a common thing, but it really feels like a very specific detail

Hmm, I guess I missed to answer this. This topic has been discussed very often meanwhile here in this project. I agree, that this "double" value of the i2c address is unusual and maybe wrong. However there are examples, where the "doubled" i2c address is used by the display vendor.

See here for further info: https://github.com/olikraus/u8g2/issues/821

olikraus avatar Nov 08 '23 20:11 olikraus