two i2C device at same time...

If doesn't fit into any other category ....
Post Reply
its1000
Posts: 55
Joined: Thu May 20, 2021 6:57 pm
Has thanked: 1 time
Been thanked: 1 time

two i2C device at same time...

Post by its1000 »

hello to all,

I have a question regarding I2C used with Annex.
I would like to connect on the same ESP at the same time, an OLED screen 128*64 and an RTC clock DS3231. is it possible?

is there any specifical trick regarding connections and commands ?

thank you in advance for your help.

regards.
User avatar
PeterN
Posts: 97
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 41 times
Been thanked: 45 times
Contact:

Re: two i2C device at same time...

Post by PeterN »

The I2C- bus addresses the devices by their specific 7bit addresses , so theoretically 128 devices at one bus with only two pins.

The help file gives some more hints: [Local Link Removed for Guests]
Take a look at the i2C-scanner there.
its1000
Posts: 55
Joined: Thu May 20, 2021 6:57 pm
Has thanked: 1 time
Been thanked: 1 time

Re: two i2C device at same time...

Post by its1000 »

thanks,
i had seen that i2c devices have address. but when we use oled screen or other devices that are directly driven by the annex (oled, rtc..) we don't use direct i2c commands (begin, end, etc...) so we don't really select an address.
bugs
Posts: 46
Joined: Mon Feb 08, 2021 10:10 pm
Has thanked: 7 times
Been thanked: 20 times

Re: two i2C device at same time...

Post by bugs »

You don't see the addresses because Annex has them inbuilt - it knows the DS3231 is fixed address of &H68 for example and the OLED will be &H3c (or 3d).
So - to answer your question - yes you can use two I2C devices on the same wires but not e.g. two DS3231s as their addresses would be the same.
its1000
Posts: 55
Joined: Thu May 20, 2021 6:57 pm
Has thanked: 1 time
Been thanked: 1 time

Re: two i2C device at same time...

Post by its1000 »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sun Jul 11, 2021 2:41 pm You don't see the addresses because Annex has them inbuilt - it knows the DS3231 is fixed address of &H68 for example and the OLED will be &H3c (or 3d).
So - to answer your question - yes you can use two I2C devices on the same wires but not e.g. two DS3231s as their addresses would be the same.
Extremely clear, that what i was suspecting and you confirm it clearly. thank you for your time to answer my questions!
Post Reply