cancel
Showing results for 
Search instead for 
Did you mean: 

Combining Simple Applications (MEMS, TOF)

KHwan.2
Associate II

Hello, Im not a good English speaker so please understand my English grammer.

Im here to ask about combining X-CUBE TOF and MEMS simple application.

I will be so happy if you help me 🙂

​

What enviroment Im working

STM32CubeIDE(1.7.0) didnt upgrade because 1.8.0 have issue on my mac.(when I generate code more than one time in ioc file, code conflict on build)

macOS Monterey(12.0.1)

X-CUBE-MEMS1(9.1.0)

X-CUBE-TOF1(2.0.0)

Nucleo WB55RG (ST-LINK FW : V2J39M27, BL Version : 0xd5, is this right?)

VL53L3CX breakout boards (Quantity : 8, Bus : I2C1)

Adafruit LSM6DSO32 (Bus : I2C3)

Adafruit LIS3MDL (Bus : I2C3)

​

What I did (All worked good)

1.communicated with single range sensor, used VL53L3CX_SimpleRanging in X-CUBE Software Packs (used user manual)

2.communicated with 8 range sensors, modified single range sensor application

3.communicated with Adafruit LSM6DSO32, LIS3MDL, used CUSTOM_DataLogFusion in X-CUBE Software Packs (used user manual)

BUT when I merge 2 and 3 to single project, TOF and MEMS sensors cant function.

I splitted I2C bus, one is for TOF, and other is for MEMS. I know all can be in a single bus. but when I tested sensors in a single bus, It didnt work. so I tested splitting I2C bus and V3.3.

Should I have to know about CRC or RTC functions? is this functions are conflicting with TOF sensors?

or

Should I have to know about TIM2 global Interrupt?

What should I have to know?

5 REPLIES 5
AG.8
Associate III

Hi @KHwan.2​ , that looks an interesting project. There are some examples in firmware function pack FP-SNS-MOTENVWB1 by ST that implements sensor interface with STM32WB: you might start from this, adding the libraries for the Time of Flight sensors.

AG

I think I'm not suffering from software that adding the libraries ToF and MEMS. I'm stuck at hardware connection between laser sensors.

John E KVAM
ST Employee

Could your problem be that all the VL53's are at the same address? To change the address, there is a I2C command, but in order to use it, all the other sensors have to be shutdown. Once issued the current sensor will only respond to the new address - so you can bring up the next one and change it's address.

You said you communicated with 8 sensors, so you might already be past this.

  • john


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

I shut downed all sensors and,

woke up one by one

and changed address.

When I do with 2 or 3 VL53 sensors, It works and it proves I changed address correctly.

but since I do with 4 ~ 8 sensors, this not work.

John E KVAM
ST Employee

I've been working with the I2C bus for 30 years and in a word it's "awful". It's error prone, it requires an insane amount of tweaking and it's unreliable. But it is cheap. And you cannot beat cheap.

So get your scope out and you will see what is happening. As you add more devices to the bus the capacitance changes and you need to adjust the pull-ups.

And don't forget the wire lengths. That matters too.

Philips invented the bus and NXP bought Philips. So go to NXP and look up how to tune your I2C bus. There is a formula there, but it basically says, more devices on the bus, bigger pull-ups.


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'