OLED SSD1306 I2C Address

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 602
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 494 times
Been thanked: 132 times

Re: OLED SSD1306 I2C Address

Post by jgu1 »

Hi all!

I report a bug for these tiny display In Fc9for a while ago. Do you have FC8, try to make a test in this SW work fine there, But not in FC9. ;)

viewtopic.php?f=3&t=790

Br Jorgen

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

I think it's a strange timing problem. And that could be the reason the display is updated very very slowly (like 1 minute to draw a small text on the display or clear the display).

These are screenshots from my logic analyser with several different settings for the I2C baud rate:

Baud rate in SSD1306 I2C properties = 100kHz
100khz.jpg
100khz.jpg (35.27 KiB) Viewed 2134 times
Baud rate in SSD1306 I2C properties = 400kHz
400khz.jpg
400khz.jpg (40.31 KiB) Viewed 2134 times
Baud rate in SSD1306 I2C properties = 1MHz
1Mhz.jpg
1Mhz.jpg (46.12 KiB) Viewed 2134 times
Even with a custom baudrate it keeps 490hz...

I hope that with this information Matrix can fix this problem really fast.

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

And this is with the Arduino/ESP32 library with Adafruit sketch..

This one works..
Attachments
Adafruit.jpg
Adafruit.jpg (37.03 KiB) Viewed 2131 times

jgu1
Posts: 602
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 494 times
Been thanked: 132 times

Re: OLED SSD1306 I2C Address

Post by jgu1 »

Hi MJU

Well spottet :D So I was rigth viewtopic.php?f=3&t=790

Have you testet in FC8 (Arduino) it works there

Jorgen

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

Not tested in FC8 because this project has to work with an ESP32 and that wasn't supported in this version.

BTW: I think this problem may occur in the SPI version too. I've tested the ESP with the SPI version of the SSD1306 and this also didn't work..

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: OLED SSD1306 I2C Address

Post by BenR »

Hello,

With the I2C timing problem you've highlighted. Please can you confirm the target MCU you're using and also the I2C channel you're using and I'll investigate for you.

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

Thank you Ben,

I'm using an (NodeMCU) ESP-Wroom-32 (version 1.1).
The I2C channel I'm using is "software" on pin A21 (SDA) and A22 (SCL). (same as the Arduino sketch)

BTW: I2C Channel 1 in FC proposes pin B4 on the board (A36), but this is not available on the board.

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

:oops: any news on this one?

LeighM
Valued Contributor
Posts: 394
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 69 times
Been thanked: 208 times

Re: OLED SSD1306 I2C Address

Post by LeighM »

Using software aka bitbang I2C is very much a last resort on ESP32 due to it running an RTOS, hence timings can't be guaranteed and tend to stretch considerably.
Are there any hardware channel I2C remap pins that you can use?

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: OLED SSD1306 I2C Address

Post by MJU20 »

I will look into remapping the I2C.

Too bad it took a week to read this and meanwhile the display was tested with an Arduino sketch using the same IO's as those I used with FC. :shock:

Post Reply