Why I2C Pins in Raspberry Pico can't be read alternatively?

LeanSol345

Junior Member level 2
Joined
Apr 6, 2024
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
185
Hello,

I'm designing a data logger using Raspberry Pico W to store I2C supported SHT30 (Temp/Humidity) sensor data in SD card.
I've a condition that SHT30 can be used at any I2C port (either 0 or 1).

As in code given below, when I'm storing data in SD card from I2C1 port it stores data correctly.
But when I call function from file written for I2C0, it shows me error although I change the pins of SHT30 sensor from I2C1 to I2C0.

There might be a chance that only one I2C port can be used for single sensor (or like that.) but I could not find something like that on internet.

How this can be resolved?
There are no errors in logic and files written for different ports of sensor as they give true output individually.

 

Pin assignment for I2C0 doesn't correspond to pinout specification, can be e.g. 19/20 rather than 20/21.

[Edit] Please ignore my previous comment. I learned that Pin=xx refers to GP rather than pin numbers.
 
Last edited:

Hi
If it works on one I2C bus ... I don't expect it to be an I2C addressing problem.

Klaus
 

Hi
If it works on one I2C bus ... I don't expect it to be an I2C addressing problem.

Klaus
Dear Klaus, can you plz guide me how to attempt the issue. I've tried few ways (changing pins, code etc.) but could not resolve it.
 

Hi

From what I understand...
Your raspberry has (at least) 2 dedicated I2C busses. You say using the one does work.. using the other does not work.

We don't have information to validate your information, nor do we have a clear error description. ... nor do we know what you did for debugging ... and it's results.

So it's hard to assist you.

Your schematics, your photos of wiring, your scope pictures, your bus I2C function return codes...

Give us something we can validate.

Klaus
 

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…