The Qwiic connector on the ProMicro RP2040 does not seem to be usable as a hardware-supported I2C connector under MicroPython. (MicroPython v1.17 on 2021-09-02; Raspberry Pi Pico with RP2040).
The only rp2 module that I can find is the version for the original Raspberry Pi Pico. It seems to hard code allowed values for hardware resources like I2C(1).
The code I am attempting to use is:
import rp2
import machine
print("i2c bus: 1")
i2c1 = machine.I2C(1, scl=machine.Pin(17), sda=machine.Pin(16), freq=100000)
output = i2c1.scan()
print(output, len(output))
print("Done")
The response I consistently receive is:
i2c bus: 0
[] 0
i2c bus: 1
Traceback (most recent call last):
File "<stdin>", line 20, in <module>
ValueError: bad SCL pin
>>>
I get the same behavior with other ‘improved’ version boards such as AdaFruit’s QtPy RP2040 that provide a Qwiic connector.
The same code works nicely on the original Raspberry Pi Pico board. It seems that the pins need to be mapped exactly as on the original board or or some changes must be setup in a custom rp2 module for the Qwiic connector to behave usefully.
It is suggestive that your ‘Getting started’ documents show using the Qwiic connector in an odd and rather silly way, not for I2C.
Can you suggest a source for an rp2 module that will work correctly with your board? Or some other work around? I don’t want to use SoftI2C.
Carbuncle