2021-05-19 02:11 AM
Hello,
I'm trying to use the VL53L1X on my nRF52DK, but I experience some problems.
Previously, I've successfully used the VL53L1X with an Arduino UNO using the pololu Arduino library (link below). For my project I need to use this sensor on the nRF52, so I've rewritten the vl53l1_platform.cpp and main .ino code to C (the other files are from ST's VL53L1 API, which are already in C).
When the sensor is not connected, the nRF52 is writing the correct data to the SCL and SDA lines, but if I connect the sensor, these lines give incorrect data. Instead of sending to address 0x29, it sends to address 0x7F or 0x00. And instead of sending the data 0x01 and 0x0F, it sends 0xFF and 0xFF (or 0x00 and 0x00).
I have correctly connected and initialized the INT and XSHUT lines.
I'm not sure what the problem can be, because it worked with the Arduino UNO, but not with the nRF52 (even though the I2C is working correctly without the sensor).
My setup:
Solved! Go to Solution.
2021-05-19 11:28 AM
here is some code that will prove your I2C is working correctly.
Put this in just after powerup and it will send and get bytes, words, longwords and strings.
Hopefully it will help.
2021-05-19 11:28 AM
here is some code that will prove your I2C is working correctly.
Put this in just after powerup and it will send and get bytes, words, longwords and strings.
Hopefully it will help.
2021-05-20 08:46 AM
Thank you for the reply and verification code. I got it to work now.
I changed the sensor for a new one, and I your verification code showed that this new sensor is working correctly (so probably the first sensor got broken somehow)