cancel
Showing results for 
Search instead for 
Did you mean: 

No Range or Raw Value

tekochip
Associate II
Posted on June 10, 2014 at 18:20

I am using a VL6180 as a proximity detector.  I am able to communicate the part without any issue, but when I read the

RESULT__RANGE_VAL register or

RESULT__RANGE_RAW

I only read 0xFF with no target and 0x00 with a target in any position.  I measured the current from the device and I can see that it is performing ranging at the rate I requested because I can see a spike in current draw that is proportional in length to the distance from my target, but the value in the result register does not change.  Other registers do show a change with target distance, but not the two result registers, so I�m sure I�m not setting something up right.

The only register altered from default is SYSRANGE__INTERMEASUREMENT_PERIOD, which I have at 10 for 100ms, and I do see a range measurement every 100ms.

#proximity-sesor #vl6180
11 REPLIES 11
Nickname681_O
Associate II
Posted on June 10, 2014 at 19:01

When reading the ranging result also check the result__range_error_code bits[7:4] of the RESULT__RANGE_STATUS register at address 0x004D.  This will give you some indication of why there is no result.  Section 6.2.37 of the data sheet lists the error codes.

In addition, there are initial configuration register settings that should be applied during start-up.  The following register writes should be applied to any time the device is reset:

WriteByte(RegAddr, data)

WriteByte(0x0207, 0x01);

WriteByte(0x0208, 0x01);

WriteByte(0x0133, 0x01);

WriteByte(0x0096, 0x00);

WriteByte(0x0097, 0xFD);

WriteByte(0x00e3, 0x00);

WriteByte(0x00e4, 0x04);

WriteByte(0x00e5, 0x02);

WriteByte(0x00e6, 0x01);

WriteByte(0x00e7, 0x03);

WriteByte(0x00f5, 0x02);

WriteByte(0x00D9, 0x05);

WriteByte(0x00DB, 0xCE);

WriteByte(0x00DC, 0x03);

WriteByte(0x00DD, 0xF8);

WriteByte(0x009f, 0x00);

WriteByte(0x00a3, 0x3c);

WriteByte(0x00b7, 0x00);

WriteByte(0x00bb, 0x3c);

WriteByte(0x00b2, 0x09);

WriteByte(0x00ca, 0x09);

WriteByte(0x0198, 0x01);

WriteByte(0x01b0, 0x17);

WriteByte(0x01ad, 0x00);

WriteByte(0x00FF, 0x05);

WriteByte(0x0100, 0x05);

WriteByte(0x0199, 0x05);

WriteByte(0x010a, 0x30);

WriteByte(0x003f, 0x46);

WriteByte(0x01a6, 0x1b);

WriteByte(0x01ac, 0x3e);

WriteByte(0x01a7, 0x1f);

WriteByte(0x0030, 0x00);

// Optional:

WriteByte(0x001b, 0x0A);

WriteByte(0x003e, 0x0A);

WriteByte(0x0131, 0x04);

WriteByte(0x0011, 0x10);

WriteByte(0x0014, 0x24);

WriteByte(0x0031, 0xFF);

WriteByte(0x002c, 0x0A);

tekochip
Associate II
Posted on June 10, 2014 at 20:10

Thanks, I'll give this a try.  Most of these registers are undocumented.

The usual status message is early convergence estimate.

tekochip
Associate II
Posted on June 10, 2014 at 21:00

Well now it runs a little better, but I'm still not there yet.  With a target from 0 to 190mm it reads 0x00, then I start getting a reading from 190mm to about 360mm.  The unit is not in a housing.

Nickname681_O
Associate II
Posted on June 10, 2014 at 22:58

The steps to initiate basic ranging in continuous mode are:

1. Apply Power to AVDD_VCEL and VDD

2. Wait 1ms

3. Reset the device by Pulling GPIO0 LOW

4. Wait a minimum of 100nS

5. Pull GPIO0 HIGH

6. Wait 1ms to complete boot process.

a. This can be verified by reading bit[0] of  SYSTEM__FRESH_OUT_OF_RESET (0x0016) will be HIGH

b. This bit can be cleared to check if the device has an unintended reset.

7. Apply tuning settings (posted earlier) .

8. Clear the interrupts by writing a 0x07 to SYSTEM__INTERRUPT_CLEAR (0x0015).

9. Set interrupt to “New Sample Ready�

a. Write 0x04 to SYSTEM__INTERRUPT_CONFIG_GPIO (0x0014)

10. Set Inter-measurement period

a. Register SYSRANGE__INTERMEASUREMENT_PERIOD (0x001B) 

11. Disable the Early Convergence Estimate and other checks 

a. Write 0x00 to SYSRANGE__RANGE_CHECK_ENABLES

b. These are very useful for application, but initially may be giving false reading if not configured correctly.

12. Start Continuous ranging

a. Write 0x03 to SYSRANGE_START

(While ranging continues loop)

13. Poll the interrupt register RESULT__INTERRUPT_STATUS_GPIO (0x004F) bits[2:0] for a 0b100.

a. Indicates new reading is ready.

b. 1 ms poll rate will work.

14. Read Range Value

a. RESULT__RANGE_VAL(0x0062)

15. Read Ranging Status

a. RESULT__RANGE_VAL (0x004D)

tekochip
Associate II
Posted on June 11, 2014 at 17:57

Thanks Ken;

Pretty much the same results, I get a Raw Underflow until the target is 190mm and then it appears to range normally.

-Chip

Nickname681_O
Associate II
Posted on June 12, 2014 at 00:09

It sounds like you have a large offset.  Assuming that at 190mm you are reading a low value and it increases to about 170 when the target is at 360mm

I have a few questions for you: 

1. Is this in an eval kit or a board you made?

2. How was the part mounted?

a. Was the heat profile followed?

b. Does the plastic appear deformed?

3. What is written in register 0x0024?

4. What is written in register 0x001E?

tekochip
Associate II
Posted on June 12, 2014 at 14:42

Ken;

Thanks for all your help.  The board is my own prototype.  I have examined the part under a stereoscope and there is no damage to the package.  The lenses are clear and are not occluded by flux or solder balls.  Owing to the leadless package, the board was soldered in an IR reflow oven with the appropriate temperature profile.

The registers are 0x00 for crosstalk compensation and 0x11 for the offset.

-Chip

Nickname681_O
Associate II
Posted on June 13, 2014 at 16:03

In order to get a better understanding of the issue, I have a couple of more questions:

1. Can you send me a register dump of the first 10 registers (0x0000 to 0x0009)?

a. This will better identify the exact version of the device

2. Have you tried multiple parts and are you getting the same results with all the parts?

Nickname681_O
Associate II
Posted on June 20, 2014 at 21:34

To follow up,  the reported behavior was due to the tuning settings not being completely loaded into the VL610X.  The issue was corrected and it is now operating properly.