Skip to main content
baev_al
Associate III
May 22, 2019
Question

VL53L01 optical center register setting

  • May 22, 2019
  • 2 replies
  • 1665 views

Hi.

Please help me with VL53l1.

1)     Is it possible to read distance from individual pixel or is it only some kind of interpolation of the 4 x 4 region?

2)     Is there a description of registers which should be modified (and how they should be modified) to set size and coordinates of ROI (or pixel if it is possible)? I managed to run en.STSW-IMG009, however it doesn’t have the above function (it is possible to set size only, but not coordinates). I tried to run en.STSW-IMG007 and failed.

Light lib has the following function:

VL53L1X_ERROR VL53L1X_SetROI(VL53L1_Dev_t dev, uint16_t X, uint16_t Y)
{
	uint8_t OpticalCenter;
	VL53L1X_ERROR status = 0;
 
	status =VL53L1_RdByte(&dev, VL53L1_ROI_CONFIG__MODE_ROI_CENTRE_SPAD, &OpticalCenter);
	if (X > 16)
		X = 16;
	if (Y > 16)
		Y = 16;
	if (X > 10 || Y > 10){
		OpticalCenter = 199;
	}
	status = VL53L1_WrByte(&dev, ROI_CONFIG__USER_ROI_CENTRE_SPAD, OpticalCenter);
	status = VL53L1_WrByte(&dev, ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE,
		 (Y - 1) << 4 | (X - 1));
	return status;
}

What is the OpticalCenter and how can I calculate it?

Thanks.

This topic has been closed for replies.

2 replies

John E KVAM
ST Employee
May 22, 2019

​Use the SW-IMG009.

Go to

https://www.st.com/content/st_com/en/products/imaging-and-photonics-solutions/proximity-sensors/vl53l1x.html#resource

And download App note

AN5191  Using the programmable region of interest (ROI) with the VL53L1.

the smallest region you can read is a 4x4.

The optical center is found and placed into non-volatile memory at manufacture during calibration. There is a function to read it.

And it should be used if your region is smaller than 10x10, otherwise to have to use the actual center - which is #199. (otherwise your region might be outside the bounds of the SPAD array.

You might need to download a newer version of the Ultra Light Driver. We keep adding features.

but check out the app note. It's what you want.

baev_al
baev_alAuthor
Associate III
May 23, 2019

AN5191 suggests using of VL53L1_SetUserROI(). This is SW-IMG007 function. I just need the description of how to obtain data for ROI_CONFIG__USER_ROI_CENTRE_SPAD and ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE registers. Then I will need just to write two bytes...

S.Ma
Principal
May 23, 2019

Look at en.STSW-IMG009 which is easier learning curve driver in fewer source file.