🎁📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 2 Day orders by 11am Monday, December 16 📦❄️📬🎁
0

Adafruit_blinka with I2C3 on raspberry pi 4
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Adafruit_blinka with I2C3 on raspberry pi 4

by ChrisJerome on Wed Nov 27, 2019 9:16 pm

Hi,

The i2c clock stretching bug is fixed on RPi4 by enabling I2C-3. This is great news because I would like to use BNO055 with the RPi over I2C. I have I2C-3 enabled and I have installed adafruit_blinka, but when I run blinkatest.py I get the error RuntimeError: I2C Bus #1 not found...

Is there a way to get adafruit_blinka to work with I2C-3 on RPi4? I've tried modifying the line i2c = busio.I2C(board.SCL, board.SDA) to i2c = busio.I2C(board.SCL3, board.SDA3), but that was ineffective.

Thanks!

ChrisJerome
 
Posts: 6
Joined: Tue Nov 26, 2019 5:44 pm

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by adafruit_support_mike on Thu Nov 28, 2019 2:57 am

Hmm.. I haven't heard of an I2C-3 channel, but would guess that enabling it disables I2C-1.

I don't think there's any code support for that in Blinka, and will have to check with the folks who handle that code to see if it's possible to make it work with the code in its current state.

adafruit_support_mike
 
Posts: 59708
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by ChrisJerome on Thu Nov 28, 2019 10:30 am

I haven't found much documentation, except this:

Re: Raspberry Pi 4 Thread - general discussion
• Quote
Sun Sep 29, 2019 10:00 am
jcyr wrote: ↑
Sun Sep 29, 2019 12:44 am
jdb wrote: ↑
Wed Sep 11, 2019 1:38 pm
Can you try using i2c3 on GPIO2&3?
In config.txt comment out dtparam=i2c_arm=on and add the line dtoverlay=i2c3,pins_2_3 . The corresponding device node is /dev/i2c-3.
Yes, clock stretching seems to work correctly on IC2-3.

From <https://www.raspberrypi.org/forums/viewtopic.php?p=1547115>


As you will see this disables I2C-1 and uses the same pins. However it appears there are multiple I2C channels available on RPi4, and they don't all use pins 2 and 3. I don't know if the clock stretching bug is fixed on any except IC2-3

ChrisJerome
 
Posts: 6
Joined: Tue Nov 26, 2019 5:44 pm

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by adafruit_support_mike on Fri Nov 29, 2019 1:57 am

I've passed the information along to the folks who handle the Blinka CircuitPython code for the RasPi. They'll check it out, and work of getting I2C-3 support added to the system if it's valid.

adafruit_support_mike
 
Posts: 59708
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by ChrisJerome on Fri Nov 29, 2019 12:52 pm

Thanks!

Meanwhile, in case anyone else is trying this, I got the BNO055 working over I2C-3 with the older instructions for the Raspberry Pi/Beagle Bone Black. I configured the connection using:

Code: Select all | TOGGLE FULL SIZE
bno = BNO055.BNO055(i2c=3)


And I followed the instructions for using a bit-banged non-standard I2C channel shown here: viewtopic.php?t=114464. In particular, I had to modify BNO055.py as shown in the GitHub link.

ChrisJerome
 
Posts: 6
Joined: Tue Nov 26, 2019 5:44 pm

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by MakerMelissa on Mon Dec 02, 2019 9:15 pm

ChrisJerome,

I have now added support for i2c-3 to Blinka. You can update to the latest version by typing:
Code: Select all | TOGGLE FULL SIZE
pip3 install --upgrade adafruit-blinka

Pins 2 and 3 are the same as SDA and SCL, so all you need to do is have i2c-3 enabled and it should work automatically.

Melissa

MakerMelissa
 
Posts: 77
Joined: Wed Jun 05, 2013 2:10 am

Re: Adafruit_blinka with I2C3 on raspberry pi 4

by ChrisJerome on Mon Dec 02, 2019 10:29 pm

Awesome! Thank you!

ChrisJerome
 
Posts: 6
Joined: Tue Nov 26, 2019 5:44 pm

Please be positive and constructive with your questions and comments.