Mixing hardware & software i2c on same port pins #13730
Unanswered
ADenislebel
asked this question in
Hardware & Peripherals
Replies: 2 comments 1 reply
-
That sounds strange. MUX and Expander should just be two different devices on the I2C bus. You just have to create the I2C object only once and use it for both devices. In any case, you cannot have both hardware and software I2C on the same pins. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I got it resolved by doing exactly that. I created a short py to just
create the I2C object and imported into both pys that require access to the
i2c bus. Thanks again and have a nice day...Denis
…On Thu, Feb 22, 2024 at 12:35 PM Robert Hammelrath ***@***.***> wrote:
That sounds strange. MUX and Expander should just be two different devices
on the I2C bus. You just have to create the I2C object only once and use it
for both devices. In any case, you cannot have both hardware and software
I2C on the same pins.
—
Reply to this email directly, view it on GitHub
<#13730 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEFK5EOUV5SRBBGJ3H7WAD3YU56X5AVCNFSM6AAAAABDVKVYNSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNJZHA2TA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, my platform is RP2. I can access 4 x HTU21 sensors via a pca9548 multiplex. I got that working first using code obtained on GitHub. The driver code uses the hardware based I2C functions to access both the mux and subsequently the HTUs on the mux output pins. I also need to access 8 output IOs via a PCF8574 expander on the same bus (same SCL & SCK pins). Needless to say the Mux and the expander have different I2C addresses. Both I2C access work separately. However when I attempt access both I2C ports, the first access works but the other access fails. Whichever I run first cause the other to fail. When the expander is accessed second I get a writeto() error on the first attempt to write to the expander. When the Mux+Htu is accessed second it give a timeout error on writing to the mux when setting the chnl/snsr that I want to read. My question is it because the Hardware and Software I2C drivers can't co-exist on the same port. And if so is there a work around possible. At the moment I'm considering having to re-initialize each I2C port on every write or read. Will that work or is there other issue to consider.
P.S. I did not include code example because I'm on mission to understand and learn.
Thanks Denis Lebel
Beta Was this translation helpful? Give feedback.
All reactions