Hello,
I need advice. Using ESP32 DevKit and on standard I2C pins have connected DS3231 and 2x SHT20 sensor. Because SHT20 have same address I try create another I2C connection in other GPIO(test 0/4 and 32/33 gpio) but still have 119 EROR. When I try scan method on this give me [] result. One SHT connected to standard I2C working well.
Is any option for create working structure of this sensors without TCA9548?
Many thanks.
SoftI2C with two same devices
Re: SoftI2C with two same devices
Hi,
I'm using an ESP32 and it's two I2C without a problem. Maybe there's an error in your configuration?
Could you post how you instantiate the i2c devices?
On the ESP32 DevKit I'd try to use the hardware I2C bus.
Here's the official documentation on SoftI2C: https://docs.micropython.org/en/latest/ ... re-i2c-bus
(there's also the documentation for hardware I2C if you scroll around a little)
Also note that there are some pins you shouldn't use: https://docs.micropython.org/en/latest/ ... rd-control
Regarding pin numbers: I'd think you should try other pin numbers. See the link above.
best regards,
Chris
edit: Just realized you gave pin numbers, edited post accordingly.
I'm using an ESP32 and it's two I2C without a problem. Maybe there's an error in your configuration?
Could you post how you instantiate the i2c devices?
On the ESP32 DevKit I'd try to use the hardware I2C bus.
Here's the official documentation on SoftI2C: https://docs.micropython.org/en/latest/ ... re-i2c-bus
(there's also the documentation for hardware I2C if you scroll around a little)
Also note that there are some pins you shouldn't use: https://docs.micropython.org/en/latest/ ... rd-control
Regarding pin numbers: I'd think you should try other pin numbers. See the link above.
best regards,
Chris
edit: Just realized you gave pin numbers, edited post accordingly.
Re: SoftI2C with two same devices
I update firmware to 1.16 and using this i2c declaration.
from machine import SoftI2C, Pin
from machine import SoftI2C, Pin
Code: Select all
i2c = SoftI2C(sda=Pin(21), scl=Pin(22), freq=100000) // this i2c working good
i2co = SoftI2C(sda=Pin(32), scl=Pin(33), freq=100000) // not working, scan return [], write and read get 119 ERROR
or
i2co = SoftI2C(sda=Pin(0), scl=Pin(4), freq=100000)