2014-06-10 09:20 AM
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 #vl61802014-06-10 10:01 AM
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);2014-06-10 11:10 AM
Thanks, I'll give this a try. Most of these registers are undocumented.
The usual status message is early convergence estimate.2014-06-10 12:00 PM
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.
2014-06-10 01:58 PM
The steps to initiate basic ranging in continuous mode are:
1. Apply Power to AVDD_VCEL and VDD2. Wait 1ms3. Reset the device by Pulling GPIO0 LOW4. Wait a minimum of 100nS5. Pull GPIO0 HIGH6. 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)2014-06-11 08:57 AM
Thanks Ken;
Pretty much the same results, I get a Raw Underflow until the target is 190mm and then it appears to range normally. -Chip2014-06-11 03:09 PM
2014-06-12 05:42 AM
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. -Chip2014-06-13 07:03 AM
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?
2014-06-20 12:34 PM
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.