cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L8CX SPI doesn't work properly

pshih
Associate II

Hi everyone: I am working on a project with VL53L8CX Time-of-Flight sensor from Pololu. I integrated it with NUCLEO-H755ZI-Q board over SPI interface based on the example and driver provided in the STMicro en.STSW-IMG040 software package. I configured the SPI3 (MCLK, MISO, and MOSI) on the CN7 to communicate with the sensor. I also have PA4 for SPI3_NSS and PC7 for /PLn signal. The project compiled successfully. However, I believe I am not able to read the registers properly.

 

The firmware reads the "device_id" and "revision_id" from the sensor in the vl53l8cx_is_alive() to determine if the sensor exists. The return values different every time I tried to read. I was able to capture the protocols on the scope, and confirmed the reading values are match with the data shown on the scope. The following scope capture shows the communication:

1. Sending 0x00 to address 0x7fff. The yellow signal is for the MCLK, blue for MOSI, purple for MISO, and green for /CS.

pshih_0-1725544500633.png

2. Receiving 0x0 from address 1 for "revision_id".

pshih_1-1725544500633.png

3. Another reading 0x4 from address 1 for "revision_id".

pshih_2-1725544500633.png

I tried to pull up the MISO signal to 3.3V by 10K resister or pull-down to GND with 47K resister. They don't resolve the issue. Tried different communication baud rate and they don't help. I also tried different module and they seems to have the same issue. At this point, I am not sure if the issue I am facing is in the hardware or software. I am looking forward to hearing your opinion and suggestions. Thanks!

20 REPLIES 20
kwc
Associate III

Hi, this is Kevin from Pololu. I can confirm that our VL53L8CX carrier does work with SPI. We have tested it with multiple controllers, including an ST Nucleo-F411RE running the CubeIDE_F401RE_Example_SPI code from the ULD API (STSW-IMG040):

irs19b-nucleo-f411re.jpg

We generally recommend keeping the wires as short as possible, but I specifically used longer ones here (12 inches) to demonstrate that it still works.

Our carrier board is intended to let people use the sensor with 3.3V and 5V controllers, and it was never intended to work at lower voltages.