cancel
Showing results for 
Search instead for 
Did you mean: 

Estmated max size of parameters

Ckjel.1
Associate

I'm referencing to STSW-IMG009 and specifically function VL53L1X_SetInterMeasurementInMs(uint32_t InterMeasMs)

What would be the maximum size of the argument and the value of ClockPLL. I'm re-writing for another platform.

Regards

/Claes

1 REPLY 1
John E KVAM
ST Employee

The register is 32bits.

VL53L1X_ERROR VL53L1X_SetInterMeasurementInMs(VL53L1_Dev_t dev, uint16_t InterMeasMs)
{
	uint16_t ClockPLL;
	VL53L1X_ERROR status = 0;
 
	status = VL53L1_RdWord(&dev, VL53L1_RESULT__OSC_CALIBRATE_VAL, &ClockPLL);
	ClockPLL = ClockPLL&0x3FF;
	VL53L1_WrDWord(&dev, VL53L1_SYSTEM__INTERMEASUREMENT_PERIOD,
			(uint32_t)(ClockPLL * InterMeasMs * 1.075));
	return status;
 
}

So if you assume ClockPLL is 0x3ff (because it can be) I'd use 1024 for that.

so 2^32 = 2^10 * InterMeasMs* 1.075.

InterMeasMs = (2^32 / 2^10) /1.075

So I get a max InterMeasMs of 3.9million, which is a LOT of seconds.

If you were going to wait that long, I'd seriously consider turning it all off and restarting it again.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.