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

后端 未结 4 1775
南笙
南笙 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:17

    For I2C, it is very important to have pull-up resistors on both SDA and SCL pins. If these are not present, the bus will always read low or floating voltage. I do not know the AVR hardware enough to know how it would behave, but I would expect the "// check if the start condition was successfully transmitted" to fail if this is the case.

    In general when developing for hardware like this, I do recommend to have a logic analyzer. It can help when you are blind to what the hardware bus actually does.

    An example of such device is https://www.saleae.com/ ,but multiple vendors and/or open projects exists.

提交回复
热议问题