Page 1 of 2

Change I2C address SSD1306 component

Posted: Fri Jan 17, 2025 11:18 pm
by MJU20
I've bought a ESP32C3 DEV board with a (very) small (0.42") OLED display.
I tried it with the SSD1306 component but can't change the I2C address to 0x3C.

I found this address with my logic analyser and an Arduino sketch that works.
According to all resources this is SSD1306 protocol with address 0X3C.

So I found another FC10 component (SSH1106) that makes use of this I2C address, tried it and it works.
But... this can't change the amount of pixels (the OLED actually has 74 x 40 pixels), so I need an offset to display what I want.

Is there a way to change the SSD1306 component I2C address to 0X3C?

Re: Change I2C address SSD1306 component

Posted: Sat Jan 18, 2025 9:49 am
by chipfryer27
Hi

The component has two preset addresses (0x78 / 0x7A) which you can select, but I guess you could edit the source code to give anything you want.

Regards

Re: Change I2C address SSD1306 component

Posted: Sat Jan 18, 2025 1:24 pm
by medelec35
Hello,
I have changed the source code to allow you to select either the two pre-set addresses or a custom address.
Browse to this location using file explorer , it's hidden by default so just paste the link into your address bar.

Code: Select all

%ProgramData%\MatrixTSL\FlowcodeV10\Components
Place the attached component.
If Flowcode is already open, then you will need to reload your project for the new component to work
If you run any component updates, then the component you added will be overwritten, so it will stop working again (unless the component update has been pushed).

Re: Change I2C address SSD1306 component

Posted: Sat Jan 18, 2025 5:19 pm
by MJU20
Hey thank you for you fast action!

But it doesn't work. :-(

The I2C address in the new component is set to "custom" and I choose "0x3C" (which shows up as 60).
But when I look at the I2C signal on my logic analyser it sends 0x00
nieuw.png
nieuw.png (88.23 KiB) Viewed 1847 times
The data send over the I2C bus with address 0x3C (60) (shows up as 0x00)
oud.png
oud.png (95.29 KiB) Viewed 1847 times
And the data over the I2C bus with the SSH1106 protocol (and address 0x3C)

Re: Change I2C address SSD1306 component

Posted: Mon Jan 20, 2025 8:48 am
by medelec35
Sorry, there was a typo within the component.
I have also changed the component so the custom value is shown as hex format.
Can you try the attached , please.

Re: Change I2C address SSD1306 component

Posted: Mon Jan 20, 2025 10:54 pm
by MJU20
Thanks Medelec35, I only had the chance to test it live on the dev board, but the display stays dimmed.
I need to get my hands on my logic analyser to check the data on the I2C bus, but I probably won’t have the time before the weekend.

I will keep you informed...

Re: Change I2C address SSD1306 component

Posted: Wed Jan 22, 2025 3:11 pm
by MJU20
Flashed the board again with the new component, but still the I2C address is not what it should be..
SSD.png
SSD.png (141.97 KiB) Viewed 1750 times

Re: Change I2C address SSD1306 component

Posted: Wed Jan 22, 2025 5:08 pm
by medelec35
Hello.
I can see why there is confusion.
with the SSD1306 by selecting 0x78 then that is the 8bits for a write.
The transaction_Initialise right shifts so 0x3C is stored which is the default address.
If a Transaction_write is called then the 7bit address will be left shifted so 0x78 is sent
If a Transaction_Read is called then the 7bit address will be left shifted and OR'd with 1 so 0x79 is sent

You are entering 0x3C, which is entered as a Read.
That means the address analyser will see for the default address is:
0x3C>>1 = 1E

You was not to know that, nor did I util I just looked at the code I2C Cal
I will ask for the reason its done that way.

What you could do to find the correct address to add is use the Address sniffer/scanner
It will show the Write address, which is what you require to enter in the text box
SSD1306 default adress 0x3C.png
SSD1306 default adress 0x3C.png (23.6 KiB) Viewed 1731 times
In the case of my display, it was 0x78

Re: Change I2C address SSD1306 component

Posted: Wed Jan 22, 2025 5:37 pm
by MJU20
Hey Medelec35,

0x78 works for me too, but there is a lot of "garbage pixels" shown the display..

Thanks again!

Re: Change I2C address SSD1306 component

Posted: Thu Jan 23, 2025 8:23 am
by medelec35
MJU20 wrote:
Fri Jan 17, 2025 11:18 pm
But... this can't change the amount of pixels (the OLED actually has 74 x 40 pixels), so I need an offset to display what I want.
Have you tried adjusting the properties to match your display?
SSD1306 properties.png
SSD1306 properties.png (14.04 KiB) Viewed 1652 times