2024-09-05 7:02 AM
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.
2. Receiving 0x0 from address 1 for "revision_id".
3. Another reading 0x4 from address 1 for "revision_id".
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!
Solved! Go to Solution.
2025-02-04 8:46 AM
Thank you for your reply. In that case, may I ask what frequency of ranging data you are able to get at 1000kHz with I2C? I'm hoping to be able to reach 60 Hz scanning frequency with my VL53L8CX.
2025-02-04 9:22 AM
I don't think the ranging frequency is result from the communication speed. Based on my understanding, the maximum ranging capabilities for 4x4 in continuous mode is 30 Hz and 8x8 is 15Hz.
2025-02-17 12:19 AM
Hello,
I am trying to connect the VL53L8CX to the Nucleo -G491RE board using SPI communication
The example and driver provided in the STMicro en.STSW-IMG040 software package provided is for the Nucleo-F401RE, could you let me know what are the step u used to use a diffrent MCU the NUCLEO-H755ZI-Q ?
Thank you in advanced
2025-02-17 7:47 AM
This sounds like a new topic to me. Feel free to make a new topic. Info gets shared better with short Q and A's instead of making one long thread.
The folks that did the X-ToF code did an amazing job of handling most of our sensors, but to do it, they had to give up a lot of options - like SPI. So, you can't use that.
So here is what to do.
1) build your STM32CubeIDE project without the sensor. But do configure the LPn pin and the SPI and all the others.
2) Then download the VL53L8API from ST.com and integrate it yourself. Refer frequently to the example code. Steal as much as you can from that example.
IN the end, you will have the example code running on your MCU.
It's a matter of copying the files across, but if you match the example, it should work out just fine.
In theory, you could just take the example code, open the .IOC file from STM32CubeIDE and change the processor. But that only works if the MCUs are really close. (There is a warning that it won't work - but it does sometimes.)
Best to just start fresh. Build the MCU project, then copy the files over.
- john
- john