iic can't read data but can write data

  1. Hi, I have some questions about i2c when I use
    i2c_write_read_dt(&dev_i2c,&config[0],1,&config[1],1);
    The data cannot be read correctly,
    i2c_burst_read_dt(&dev_i2c,0x08,temp_reading,sizeof(temp_reading));
    The data read will be shifted. I use nrf5340 audio dk to control max30210. How can I fix this?
    When I use this code, the data is not read correctly. I am using nrf5340 audio dk to control max30210. When I use a logic analyzer to observe the data, it seems that there is no waiting after ark when reading data. I'm not sure how to fix this issue.
Parents Reply
  • Hi,

    It looks like you're trying to write and then read out the same register from the I2C slave, is this correct?

    It seems like the write is successful, but the slave return a NACK when you try to read out the same register later here:

    From the nRF5340 perspective it looks correct. Maybe you need to wait some time before you can read out the register after writing. The read process should be specified in the datasheet of the slave device,

    regards

    Jared

Children
Related