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

TWI Scanner I2C address is 1 bit wrong

I'm using <TWI Scanner> example on nRF52 DK to find my sensor's address.

According to the sensor datasheet, the sensor's address is 0x21. However, <TWI Scanner> finds the address at 0x20. 

Any idea, please? 

Parents
  • Hi Einar, thank you very much for ur help.

    For Arduino UNO, I used I2C to scan my sensor. Here are the plots of SDA (blue) and SCL (red). 

    Image 1: you could see the Arduino scans 127 I2C addresses. 

    Image 2: you could see for the 34th address (0x22), Arduino detects the sensor, which is correct. 

    Image 3: more detailed 34th address SDA and SCL signals. 

    It looks correct on Arduino.

    Here is what I did on nRF52 DK: 

    1. Use one 4.7k ohm pull-up resistors for SDA and SCL respectively 

    2. Connect nRF52 detect pin to GND. 

    3. compile and run <TWI scanner> code.

    I found that my nRF52 scans the other devices (e.g. Arduino UNO) show the I2C address is 0x20 as well. It seems like the nRF52 returned I2C address doesn't change. 

    Since Arduino UNO can detect the sensor at the correct address, I suspect that it's the issue of nRF52. 

    Thanks, Einar

  • Hi,

    Thank you for the plots and info. This is a bit of a mystery, to be honest. I will look more into it tomorrow and get back to you.

Reply Children
Related