cancel
Showing results for 
Search instead for 
Did you mean: 

Techniques for multiplexing VL53L4CX

MGG
Visitor

Hi @John E KVAM ... I have seen several discussions about best way to use multiple VL53L4CX sensors, and I've appreciated your responses.  ("Every reboot is its own adventure!").  

I'm currently implementing an unusual setup that has 5 of these sensors that could conceivably interfere with one another - we are trying to get our mounting and the view-cones to be as independent as possible, but it can't be guaranteed.   We are using the bare STM32duino library on an ESP32 (Arduino/C++) micro, which is also doing many other things.

Given the physical setup of our system, it is difficult to run single lines to all the chips for XSHUT.  We would very much like to work only with the simple STEMMA/QT-style 4-conductor I2C cabling.   For this reason, we've opted to use an I2C multiplexer, rather than changing the addresses of the chips.

So my questions are: 

1. Is there an I2C command to tell the chip to reset itself?   In our project's operation, changes in host firmware or other changes result in new instantiations of the sensor class, and if that occurs I'd like to reset the chip completely via I2C and begin the initialization again.  If possible, I'd like to not have to toggle the XSHUT or physically power off the chip, as we'd prefer to use only I2C cabling

2. in the event that I need to use XSHUT to reboot the chips, I am considering a hack whereby all of our sensors' XSHUT pins are linked to each other and to +5V with a weak pullup resistor and we then use one of our I2C mux ports to address them as follows:    switch to the 'special' I2C mux, disable I2C and assign one of the lines (CLK most likely) as a GPIO, and then toggle a low/high sequence to effectively reset the chips.  Re-enable I2C, and continue multiplexing the sensors with appropriate startup routines followed by ranging.    I guess I'm asking this question to see if there are gotchas you can identify, or a much simpler solution, before proceeding with a prototype of this.

3. when 'VL53L4CX_StopMeasurement()' is called, does the laser actually shut off?  I'm hoping we can use this intermittently to step through our various sensors without fear of crosstalk, but I'm not sure if it's working.  Is there a better way to ensure only reading one ranger at a time?  Or, is this a significant concern, or might we assume each device will work independently?

 

Your responses are very much appreciated!  - also any input from anyone else who has done this sort of thing is welcome too of course!   

Thanks so much.

<M>

0 REPLIES 0