2024-02-28 01:37 AM - last edited on 2024-02-28 02:18 AM by Peter BENSCH
For the VL53L4CD,Is there a default ranging frequency that can be set to the highest ranging frequency of 100Hz?How to set ?
Solved! Go to Solution.
2024-03-04 07:50 AM
That 10 means you are ranging for 10ms - which should give you 100HZ or 1000ms/10 =100. If you are only getting 8Hz (8 measures per second) something is seriously wrong. Can you put a scope probe on the interrupt line?
Every time the interrupt fires, you have to read the data and tell the sensor to clear the interrupt line. The scope probe should tell you what is going on? Does the line stay high?
You definitely can poll the sensor. That works, but don't poll it as fast as your MCU can - give it at least a quarter of a millisecond between polls. I say go, set a 10.1 ms timer in my MCU. When the timer goes off I start polling, generally gets it on the first try.
And when you do get the data, make sure the interrupt is cleared.
have a look through the example code. Something is odd here.
- john
2024-03-01 07:57 AM
There is a function -
VL53L4CD_Error VL53L4CD_SetRangeTiming(
Dev_t dev,
uint32_t timing_budget_ms,
uint32_t inter_measurement_ms)
You specify how for long the sensor should integrate (timing budget) and how long between ranges.
If you go with 10 on both of these, you will do 100 ranges per second, and integrate for the full 10ms.
This same concept is valid for all the VL53 sensors, but the code varies as we evaluate what is easiest for our customers. The VL53L1X has two separate functions to do this same setting for instance
I'd read through the VL53L4CD_API.c . That code is as obvious as we could make it.
But if you are in a hurry, read the VL53L4CD_API.h. There are very few functions and I hope the naming is obvious.
Good luck,
- john
2024-03-03 05:08 PM
I'll give it a try, thank you!
2024-03-03 09:35 PM
The current setting is already like this, but it still doesn't work. Can using polling to read reach a frequency of 100Hz?
(This is what I am currently setting up;The frequency is 10ms,but the actual frequency is only around 8Hz.)
2024-03-04 07:50 AM
That 10 means you are ranging for 10ms - which should give you 100HZ or 1000ms/10 =100. If you are only getting 8Hz (8 measures per second) something is seriously wrong. Can you put a scope probe on the interrupt line?
Every time the interrupt fires, you have to read the data and tell the sensor to clear the interrupt line. The scope probe should tell you what is going on? Does the line stay high?
You definitely can poll the sensor. That works, but don't poll it as fast as your MCU can - give it at least a quarter of a millisecond between polls. I say go, set a 10.1 ms timer in my MCU. When the timer goes off I start polling, generally gets it on the first try.
And when you do get the data, make sure the interrupt is cleared.
have a look through the example code. Something is odd here.
- john
2024-03-04 06:59 PM
Okay, let's give it a try again. Thank you very much for your suggestion!