2019-10-31 06:13 AM
I recently purchased VL53L1X ToF laser ranging sensor and for the last couple of weeks I am trying to make it work. Based on reference schematic from the datasheet I built the following setup:
Using STM32L011 uCU, ULD API and LowLevel I2C libraries I am interfacing the sensor AND successfully reading/writing data from/to it. Here is a snippet of my communication to the sensor:
void LaserSense (void)
{
uint8_t sensorState = 0;
uint8_t byteData = 0;
uint16_t wordData = 0;
// Test I2C Communication.
status = VL53L1_RdByte(VL53L1X_ADDRESS, 0x010F, &byteData); //Model ID = 0xEA
status = VL53L1_RdByte(VL53L1X_ADDRESS, 0x0110, &byteData); //Module Type = 0xCC
status = VL53L1_RdByte(VL53L1X_ADDRESS, 0x0111, &byteData); //Mask Revision = 0x10
// End test I2C Communication.
// Reset Sensor
status = VL53L1_WrByte(VL53L1X_ADDRESS, SOFT_RESET, 0x00); //Reset
DelayMillisec(100);
status = VL53L1_WrByte(VL53L1X_ADDRESS, SOFT_RESET, 0x01); // Exit Reset
DelayMillisec(1000);
// Wait for device to boot. FixMe: Implement a timeout condition.
while((sensorState & 0x1) == 0)
{
status = VL53L1X_BootState(VL53L1X_ADDRESS, &sensorState);
DelayMillisec(100);
}
...Some more code...ommited for simplicity reasons...
}
Here are oscillograms of the I2C bus, for the code above:
READ Model ID:
READ Module Type:
READ Mask Revision:
WRITE Enter Reset Command:
WRITE Exit Reset Command:
READ Sensor Boot State:
From the oscillograms it is seen that the I2C communication is working.
The issue is that when I read the boot state internal register I am always receiving 0, which means that the device is not booted. This stops me from further device use.
Things I have tried so far:
2020-09-16 06:00 AM
Hi John, thanks for your response. I created a new thread.
2021-03-29 08:59 AM
Hi Hardwariano,
I'm having the same problem, but I don't know if it is right. did you solve the problem?
2021-03-29 11:22 AM
If you've gotten this far - the sensor is booted. There really isn't anything to keep it from booting. That call was put in just to keep you from accessing the sensor too quickly after the bootup. Just wait 10ms. The chip will be booted and you can move to the next step. The only thing people have trouble with at the 2-byte addresses.
(And you got past that.)
2021-04-06 12:14 AM
Hi VVita,
check this thread I opened some time ago.