Skip to main content
Associate
April 9, 2024
Solved

How to configure the frame rate of CNH

  • April 9, 2024
  • 2 replies
  • 1976 views

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?

This topic has been closed for replies.
Best answer by John E KVAM

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. 

2 replies

John E KVAM
ST Employee
April 9, 2024

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

 

JunranGuoAuthor
Associate
April 11, 2024

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

Anne BIGOT
Technical Moderator
April 11, 2024

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

 

Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised. ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'
John E KVAM
John E KVAMBest answer
ST Employee
April 11, 2024

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.