#I2C error on RP2
1 messages · Page 1 of 1 (latest)
Example:
import board, busio
i2c = busio.I2C(board.GP21, board.GP20)
assert i2c.try_lock()
print(i2c.scan())
# prints: [32, 80, 104]
buff = bytearray(4)
i2c.readfrom_into(32, buff)
# OSError: [Errno 19] No such device
I2C error on RP2
According to a comment in the RP2 port,
// The RP2040 I2C peripheral will not perform 0 byte writes.
// So use bitbangio.I2C to do the write.
Since the scan uses 0-byte writes, that means the scan is not using the i2c_write_timeout_us SDK call.
Do you have three devices on your I2C bus? Have you successfully used I2C with the other devices?
I have not yet successfully used I2C with any of the devices. I expect to see at least 2, and the address 32 is one of them.
I believe i2c.scan is done with bit-banging
Yes 3 makes sense actually. RTC, EEPROM, and GPIO expander.
I would try reducing the problem space by removing the other devices from the bus. Also do you have pull-up resistors on SDA & SCL?
Removing other devices is difficult. Yes there are pullup resistors.
Two of the addresses belong to the same PCF8575 chip, the other is the RTC which might conceivably be removable.
There is an existing CircuitPython library for the PCF8575 if you'd like to try that out. https://github.com/adafruit/Adafruit_CircuitPython_PCF8575
Yes I am using that and so I peeled away the outer layers to trigger the bug just with busio
No difference. Tried also communicating with the other devices without success. Also tried with bitbangio since it seems to be ok for scanning.
Guess I'll need to get a scope set up
Annoyingly the Pico SDK has two error paths that return PICO_ERROR_GENERIC and mask an internal error flag.