Skip to main content
Associate
July 10, 2026
Question

addressing multiple vl53l8x with i2c

  • July 10, 2026
  • 2 replies
  • 40 views

Hi,

I want to use multiple VL53L8CX in my robot. I don’t like to connect a gpio to each of them nor use an gpio extender. In some other topic it is stated that MISO is connected with 47k to GND because the pin may configured as other than push/pull and the GPIO stated in datasheet are not really GP any more. So I got the idea to use MISO in I2C as a chained input to the next sensors LPn. There is nothing stated in datasheet other than don’t connect in I2C mode. So the questions are:

is the state of MISO is defined at startup in I2C mode? Is it correlated to NCS pin even in I2C mode?

after pushing the firmware and changing the I2C address is it possible to set MISO to high level independent to NCS or is it somekind hardwired?

Ragards Chris

2 replies

ST Technical Moderator
July 13, 2026

Hi,

Thank you for your question.

From what you describe, your goal is to connect several VL53L8CX sensors on the same I2C bus while avoiding the use of one dedicated GPIO per sensor for LPn. You are considering whether the MISO pin could be reused in I2C mode to control the LPn pin of the next sensor in a chained manner.

In this case, we do not recommend relying on MISO for that purpose. If one sensor becomes unresponsive in the future, it is important to be able to reset and recover it independently. Using MISO for cascading would make fault recovery more complicated, and the control sequence would also become quite complex.

Regarding your specific point:

In I2C mode, whether at startup or after firmware download and I2C address reassignment, the MISO pin should not be considered as a defined general-purpose output, nor as a controlled signal intended to drive another sensor's LPn pin. Likewise, any possible relationship between MISO and NCS should not be considered as a supported mechanism for this use case.

In other words, this pin is not intended to be used in I2C mode as a chained control signal for another device. Even if such a setup might appear to work in some cases, it would rely on behavior that is not defined as a supported use case, and therefore it would not be considered a robust solution for product design.

For multiple VL53L8CX devices on the same I2C bus, the recommended approach remains:
- use one dedicated LPn control per sensor, or
- use an external GPIO expander or external logic to manage the LPn lines.

This is the safest and most reliable way to bring the sensors up one by one and assign unique I2C addresses.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Andrew Neil
Super User
July 13, 2026

How about using an I2C multiplexer … ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Chris42Author
Associate
July 14, 2026

Currently I use a mux. The idea was to have less components.

unsigned_char_array
Lead III
July 13, 2026

Slave select pins are mutually exclusive, so you could multiplex them using a few logic gates. That way you can use SPI with fewer pins. You can reserve one combination for no slaves, or you can always have one selected.
 

GPIO1 GPIO0 Slave 0 Slave 1 Slave 2
0 0      
0 1 1    
1 0   1  
1 1     1

With 3 gpio:

GPIO2 GPIO1 GPIO0 Slave 0 Slave 1 Slave 2 slave 3 slave 4 slave 5 slave 6
0 0 0              
0 0 1 1            
0 1 0   1          
0 1 1     1        
1 0 0       1      
1 0 1         1    
1 1 0           1  
1 1 1             1
"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."