How to Set Qwiic TMF8821 Mini ToF sensor to 30Hz Output Rate

Hi, I am working on TMF8821 Mini ToF Sensor and I want to set the sensor to publish reading every 100ms (10Hz) at least. From the datasheet https://cdn.sparkfun.com/assets/learn_tutorials/2/2/8/9/TMF882X_DataSheet.pdf it seems like the default setting is 30Hz output rate at 537k iterations per reading.

I assume that it is possible to do 537k iterations for 30Hz output. However, I could not get this output rate running the default setting. At best I get 3Hz.

I run the sensor on Renesas EK-RA6M5 board, I ported the Arduino library so it works on Renesas. However, the default settings (kilo_iteration, report_period_ms) are from the SDK that are mostly untouched, so I wonder if I misunderstood some stuff.

My setting includes publishing the reading on microROS too. But even just printing on serial terminal, I can see how fast the output rate is, which is not 30Hz.

How to know whether the sensor is capable to run 537k iterations and report the result within 30Hz? If it’s not possible, what is the highest iteration I should set in order to output 30Hz reading rate?

If there is any further technical documentation that explains this, I would be grateful.

You might be able to try increasing the default i2c clock speed in the sketch and see if that helps at all

Which SPAD mode are you using? It’ll probably cycle more quickly with fewer zones active Qwiic dToF Imager (TMF882X) Hookup Guide - SparkFun Learn

I am using the default SPAD 3x3 mode.

I have tried changing the rate from “standard” to “fast-mode” and “fast-mode plus” but it doesn’t seem to do any difference in terms of increasing output rate.

I tried to lower the kilo-iterations for example to 64k, but it distorted the sensor output very badly.

On the data sheet https://cdn.sparkfun.com/assets/learn_tutorials/2/2/8/9/TMF882X_DataSheet.pdf section 7.4.1 page 97/21 it’s mentioned that at ~550k iterations it should be able to output 30Hz.