cancel
Showing results for 
Search instead for 
Did you mean: 

VL6180 proximity detection logic output mode

ELECL.2
Associate II

Hi,

I would like to know if we can configure GPIO0 or GPIO1 as a logic output mode. In datasheet, we can configure in INT mode. But we need to clear the flag each time we have a value. So we have a wrong value during the clearing.

I would like to configure the sensor for exemple 40cm detection, and have "1" when we detect somthing, and "0" when not without clearing or something else. Is that possible ?

1 REPLY 1
Zhiyuan.Han
ST Employee

Hi

Yes, it is possible, as you have seen the GPIO configuration in datasheet, I suggest you choose GPIO1 for this function, as GPIO0 is normally used as chip enable function. from the datasheet you can configure GPIO with SYSTEM__MODE_GPIO1(0x011), you can select Active-high and configure GPIO as interrupt output function.

Beyond GPIO configuration, you need also confige the interrupt mode, please refer SYSTEM__INTERRUPT_CONFIG_GPIO()0X014 OR VL6180x_RangeConfigInterrupt() for mor detail. you can choose below Level Low function.

• New sample ready

• Level low (range/ALS value < low threshold)

• Level high (range/ALS value > high threshold)

• Out of window (range/ALS value < low threshold) OR (range/ALS value > high

threshold)

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.