I have been trying to use the Adafruit QT Py RP2040 to talk to some breakout boards over I2C. Right now, I am attempting to use the BNO085 IMU board and the BMP390 altimeter board. I am running the QT Py in CircuitPython; I've tried both CP 7.0.0 and CP 6.3.0, with the associated libraries in each case. The QT Py does not recognize either of the boards I mentioned, regardless of whether I use the pins or the STEMMA connectors (since there are two I2C buses on the QT Py). In fact, just for the heck of it, I tried to daisy chain all of my breakout boards together, to see if it would recognize ANY of them. It did not. (I tried BNO085, BMP390, LC709203, TSL2591, APDS-9960).
The error for the BNO085:
>>> ValueError: No I2C device at address: 4a
I2C scan results:
>>> I2C addresses found: []
Running I2Cscan returns nothing, whether I'm wired up via the STEMMA connectors or the pins. I also briefly tried SPI and UART, neither of which worked. For my application, I really would like to stick to I2C so I have focused my efforts on that for now.
Now, from what I have seen online, the BNO085 board is very slow to reply, which causes problems for microcontrollers unequipped to handle that (paraphrasing, obviously). This can't be the issue here, because I am also using 4 other boards which do NOT have that issue, and it still does not recognize them. What's VERY interesting, is that when I use the older version of the QT Py (SAMD21), it recognizes ALL of the devices just fine. (I get memory allocation errors for seemingly no reason when I try to actually use the sensors outside of I2Cscan, so that is why I haven't just used the SAMD21 version.)
Just this morning, I used a second RP2040 board and it had the exact same issue. So, I think that most likely rules out a dead board as the issue.
My I2C scan code:
Code: Select all
import time
import board
import busio
i2c = busio.I2C(board.SCL1, board.SDA1, frequency=800000)
while not i2c.try_lock():
pass
try:
while True:
print("I2C addresses found:", [hex(device_address)
for device_address in i2c.scan()])
time.sleep(2)
finally: # unlock the i2c bus when ctrl-c'ing out of the loop
i2c.unlock()
- QT Py RP2040 does not recognize ANY I2C device, running on either CP7.0.0 or CP6.3.0, with either STEMMA connectors or pins.
- QT Py SAMD21 recognizes ALL of the same devices, running an identical I2C scan on an identical CircuitPython version.
Any help with this would be greatly appreciated, I am currently at a complete loss as to what I should try next.