2020-03-03 03:55 AM
I have rewritten the C app for the VL531 in LAIRD SmartBasic in order to drive the VL531 from a BT module (BL652). I communicate OK with the VL531 over I2C but when I sent the start command (and after I get a Data Ready from register 0x31 as shown below), the results I get are FFs and the Range status is 01 (SIGMA problem????), as in following:
VL53L1X Model_ID: EA Reg: 0000010F
VL53L1X Module_Type: CC Reg: 00000110
VL53L1X Mask_Revision: 10 Reg: 00000111
__________________________________________________
Address Verification (0x29) : 29 in: 00000001
Value : 03 in: 00000031
Range Status is : 01 in: 00000089
MSB Distance is : FF in: 00000096
LSB Distance is : FF in: 00000097
Distance mode is : 0A in: 0000004B
Report Status is : 00 in: 0000008A
Result Stream Count is : 00 in: 0000008B
Signal is : FF in: 00000098
SPNB is : FF in: 0000008C
SignalPerSpad is 2000.0*signal/SpNb :
AmbientRate is : FF in: 00000090
AmbientlPerSpad is 2000.0*AmbientRate/SpNb :
ROI Center is : 3F in: 0000013E
2020-03-04 09:03 AM
The most comon cause of this type of issue is that words and longwords are not properly sent to the sensor. Because all the byte reads and writes work, it appers the sensor is properly communicating, but it might not be.
Have a look at the attached app note. It contains code to help you verify your I2C communications.
Get the code in there to work once, then you can remove it.
Write back if you are still having issues.
2020-03-05 05:54 AM
Thanks John, I'll see what I can make out of it. As I said I am converting the driver to Smart Basic and there is limited to none flexibility there regarding words and longwords.