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.

  • Hello Karl,

    For resolving the issue, can we have some options like multiple read or write???

  • Hello again,

    ShubMane said:
    we had an interface with the hts221 with vl53l1x on TWI bus. hts221 is workingly fine but vl53l1x is not working fine.

    Are you saying that you connected the HTS221 in the exact same way as you have tried connecting the VL53l1X, and was able to communicate with it as expected?

    ShubMane said:
    because all the external sensor drivers provided in SDK having the register's address length is 8 bit.

    All TWI addresses are 7 bit, with the 8th bit of the byte indicating whether it is a read or a write command for the 7 bit address. Sometimes, this is concatinated into a single address, such as WHO_AM_I_READ or similar. All TWI addresses are 7 bit as per the specification.

    ShubMane said:
    For resolving the issue, can we have some options like multiple read or write???

    Sure, you can do multiple reads or writes in the same transaction if you would like (no STOP between reads, for example). You can do this by using the nrfx_twi_xfer with the SUSPEND flag.

    I repeat myself because it would be very helpful to know for the continued debugging of this case:

    Karl Ylvisaker said:
    Karl Ylvisaker said:
    Which pins are you using for this on the nRF52832?

    Exactly which pins on the nRF device are you trying to use for your TWI peripheral? Your drawing does not include this information.

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

    Please take a moment to answer these questions.

    Best regards,
    Karl

  • Hello Karl,

    How to enable the multiple writes as well as multiple reads in the TWI.

    if possible please send the example for multiple writes as well as multiple read.

  • Hello again,

    ShubMane said:
    How to enable the multiple writes as well as multiple reads in the TWI.

    By this, do you mean multiple reads or writes without a stop condition in between?
    If so, please see my mention of the SUSPEND flag in my previous comment.

    ShubMane said:
    if possible please send the example for multiple writes as well as multiple read.

    Unfortunately I do not have any example that demonstrate the use of the SUSPEND flag, but you could try it out by modifying the TWI sensor example, for instance.
    If you intend to do this, you will have to change the TWI0_USE_EASY_DMA define to 0, so that the example uses the TWI driver (that has the SUSPEND option) rather than the TWIM driver (that does not have the SUSPEND option) behind the scenes.

    Best regards,
    Karl

Related