cancel
Showing results for 
Search instead for 
Did you mean: 

Using VL53l0x with DMA

MikeB100
Associate

I have an application that needs to use several VL53l0x ToF sensors. The measurements need to be fairly responsive to a slow moving object approaching the sensor; so something like taking readings at 10Hz would be reasonable.  Having tried a quick prototype with a single sensor on an Nucleo-F767ZI board it seems there is going to be a lot of I2C communication which will more-or-less saturate the CPU and not leave much spare time for the  application functionality.  One thought was if there is any way to use DMA to offload the heavyweight I2C communication.  Something like setting the sensor(s) in continuous reading mode and then getting DMA to gather the readings and drop them into memory from where the application could pick them up as and when it needs them.

The application is not especially 'critical' so there is no great need for accurate timing synchronisation or anything like that - just so long as the readings give a reasonable indication of a slow moving object approaching the sensor.

Does anyone know if this mode of operation is feasible?  Any examples where this has been done?  Maybe there is a different solution rather than DMA.  Any ideas welcome.

1 REPLY 1
Zhiyuan.Han
ST Employee

Hi 

 

I don't have good suggestion on your DMA idea. share some through from my side.

you can try to increase the I2C speed, this will help to decrease the reading time

another suggestion is you can move from polling mode to interrupt mode, you can use the level low settings, when the target get close than the threshold, then trig interrupt to read the ranging data. otherwise, the sensor will run in autonomous mode, no need host to read the ranging data, this will help to save the I2C bandwidth.  

  • Level Low (value < thresh_low)

 

Br

Zhiyuan.Han

 

 


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.