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

We are trying to interface the VL53L1X with nrf52832. but "slave address = 0x52" is not getting reflected in the address register of TWI0.

1. Slave address is not reflected in the address register of TWI0.

2. other information is reflected in registers like operating frequency, SDA, SCL as well as enable.

3. due to the problem of the slave address is not getting reflected, I2C communication isn't established with the sensor.

4. please give me all possible suggestion for solving this logical error regarding it.

Parents
  • Hello,

    You should first try to run the TWI Scanner example from the SDK to verify that your hardware connections is correct. The example will scan through all devices on the TWI bus and report any found devices in the log. If all your hardware connections are correct and the TWI Slave is operating as intended it will be found here.

    Please also make sure that you have DEBUG defined in your preprocessor defines, like shown in the included image.

    This will make a detailed error message be output by your logger in the case that a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.

    Are you using the TWI or TWIM driver in your application? It would be helpful to see the section of the code where you are using the TWI peripheral.

    For future reference, please use the Insert -> Code option when sharing code here on DevZone.

    On another note it seems that you are getting a lot of non-zero error codes in your log - what are these, and where do they originate?

    Best regards,
    Karl

Reply
  • Hello,

    You should first try to run the TWI Scanner example from the SDK to verify that your hardware connections is correct. The example will scan through all devices on the TWI bus and report any found devices in the log. If all your hardware connections are correct and the TWI Slave is operating as intended it will be found here.

    Please also make sure that you have DEBUG defined in your preprocessor defines, like shown in the included image.

    This will make a detailed error message be output by your logger in the case that a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.

    Are you using the TWI or TWIM driver in your application? It would be helpful to see the section of the code where you are using the TWI peripheral.

    For future reference, please use the Insert -> Code option when sharing code here on DevZone.

    On another note it seems that you are getting a lot of non-zero error codes in your log - what are these, and where do they originate?

    Best regards,
    Karl

Children
  • hello Karl,

    1. I had tried with "Twi scanner code" but the slave device address was not found.

    2. even I had again checked the hardware connections for it.

    3. for chacking the hardware connection We had tried to with ESP32 platform "I2C scanner code".

    4. on the ESP32 platform the slave address was found.

    5. Is VL53L1X is compatible with NRF52832???  because even in basic TWI scanner code the device is not found 

  • Hello again,

    ShubMane said:

    1. I had tried with "Twi scanner code" but the slave device address was not found.

    2. even I had again checked the hardware connections for it.

    That is strange. Could you detail how you connected the nRF to the TWI slave? Which pins on the nRF is connected to which pins on the slave device, and how is the slave device powered? Could you also elaborate on how you have initialized the TWI - what configuration are you using?

    ShubMane said:
    3. for chacking the hardware connection We had tried to with ESP32 platform "I2C scanner code".

    How was your connections between the ESP32 and the TWI slave? What TWI configuration did you use on your ESP32 when you successfully found the device? 

    ShubMane said:
    5. Is VL53L1X is compatible with NRF52832???  because even in basic TWI scanner code the device is not found 

    No, as long as they both follow the TWI protocol there is no notion of compatibility, since none of the devices actually know what is on the other side of the connection - all they need to know is what will be coming in on the TWI pins, and what to do with that information.

    Looking forward to resolving this issue together.

    Best regards,
    Karl

  • Hello Karl,

    1. Here is the detail for the hardware connection (nRF52832 -> VL53L1X).

    2. According to me, there is nothing that goes wrong with the hardware connection

    3. We had studied the datasheet of the VL53L1X.

    4. Even there is no driver available in the SDK for this sensor. Can u provide the driver of this???

    5. Please refer the image. 

  • Thank you for providing the drawing.
    Which pins are you using for this on the nRF52832?
    The TWI driver by default enables external pullups. Have you disabled these? How much resistance is the resistors R1-R4?
    Could you also confirm whether or not you are working with a nRF52 DK?

    ShubMane said:
    2. According to me, there is nothing that goes wrong with the hardware connection

    Do you have access to a logic analyzer, so we could take a look at what might be happening on the lines?

    ShubMane said:
    4. Even there is no driver available in the SDK for this sensor. Can u provide the driver of this???

    Unfortunately we do not provide drivers for all third party sensors in our SDK, but if you have an existing driver written in C it should not require too much work to port it to the nRF52832.

    Best regards,
    Karl

  • Hello Karl,

    1. Here is the detail for the hardware connection (nRF52832 -> VL53L1X).

    2. According to me, there is nothing that goes wrong with the hardware connection

    3. We had studied the datasheet of the VL53L1X.

    4. Even there is no driver available in the SDK for this sensor. Can u provide the driver of this???

    5. Please refer the image. 

Related