Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Vl53L0X sensor 8190/8191 effect on sensors

Hello,
i trying to run the VL53L0x Sensor quickly. i start a new reading every 25ms and have a timing budget of 20ms so there is about 5ms to get and read the result via interrupt. I am using the pololu arduino library.

I initialise the sensor via the following.

Wire.begin();
sensor_j8.init();
sensor_j8.setTimeout(0);
sensor_j8.setMeasurementTimingBudget(20000);
u8_j8_stop_variable = sensor_j8.readReg(0x91);
sensor_j8.writeReg(0x80, 0x01);
sensor_j8.writeReg(0xFF, 0x01);
sensor_j8.writeReg(0x00, 0x00);
sensor_j8.writeReg(0x91, u8_j8_stop_variable);
sensor_j8.writeReg(0x00, 0x01);
sensor_j8.writeReg(0xFF, 0x00);
sensor_j8.writeReg(0x80, 0x00);

I then start off a reading of the senor with the following.

sensor_j8.writeReg(SYSRANGE_START, 0x01); //Start Reading

once the interrupt has triggered i get the result and clear the interrupt

data->u16_range_reading = sensor_j8.readReg16Bit(0x14 + 10);
sensor_j8.writeReg(SYSTEM_INTERRUPT_CLEAR,0x01);

once the time period has 25ms i then restart another reading with

sensor_j8.writeReg(SYSRANGE_START, 0x01); //Start Reading

etc… etc…

This all worked fine until with readings with a close background, but when i point the sensor into clear space i get readings of 8190/8191. Once those values have been returned it breaks my timing sequence. After doing some research they seem to map to error codes ? Do i need to do some additional in the software? Any information on these would be greatly appreciated.

To clarify when i get a result such as 8190/8191 it sometimes won’t trigger an interrupt on the GPIO1 pin. which as result throws of my timings.

Thanks in advance

Ali

Hello, Ali.

I tried to reproduce your issue but was unable to; the readings take less than 20 ms as they should even when the sensor is reporting 8190 or 8191. Could you post the complete code of your program, simplified to the bare minimum that demonstrates the problem? Are you using the latest version of the library (1.2.0)?

Kevin