cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to connect VL53L1X to sensor hub on LSM6DSL or LSM6DSR?

Singh.Harjit
Senior II

The LSM6DSL, LSM6DSR have a sensor hub and I'd like to connect the VL53L1X Time of flight sensor to the sensor hub and have the IMU automatically read information from the VL53L1X.

From reading the sensor hub documentation in the datasheets as well as AN5192, it seems there is only one write data register and the sensor hub only has subaddress and register for the transfer but the VL53L1X needs multiple bytes to do the read.

Thanks.

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi @Singh.Harjit​ , the LSM6DSL or LSM6DSR sensor hub interface is intended to be used mostly in combination with pressure sensors and magnetometers or with other accelerometers / gyroscopes. They have a standard (for MEMS devices) 8-bit I2C device address and standard 8-bit register addresses. I'm not an expert on the proximity sensors, but VL53L1X, as you pointed our, has a 8-bit device address but a 16-bit register address. You may however try with the VL53L0X sensor, whose I2C communication is depicted in the datasheet and doesn't require 16-bit addresses:

0693W000000VOrVQAW.png

The procedure for the sensor hub (Mode2, AN5358 p.73) can maybe be modified as below, but should be checked:

1. Write 40h to FUNC_CFG_ACCESS // Enable access to sensor hub registers
2. Write EXT_SENS_ADDR | 01h to SLV0_ADD // Configure external device address (EXT_SENS_ADDR)
// Enable read operation (rw_0 = 1)
3. Write REG to SLV0_SUBADD // Configure address (REG) of the register to be read
2b. Write EXT_SENS_ADDR | 01h to SLV0_ADD // Configure external device address (EXT_SENS_ADDR)
// Enable read operation (rw_0 = 1)
3b. Write REG to SLV0_SUBADD // Configure address (REG) of the register to be read
4. Write 0xh to SLAVE0_CONFIG // Read x bytes (up to six), SHUB_ODR = 104 Hz
5. Write 4Ch to MASTER_CONFIG // WRITE_ONCE is mandatory for read
// I²C master enabled, using slave 0 only
// I²C pull-ups enabled on SDx and SCx
6. Write 00h to FUNC_CFG_ACCESS // Disable access to sensor hub registers

Stay safe! Regards

John E KVAM
ST Employee

The proximity sensors unfortunately take a bit of set up. There is a 138 byte initialization string for instance. Generally the host MCU has some capability to do this. Download and have a look at the VL53L1X UltraLiteDriver to get some idea of what the host has to do. If the sensor hub can do this, it will work. (But I don't know anything about the sensor hub - just the VL53 sensors.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Singh.Harjit
Senior II

Thank you, I'll look into the driver.

My initial assessment was that it wouldn't be possible to do but since I wasn't familiar with the LSM6DSL or LSM6DSR, I thought I would ask.

All the best.