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

i2c_burst_write difference nrf52 and nrf91 series

Dear All,

I'm using Zephyr to configure a nrf9160 as I2C master and the OPT3002 light sensor as I2C slave.
The OPT3002 has a 16bit configuration register, which I need to write to.
For this I use i2c_burst_write(), which works fine on the nrf52 series (nrf52840 & nrf52833), with I2C_0. I can write to the register and read correct light intensity values.
However, on the nrf9160, with I2C_2, I can read the registers fine, but not write to them properly. This means I cannot get the sensor out of power down mode and therefore not read any sensor values.

Now I have seen this issue with burst_write and I should probably use another i2c write function.
However, I would like to know what the difference is between the nrf52 and nrf9160, that causes this issue to only happen on the nrf9160.

Do you have any idea what causes this difference?

Kind regards,
Maaike

Parents
  • Could you try to attach a logic analyzer to the I2C pins and see if the output differs between the nRF52 and the nRF91 when you use the i2c_burst_write function. That would be interesting to see. I'll soon take christmas vacation for some days, so I don't have time to do it myself before then.

    Best regards,

    Simon

  • I was able to check it with the logic analyser and there is a difference between the nrf52 and nrf91 in writing to the configuration register. In the reading of the ID register there is no difference.

    Some addresses and values:
    I2C address read =  0x44
    I2C address write = 0xC4
    MANUFACTURER_ID register address =  0x7E
    CONFIGURATION register address = 0x01
    MANUFACTURER_ID = 0x5449
    Configuration value to write = 0b1100011xxxx01000, where x are read only fields.
    Expected configuration value to read = 0xC688  (0b1100011010001000)


    Below the read ID register and the write and read to the configuration register of both the nrf91 and nrf52 are posted.

    nrf91 read ID register
    nrf91 reading ID register

    nrf52 read ID register
    nrf52 read ID register

    nrf91 write read configuration register
    nrf91 write read configuration register

    nrf52 write read configuration register
    nrf52 write read configuration register

Reply
  • I was able to check it with the logic analyser and there is a difference between the nrf52 and nrf91 in writing to the configuration register. In the reading of the ID register there is no difference.

    Some addresses and values:
    I2C address read =  0x44
    I2C address write = 0xC4
    MANUFACTURER_ID register address =  0x7E
    CONFIGURATION register address = 0x01
    MANUFACTURER_ID = 0x5449
    Configuration value to write = 0b1100011xxxx01000, where x are read only fields.
    Expected configuration value to read = 0xC688  (0b1100011010001000)


    Below the read ID register and the write and read to the configuration register of both the nrf91 and nrf52 are posted.

    nrf91 read ID register
    nrf91 reading ID register

    nrf52 read ID register
    nrf52 read ID register

    nrf91 write read configuration register
    nrf91 write read configuration register

    nrf52 write read configuration register
    nrf52 write read configuration register

Children
Related