Multiple byte read for VL53L5CX?
We seem to be having trouble getting through the vl53l5cx_init(&Dev); function for the VL53L5CX. We can read single bytes but multiple byte (4) reads trigger the TIMEOUT and the ULD doesn't load successfully. Here is our RdMulti function:
uint8_t RdMulti(
VL53L5CX_Platform *p_platform,
uint16_t RegisterAddress,
uint8_t *p_values,
uint32_t size)
{
uint8_t DeviceAddress = p_platform->address;
Wire.beginTransmission(DeviceAddress);
Wire.write((RegisterAddress & 0xFF00) >> 8); //MSB
Wire.write(RegisterAddress & 0x00FF); //LSB
uint8_t status = Wire.endTransmission(false);
if (status) { // failed
return status;
}
uint32_t i = 0;
status = Wire.requestFrom(DeviceAddress, size);
if(status != size){
return 1; // failed
}
while (Wire.available()) {
p_values[i++] = Wire.read();
}
return 0;
}This is a pretty standard multiByte read function for Arduino so we are a bit surprised it doesn't work. There doesn't seem to be enough diagnostics to determine why not. Any ideas about what we might be missing? Any way to change the TIMEOUT?
Can you suggest a way for us to verify our I2C communications besides uint8_t error = vl53l5cx_is_alive(&Dev, &isAlive); which we successfully negotiate?
We have tried this at 100kHz and 400 kHz I2C bus speeds on multiple platforms with the same result. We have used a similar multiByte read function to successfully talk with dozens of I2C sensors including the VL6180X, VL53L0, and VL53L1. Not sure what we could be missing...Thanks for any suggestions you might offer.
