Skip to main content
Visitor II
May 21, 2018
Question

VL53L0X interrupt setting

  • May 21, 2018
  • 1 reply
  • 2019 views
Posted on May 21, 2018 at 06:53

Hi 

 I am trying to get the VL53L0X using the api provided and the source code available on 

https://os.mbed.com/users/andcor02/code/vl53l0x_api/

  which is just a copy of the VL53L0X api. I am using the STM32L432KC NUCLEO board with I2C connnection to a breakout board available on ebay -> 

https://www.ebay.com/itm/VL53L0X-Time-of-Flight-Distance-Sensor-Breakout-GY-VL53L0XV2-Module-for-Arduino/201718280643?hash=item2ef758b1c3:g:UPsAAOSwzXxaMlyn

  

 The module works fine but the interrupt pin does not do anything. I am trying to use the 0x04 setting for NEW_DATA_READY setting as per the API, but don't see any trigger on the interrupt or on a digital logic analyzer. 

 Please help

Best

Chandra

    This topic has been closed for replies.

    1 reply

    Visitor II
    May 29, 2018
    Posted on May 29, 2018 at 12:03

    My configuration for continuous interrupt

    VL53L0X_DataInit();

    VL53L0X_StaticInit();

    VL53L0X_PerformRefCalibration()

    VL53L0X_PerformRefSpadManagement()

    VL53L0X_SetDeviceMode(VL53L0X_DEVICEMODE_CONTINUOUS_RANGING)

    VL53L0X_SetLimitCheckEnable()

    VL53L0X_SetLimitCheckEnable()

    VL53L0X_SetLimitCheckValue()

    VL53L0X_SetLimitCheckValue()

    VL53L0X_SetMeasurementTimingBudgetMicroSeconds()

    VL53L0X_SetVcselPulsePeriod()

    VL53L0X_SetVcselPulsePeriod()

    VL53L0X_SetGpioConfig( VL53L0X_DEVICEMODE_CONTINUOUS_RANGING, VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY, VL53L0X_INTERRUPTPOLARITY_LOW)

    VL53L0X_ClearInterruptMask()

    VL53L0X_PerformRefCalibration()

    // set gpio

    VL53L0X_StartMeasurement()

    // check gpio input or falling interrupt

    VL53L0X_GetRangingMeasurementData()

    VL53L0X_ClearInterruptMask()

        or VL53L0X_WrByte(VL53L0X_REG_SYSTEM_INTERRUPT_CLEAR, 0x01) // according to crazyflie 2.0 code

    Visitor II
    May 30, 2018
    Posted on May 30, 2018 at 08:55

    Hi

    ‌

     Thank you for trying to help me out. Let me know if you have tried this code snippet and if it actually works because I tried something very similar and did not get anything out of the interrupt. 

    Best

    Chandra

    Visitor II
    June 15, 2018
    Posted on June 15, 2018 at 10:06

    It's part of my project I'm working on.

    (It does not contain whole function, but you can catch your code of intention.)

    I hope it's helpful for you!

    0690X0000060BgCQAU.png

    Data ready pin level of a vl53l0x sensor.

    (Configuration is long range - 33ms, 2M, data ready pin is active low)

    0690X0000060BgHQAU.png

    ________________

    Attachments :

    VL53L0X_TEST.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxUo&d=%2Fa%2F0X0000000ayp%2FX_6E5eLfhNyMRe991N6ZSNZgW3BNjuwTtYD4sB53cvA&asPdf=false