Problem reading Vl6180X laser sensor

Matt_Mielke,
I have run into another problem with a VL6180X laser sensor.

Since you pointed out that the registers have 16 bid addresses I can successfully read distances.

For cross checking I do this with an Arduino and with a pic microcontroller. The problem is the Arduino can measure down to 2cm but the pic only 10cm. I have configured the registers in the pic as they are in the Arduino. The power and I2C voltages are the same. Each has a 1000ms delay between reads.

My project will require the pic and it has to measure distances down to 2cm.

I can’t find anything in the data sheet to explain this.

I have attached the I2C code for the pic and the Arduino sketch.

Hope you can help.
Jerry Donaldson

(attachments)

VL6180Sketch (854 Bytes)
picSnipit (827 Bytes)