Can't get I2C to work on Feather RP2040

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GuyBooth
 
Posts: 32
Joined: Wed Sep 08, 2021 3:56 pm

Can't get I2C to work on Feather RP2040

Post by GuyBooth »

I have a VL6180 ToF sensor connected to I2C1 pins 2 & 3 on my RP2040 feather. I have added a 10k pullup resistor to the SCL and SDA connections. I am programming with Arduino.
The testbed program finds the sensor at address 0x29 which is what I expect.
The VL6180 example programs constantly return 255 when the sensor is read, even with objects within 5 cm.
If I remove power from the sensor, I still get 255. I never see a timeout - I would have expected to see one.
Am I missing something with the Feather? This was working with an Itsy Bitsy Express M0.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Can't get I2C to work on Feather RP2040

Post by adafruit_support_carter »

Note in the TestBed I2C scan which Wire (I2C) instance the address shows up on. For the Feather RP2040, it should be Wire1:
https://learn.adafruit.com/adafruit-fea ... qt-3084853

To specify Wire1 with the VL6180X, pass in the non-default Wire bus when calling begin:

Code: Select all

  if (! vl.begin(&Wire1)) {

User avatar
GuyBooth
 
Posts: 32
Joined: Wed Sep 08, 2021 3:56 pm

Re: Can't get I2C to work on Feather RP2040

Post by GuyBooth »

Thank you.
I've switched to a different library (Adafruit_VL6180X) and after modifying for Wire1 have been able to get some results.
I'm still not sure why the other one wasn't working but I'm sure it was tied into the Wire v Wire1 issue. With this library working I may not need to follow that up.

User avatar
SalsaShark037
 
Posts: 1
Joined: Mon Nov 01, 2021 3:33 pm

Re: Can't get I2C to work on Feather RP2040

Post by SalsaShark037 »

Similar issue, so I'm posting in your thread.


When I try to pass in &Wire1 into my ss.begin() function, I receive this error:

Compilation error: invalid conversion from 'TwoWire*' to 'uint8_t' {aka 'unsigned char'} [-fpermissive]

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Can't get I2C to work on Feather RP2040

Post by adafruit_support_carter »

@SalsaShark037 Please start a new thread for your issue.

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

Return to “Feather - Adafruit's lightweight platform”