I need to know te right way to change de settings on Nicla Vision sensors to be used in openMV IDE.
vl53l1x - i need to change the parameters to modify the distance mode
lsm6dsox - i need to change the data output rate frequency to meet the ToF sensor frequency.
Is it possible to do that by parameters or I need to change the libraries and recompile the firmware?
OK, so I modified the the default confguration vector for vl51l3x and the output frequency for lsm6dsox
I did this by including in my code:
VL51L1X_DEFAULT_CONFIGURATION = bytes(
0x24, # 0x2d : set bit 2 and 5 to 1 for fast plus mode (1MHz I2C), else don’t touch <-------
0x00, # 0x2e : bit 0 if I2C pulled up at 1.8V, else set bit 0 to 1 (pull up at AVDD)
0x00, # 0x2f : bit 0 if GPIO pulled up at 1.8V, else set bit 0 to 1 (pull up at AVDD)
0x01, # 0x30 : set bit 4 to 0 for active high interrupt and 1 for active low
# (bits 3:0 must be 0x1), use SetInterruptPolarity()
0x02, # 0x31 : bit 1 = interrupt depending on the polarity, use CheckForDataReady()
0x00, # 0x32 : not user-modifiable
0x02, # 0x33 : not user-modifiable
0x08, # 0x34 : not user-modifiable
0x00, # 0x35 : not user-modifiable
0x08, # 0x36 : not user-modifiable
0x10, # 0x37 : not user-modifiable
lsm = LSM6DSOX(SPI(5), cs=Pin(“PF6”, Pin.OUT_PP, Pin.PULL_UP), gyro_odr=52, accel_odr=52)
tof = VL53L1X(I2C(2))
These are the modified parts of the main file, and I want to change the lsm response fequency to 52hz and the ToF frequency to 1MHz (according to configuration file). This is the correct way to do this or I should have done different?
You need to use the read/write register methods in the classes I linked to. You can do whatever you want via them.
ok, to write this values
0x00, # 0x2d : set bit 2 and 5 to 1 for fast plus mode (1MHz I2C), else don’t touch
tof.writeReg(reg = 0x2d, value = 0x24)
and got no changes. Is this right?
Hi, I wouldn’t try to change the I2C bus frequency… nor should you need to. I don’t know why you’d need updates to be faster than what they already are.
Regarding the lsm response frequency. I don’t know what that is. Please use the datasheet for the sensor to workout what registers you want to edit and understand the effect. As you can see from the driver code it’s very simple and you have direct access to control the chip as you like.
I need to test the higher frequency I could get in every capture, that’s the point.
I just need to know if I understood right the way to do it with the codeline I posted before, from this I can change the things I need regarding the sensor behaviour.
Hi, the I2C bus speed is fixed. That will not go any faster. However, you can change the sensor regs all you want to change it’s sampling output behavior. You shouldn’t need to go any faster than the default I2C speed as the sensor doesn’t generate that much data.
Thanks for your answer.
Also this sensor has 3 operation modes: fast, long distance and short. How to modify this operation mode? There is no explanation aboute this in the register’s coments or elsewere in the file.