pico-feedback icon indicating copy to clipboard operation
pico-feedback copied to clipboard

Document that 0-byte I2C writes are not possible

Open dhalbert opened this issue 4 years ago • 3 comments

The I2C hardware used in the RP2040 does not provide for zero-length writes. Such writes are often used for device probing on an I2C bus. A read works for some devices but not all (a read is used in the bus_scan example in pico-examples).

Neither the C/C++ SDK doc nor the RP2040 datasheet document that zero-length writes are not possible. There is a hint in the SDK:

    // Synopsys hw accepts start/stop flags alongside data items in the same
    // FIFO word, so no 0 byte transfers.

I think it would be good to document the limitation in the SDK doc and the datasheet. The datasheet could explain why as well. Thanks.

Ref https://github.com/raspberrypi/pico-sdk/issues/238.

dhalbert avatar Mar 08 '21 14:03 dhalbert

This got discussed elsewhere, extensively, at some point. But I can't remember where. It would be good to consolidate this issue with that one. Anyone remember where we talked about this?

aallan avatar May 25 '21 10:05 aallan

Might have been an internal google-chat discussion? :shrug:

(There's also the SPI-hardware-can't-transfer-multiple-bytes-with-a-single-chipselect-pulse which is similar-but-different to this I2C-hardware-can't-do-0-byte-transfers)

lurch avatar May 25 '21 10:05 lurch

There's also the SPI-hardware-can't-transfer-multiple-bytes-with-a-single-chipselect-pulse which is similar-but-different to this I2C-hardware-can't-do-0-byte-transfers

Maybe that is what I was thinking about.

aallan avatar May 25 '21 10:05 aallan