2021-03-24 09:45 AM
Calling
status = sensor_vl53l1.VL53L1_GetMeasurementDataReady(&NewDataReady);
from the Example, I get only status = 0 and NewDataReady = 0;
I stepped into the functions down to the Device access via I2C.
All went well so far. I got:
gpio__tio_hv_status = 3 // VL53L1::VL53L1_is_new_data_ready()
Here the protocol over different functions I made:
7:37:19.140 -> VL53L1 Measurement status:0 - 0
17:37:21.641 -> VL53L1_is_new_data_ready:: gpio__mux_active_high_hv=h 10
17:37:21.641 -> VL53L1_is_new_data_ready:: pdev->stat_cfg.gpio_hv_mux__ctrl=h 11
17:37:21.641 -> VL53L1_is_new_data_ready:: VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_MASK=h 10
17:37:21.641 -> VL53L1_is_new_data_ready:: VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_HIGH=h 0
17:37:21.641 -> VL53L1_I2CRead:: Beginning transmission to 20
17:37:21.675 -> VL53L1_I2CRead:: Writing port number 49
17:37:21.675 -> VL53L1_I2CRead:: status.1: 0
17:37:21.675 -> VL53L1_I2CRead:: status.2: 0
17:37:21.675 -> VL53L1_I2CRead:: available [i]: 0->3
17:37:21.675 -> VL53L1_is_new_data_ready:: Interrupt ready=0
17:37:21.675 -> VL53L1_is_new_data_ready:: VL53L1_RdByte()=0
17:37:21.675 -> VL53L1_is_new_data_ready:: gpio__tio_hv_status=3
17:37:21.675 -> VL53L1_is_new_data_ready:: *pready=0
When it comes to results of this function:
VL53L1_Error VL53L1::VL53L1_GetMeasurementDataReady(uint8_t *pMeasurementDataReady)
{
VL53L1_Error Status = VL53L1_ERROR_NONE;
Status = VL53L1_is_new_data_ready(Dev, pMeasurementDataReady);
return Status;
}
*pready = pMeasurementDataReady = 0
Status = 0
No Ready will be returned.
When I stepped through the functionality, where and at which step will the READY be provided without interrupt?
at the End in VL53L1_is_new_data_ready() the following decides:
if ((gpio__tio_hv_status & 0x01) == interrupt_ready) {
*pready = 0x01;
} else {
*pready = 0x00;
}
In the Polling Mode you never get a ready with this functions ?
2021-04-02 01:08 PM
I solved the problem. The provided examples software for Arduino Environment's never worked. I will publish my example and the working solution at my GitHub the next days. It's running on ESP 8266 and ESP32 and STM platforms.