cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure the frame rate of CNH

JunranGuo
Associate II

I‘ve seen that on the datasheet of VL53L8CH it says

Highly configurable CNH in order to meet user expectations
– 64 zones with 18 bins at 15 Hz
– 32 zones with 36 bins at 15 Hz
– 16 zones with 48 bins at 25 Hz

My question is how can I configure the frame rate of the CNH data output and how can I estimate the real data output frame rate?

5 REPLIES 5
John E KVAM
ST Employee

Frame rate and number of bins are different parameters.

How many bins you get is a matter of memory size. 64 zones times 18 bins is just the amount of memory we have to dedicate to getting you data. You can select to output half the number of zones - and double the number of bins for instance. 

So, you are trading zones for bins. 

As one range is being read out, another is being collected. So, to get the max frame rate, we cannot stop. Nor can we store more data from a given range.

And then there is data speed. ONce you start reading out the data, we will not over-write it. If you are slow extracting the data the sensor will grind to a halt waiting for you. 

If you have a really fast communication path (SPI) then the frame rate is limited by the sensor.

8x8 zones is 15 frames and 4x4 zones is 60 frames max. That's running in continuous mode. 

If you set up for 8x8 zones - even if you only read out a few of these zones, you cannot go faster. 

So, the trick is to figure out how much data you are asking for; and knowing your read-out speed. I2C maxes out at 1Mbit for instance, but lots of people run it at 400Kbits.

As a practical matter it might just be easier to run it and see. Most MCUs have a timing function. 

Good luck,

- john

 


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. It helps the next guy.

I think I've understood that finally it is the readout speed that is limiting the frame rate.Thank you for your help!

Using the GUI, it is possible to change the CNH refresh frequency through the System settings widget via the RangingPeriod parameter (as explained in the User Manual)

In the STM32 code (STSW-IMG043_F401 available on st.com), the frame rate is programmed in the mz_ai_main.c file within the vl53lmz_configure() function through the vl53lmz_set_ranging_frequency_hz() API

 


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.

By chaging the ranging peroid the frame rate of ranging datas improves obviously, but CNH output cannot reach the same frame . Is it because the I2C that the software is using like John E KVAM said above,that is the communication speed is limiting the frame rate rather than the settings?

John E KVAM
ST Employee

The CNH does send a LOT of data. And how you configure your I2C or SPI is a limiting factor. If using I2C, configure it to 1MB - otherwise you really have no chance. 

Better yet, go with the SPI interface if you can. 

Using the Evaluation kit, log some data. then look into the Excel output file and see how much is in there. It's huge. 


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. It helps the next guy.