2024-09-07 09:20 PM - edited 2024-09-07 09:22 PM
I have two VL53L7CX Time of Flight sensors connected to a STM32F401CCU6. I was able to modify the X-CUBE-TOF VL53L7CX template to support both sensors, but I can't get low power mode to work for some reason.
specifically, trying to use a sensor after calling:
CUSTOM_RANGING_SENSOR_Stop(Instance);
does not work. Even if I turn it back on with:
status = CUSTOM_RANGING_SENSOR_Start(Instance, RS_MODE_BLOCKING_CONTINUOUS);
It also seems to not be doing what it's supposed to either, as the system still draws a lot of current even when it's supposed to be in low power. This was not a problem with the single sensor setup
I've included all code that might be relevant here: https://github.com/youcefs21/multi-tof
if there is anything else I can clarify/test, let me know!
thanks
Solved! Go to Solution.
2024-09-11 08:24 AM
Never mind, it was a dumb pin issue on my end, my bad
2024-09-09 09:03 AM
I had a glance though your code, and what I don't see is how you changed the I2C address. (Although I must admit, I didn't look really closely.)
When the sensors power up, they are both at address 0x29 (or 0x52 write, 0x53 read).
I'm guessing that when you initialized the sensors, both your instances went to the same address.
The proper way to do this is.
- put both sensors into standby.
- bring one out of standby and issue the "address change" command. then initialize it.
- bring the second one out of standby and initialize it.
(Optionally, you can change the address of the second one. If the sensor ever reboots for some reason it will revert to 0x29 and you can detect it. It's a minor point.)
- john
2024-09-09 10:11 AM
Hi, thanks for the reply.
The sensors are not connected to the same I2C pins, so I don't see why this is needed? sensor 1 is connected to I2C1 and sensor 2 is connected to I2C3. Should I connect them both to the same pins?
2024-09-09 12:25 PM
No - if they are on different busses then you are fine. Explains why i didn't see any code. Your way is easier.
2024-09-11 08:24 AM
Never mind, it was a dumb pin issue on my end, my bad