News:

Let's find out together what makes a PIC Tick!

Main Menu

VL53L1X Lidar module

Started by david, Aug 25, 2023, 09:09 AM

Previous topic - Next topic

david

Many thanks for sharing - there's obviously a lot of work gone in to developing those procedures and for plodders like myself, with no background in C or C++, it should make things easier to understand.
I'm still confused by the term default configuration i.e  all the values loaded in to addresses 0x002D to 0x0085 inclusive. My understanding of "default" was that they are inherently there unless specifically overwritten yet all code I've seen so far loads these values.  Perhaps because all code I've seen sticks exactly to the ST api - I really don't know.  If they used the term standard configuration I would not question it.
Your timely post will likely keep me off the streets for a few more days - thanks again.

Cheers,
David

david

Hi All,
After several frustrating days I've now found that my 91 byte of config data aren't being written as expected so I've reduced it down to one byte and even that fails.  I've never had such grief with I2C before or maybe it's because I'm on the wrong side of 75 now.
Can some kind soul tell me what's wrong with this please. 

Symbol Lidar_W= %1010010  'OLED address and write
Symbol Lidar_R= %1010011  'OLED address and read 

    Dim data1 As Byte
    Dim data2 As Byte
    Dim data3 As Byte
    Dim int As Byte
    Dim ID As Word
    Dim Distance As Word
    DelayMS 1000

   
    HBusIn Lidar_R,$010F,[ID]     
    DelayMS 5
   
    HBusOut Lidar_W,$007F,[$C7] 
    DelayMS 5                     

again:
    HBusIn Lidar_R,$007F,[data1]     'test only
    SerOut PORTA.5,84,[Hex ID," ", Hex data1,13,10]  'returns EACC 0
    DelayMS 1000
    GoTo again   
   
End

It correctly reads the device ID (EACC) but I can't seem to write a byte to any of the config addresses which are from 0x002D to 0x0087.

Cheers,
David