Skip to main content
Associate
January 8, 2024
Solved

How to operate VL53L7CX ToF in 64 zones.

  • January 8, 2024
  • 1 reply
  • 1847 views

Hi.

Regarding the VL53L7CX, I downloaded STSW-IMG036 (API Source) from the product page and tried running the Nucleo board and sensor using the example project included there. However, the default sensor operation setting in the code is 16(4×4) zones, but I don’t know exactly how to change it to 64(8×8) zones.
In the user manual
They say it can be changed in vl53l7cx_set_resolution(), but there is no detailed explanation, so it is currently not possible to modify it. It may be because I don't know C language well, but please help me with a detailed explanation.

STSW-IMG036

https://www.st.com/en/embedded-software/stsw-img036.html

This topic has been closed for replies.
Best answer by kwc

It seems like you should be able to just insert a line to call the function like this, immediately after vl53l7cx_init():

	printf("Sensor initializing, please wait few seconds\n");
	status = vl53l7cx_init(&Dev);
	status = vl53l7cx_set_resolution(&Dev, VL53L7CX_RESOLUTION_8X8);
	status = vl53l7cx_set_ranging_frequency_hz(&Dev, 2);				// Set 2Hz ranging frequency
	status = vl53l7cx_set_ranging_mode(&Dev, VL53L7CX_RANGING_MODE_CONTINUOUS); // Set mode continuous

If you still have trouble, hopefully someone else can offer more help as unfortunately I'm not very familiar with the Nucleo.

1 reply

kwc
Associate II
January 10, 2024

Have you looked at Example_2_get_set_params.c from the API? That example sets the resolution to 8x8.

JSPAuthor
Associate
January 10, 2024
First of all, thank you for your opinion.
you're right. From the example code in the material, I was able to see that it operates in 8×8 mode. 
However, I am not yet skilled enough to know exactly how to use this code on the Nucleo board.
I tried to combine the example project and the example code, but it wasn't easy.
Is there a way to change the example project in the 'CubeIDE_F401RE_Example' folder to 8×8 mode by changing parameter values?

 

kwc
kwcBest answer
Associate II
January 10, 2024

It seems like you should be able to just insert a line to call the function like this, immediately after vl53l7cx_init():

	printf("Sensor initializing, please wait few seconds\n");
	status = vl53l7cx_init(&Dev);
	status = vl53l7cx_set_resolution(&Dev, VL53L7CX_RESOLUTION_8X8);
	status = vl53l7cx_set_ranging_frequency_hz(&Dev, 2);				// Set 2Hz ranging frequency
	status = vl53l7cx_set_ranging_mode(&Dev, VL53L7CX_RANGING_MODE_CONTINUOUS); // Set mode continuous

If you still have trouble, hopefully someone else can offer more help as unfortunately I'm not very familiar with the Nucleo.