Not able to get second i2c channel working

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tat2rlg
 
Posts: 4
Joined: Fri Jan 14, 2022 1:02 pm

Not able to get second i2c channel working

Post by tat2rlg »

Starting to work with the feather rp2040 (replacing 2 Arduino setups that are currently running).
currently running circuitpython.
The dual i2c channels really are interesting to me.
I have looked and can’t really find a good example of how to say hook up 2 i2c sensors that have the same address
One will go stemma connected, but the other one, that is where I am not sure.
I have a need for all Analog (a0-a3) as well, so can’t give up those ports.
I got somewhere and tried with board.D13/D12 but said something about missing pull up resistors.

Requirements:

A0 in use.
A1 in use.
A2 in use.
A3 in use.
Sensor1 - 1 - Stemma connected to sensor with address 1. (I2c)
Sensor1 - 2 - connected where? (I2c-2) (not able to use the analog ports)

(Where I would use 2 Arduinos in the past, I want to use 1 rp2040 feather)

User avatar
danhalbert
 
Posts: 4686
Joined: Tue Aug 08, 2017 12:37 pm

Re: Not able to get second i2c channel working

Post by danhalbert »

The colorful diagram on this page: https://learn.adafruit.com/adafruit-fea ... co/pinouts will let you know which pins are I2C capable. You can pick one pair that is SCL0/SDA0 and one that is SCL1/SDA1. You can use up to two I2C buses at once.

User avatar
tat2rlg
 
Posts: 4
Joined: Fri Jan 14, 2022 1:02 pm

Re: Not able to get second i2c channel working

Post by tat2rlg »

I did this. (and thank you very much for the info). This was when I used the D13 and D12 pins, and got a message about missing pull up resistor?

User avatar
danhalbert
 
Posts: 4686
Joined: Tue Aug 08, 2017 12:37 pm

Re: Not able to get second i2c channel working

Post by danhalbert »

Did you connect the second sensor board to D13/D12 and power it? `busio.I2C` looks for 3.3v pullup resistors on the I2C pins. Measure the quiescent voltage on D13 and D12: you should see 3.3V or so.

User avatar
tat2rlg
 
Posts: 4
Joined: Fri Jan 14, 2022 1:02 pm

Re: Not able to get second i2c channel working

Post by tat2rlg »

There is the missing nugget! Thanks. I will connect then try.

User avatar
tat2rlg
 
Posts: 4
Joined: Fri Jan 14, 2022 1:02 pm

Re: Not able to get second i2c channel working

Post by tat2rlg »

Thanks, Dan. That was it. works like a charm.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”