This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf9160 I2C

I USE 9160 with i2c ,send data. then it tips :

[00:02:07.716,918] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m

what  is wrong ?help me ,thank you

  • Error 195952641 maps to this error:

    NRFX_ERROR_DRV_TWI_ERR_ANACK    = (NRFX_ERROR_DRIVERS_BASE_NUM + 1), ///< TWI error: Address not acknowledged.

    The I2C device isn't acking the address.

    Hope that helps!

  • i use nrf9160 's  I2C with max20353,communication.now , first  read the max20353 's ID ,below,tips.

    [00:04:07.193,359] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m

    i tried every means,but , it is  so , still.

    //============================
    /*
    #define MAX20303_SLAVE_ADDR            (0x50 >> 1)
    #define MAX20303_SLAVE_WR_ADDR        ((MAX20303_SLAVE_ADDR << 1))
    #define MAX20303_SLAVE_RD_ADDR        ((MAX20303_SLAVE_ADDR << 1) | 1)
    */
    static int32_t myi2c_read()
    {
      uint32_t rslt = 0;
      static  uint8_t  read_data = 0;

      i2c_reg_read_byte(max20353_I2C,LSM6DSO_I2C_ADD,0x00,&read_data); //   0X51    
      printf("feng read_data0:%X \r\n",read_data);

      return rslt;
    }
     

    what is the problem ?!

  • The problem is that the slave device is not responding to the device address you are putting onto the I2C bus. It looks like you may be thinking that you need to add the read/write bit to an address yourself, which is not true. The driver will do this for you. Just pass the slave's I2C address with no modification to i2c_reg_read_byte(), Make sure you have the correct address from the datasheet.

Related