cancel
Showing results for 
Search instead for 
Did you mean: 

DataNotReady from VL6180

LDe P.1
Associate

Hi, i am trying to use VL6180 to get an obstacle range.

I'm using VL6180 APi to communicate with the device. Communication is ok, and consistent. Each register is written correctly.

As show in ST examples I init the device and start a single shot reading, but i always get DataNotReady.

Laser ( view with an android camera ) is not lit.

Supply is one of my dubt.

At first i supply VL6180 from main board supply @3.2V, after i tryed with a supply of AVDD and AVDD_VCL @2,8V but nothing changed.

Error register return 0 value. ( I got a VCL Continuity test error solved by doing a RESET cycle to the device )

With supply of 3.2V does it function but give bad readings? or i does not function at all?

For GPIO i drive only GPIO0 for resetting the device, nothing else.

6 REPLIES 6
John E KVAM
ST Employee

This is a tough one.

the only things that can stop the sensor are:

1) I2C errors (Did you check the status return?)

An I2C timeout might fool you into thinking you did something, but it did not succeed.

2) power, or lack thereof - but it looks like you covered that one.

3) And the reset GPIO0 not being pulled high.

Over time, we have determined some things about the chip.

1) The reset GPIO0 is susceptible to noise. Stronger pullups and maybe a cap help.

2) really should ground the N/C pins. Helps with EMI.

And get the latest API code from ST.com. There was a release 1.4.0 that fixed an issue.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.
QZH
Associate II

hello, did you solved your problem yet?  

I think I'm encountering the same problem, all the  init register is correctly
but it always wait at VL6180X_REG_RESULT_INTERRUPT_STATUS_GPIO  here :

while(!(VL6180X_ReadByte(VL6180X_REG_RESULT_INTERRUPT_STATUS_GPIO)&0x04)); 

before this code ,  I Using an oscilloscope for detection , It seems all correct。

 

John E KVAM
ST Employee

I think you are using the wrong register. If you set a threshold, you use that register, but without a threshold one would use the SYSTEM__INTERRUPT_CONFIG_GPIO register. 

That same bit in this register should give you the interrupt when you do not have thresholds.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.

i use the same code with stm32f103 ,is all correct, but when use  the  other 8051, it always wait at while(!(VL6180X_ReadByte(VL6180X_REG_RESULT_INTERRUPT_STATUS_GPIO)&0x04));

But I found it can pass when my hands touch the board in a few times,
I have noticed the level conversion , and the init code is all correct, ,I check it with oscilloscope

the problem iis like LDe P.1 said :when I  start a single shot reading, but i always get DataNotReady. 

Zhiyuan.Han
ST Employee

Hi QZH,

As I see you are using 8051, so I suspect this is due to I2C community issue. 6180 device register is 16bit long and data is 8bit long, please double check this point from your side. 

ZhiyuanHan_0-1704968457569.png

Br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

hi:

I am also stuck in the following function. Reading other registers that have already been written is normal, but it cannot be done after starting the conversion. VDD is using 2.8V and has replaced many settings, but it does not work. I don't know where else to pay attention to, please advise.

 

QDZ_0-1709018528157.png