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?
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?
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 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.
Update.
Now the PuTTY shows an unknown address.
<info> app: TWI device detected at address 0x20.
<info> app: TWI device detected at address 0x22.
However, I only have 1 salve device, which is 0x22.
Any idea why there is 0x20, please?
According to the datasheet of my sensor, its I2C address should be 0x22. I only have 1 slave device.
What I found is if I define the correct TWI address in <TWI sensor> code and run it, then <TWI scanner> could find 2 addresses.
<info> app: TWI enabled
<info> app: TWI device detected at address 0x20.
<info> app: TWI device detected at address 0x22.
However, if I clean the solution, then run the <TWI scanner> again, it can only detect 0x20 address (no idea why I have this address).
Note: my sensor requires a command (0x3608) to enter the continuous data reading mode. This command is unspecified in <TWI scanner> example. It's specified in <TWI sensor>.
Question:
1) Why I have a "ghost" address 0x20?
2) Why I must run <TWI sensor> first, then run <TWI scanner>, then I can see 2 addresses (1 address is correct)?
Hi,
I am not able to answer these questions at the moment, unfortunately. However I have ordered a SDP3x EK (EK-P4) so that I can test on my side. I t might take a couple of days before I get it, though. I will let you know when I have been able to test on my side.
Many appreciations, Einar!