I have just started playing with the RP2040 mikroBUS and cannot get the I2C comms working. I input an I2C scanner https://forum.arduino.cc/t/need-an-i2c- … 40/1022209
and all I get is error =2 for each Wire.endTransmission();
I have an Adafruit SHT40 plugged into the QWIIC connector, but even without that i should see the MAX17048 fuel gauge.
I’m using the Arduino IDE with earlephilhower/arduino-pico installed and also Arduino Mbed OS RP2040. Neither one directly supports the SparkFun RP2040 mikroBUS.
It appears that the default SDA and SDC are GPIO 16 and 17 respectively for the pico, however on the mikroBUS version they are GPIO 6 and 7. I have not been able to force the correct GPIOs into Wire.
Any thoughts? Has anyone gotten I2C working on the mikroBUS board?
-W
It might need to be re-flashed to default; check out “3. Programming Tip” a bit down from here https://learn.sparkfun.com/tutorials/rp … e-overview and also ensure it isn’t doing weird bootloader things (described in a few spots in the guide)
After re-flashing try the default example https://learn.sparkfun.com/tutorials/rp … no-example and see how that goes
Thank You TS-Russell. I just did the re-flash. I haven’t touched mbed in many years and I’m being reminded why I stayed away.
I have to re-read the tutorial and see what you mean by weird boot-loader things.
The mikroBUS showed up as a new COM port but I couldn’t upload to it. I had to reboot the board to UF2 mode and upload, as I have been doing all along.
For this latest try I used the MBed OS RP2040 Arduino core and selected Raspberry Pi Pico (the only option available).
There is a difference, I now get error = 1 for each Wire.endTransmission(); error 2 meant nothing was there, error 1 is data too long so I’m searching the web for an interpretation.
The Arduino example you reference is for a BME280, which I don’t have. I think my scanner demo is still a good example, I have gotten it working with many other boards.
Thanks again.
-W
OK, got it working.
RP2040 mikroBUS uses the same GPIO SDA and SCL as Thing Plus RP2040 so use Philhower earlephilhower/arduino-pico and select SparkFun Thing Plus RP2040 as the board.
Set code on I2C_Scanner program to use Wire1 (Wire1 is SDA/SCL GPIO6/GPIO7, which corresponds to Raspberry Pi Pico GPIOs SDA1 and SCL1)
-W