Why am I only receiving the first address byte? (I2C Protocol)

后端 未结 4 1733
南笙
南笙 2021-01-27 03:52

Expecting the slave to ACKnowledge and return data, but it does not. This is my protocol. This is my Datasheet

The datasheet mentions \"The slave will answer by sending

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 04:29

    Difficult to tell without having details of the i2c library that is being used, but the one thing I'd be checking first is the i2c_start(I2C_READ).

    The i2c address provided in the datasheet is 0x5a as you've put in your macro. But the first byte also contains the read/write flag as the least significant bit. The i2c_start() function has to be putting 0xb5 onto the bus (i.e. (0x5a << 1) + 1 for a read)

    If i2c_start() is not, then your slave device is not actually being addressed and so won't ack.

提交回复
热议问题