2024-04-07 09:22 AM - edited 2024-04-07 09:28 AM
Hi
I'm trying to use two ISM330IS sensors both connected to the same external microcontroller.
I want to synchronize accelerometer and gyroscope sampling (and the ISPU) to the processing cycle (1ms) of my controller.
They should optimally both start the sample at the same time, triggered by a pulse from the microcontroller connected to both the sensors.
I'm not 100% certain if this is actually possible. In AN5850 the INT2 pin is described like it may be used for this purpose (I²C master external synchronization signal (MDRDY)). It is described that this pin can be used to externally trigger sampling of the "sensor hub", which is a number of optionally connected I2C sensors. The description in section 6.2.1 of AN5850 is:
"When this bit is set to 1, at least one sensor between the accelerometer and the gyroscope has to
be active and the sensor hub trigger signal is the INT2 pin"
Does this mean that I can use a pulse on the INT2 pin to trigger sampling of the gyro and accelerometer, or is this pin only for triggering sampling of external I2C sensors (which I don't have)?
If it is possible to use the INT2 pin for this, is there any available examples which does this? If not, is there any other way to make the ISM330IS to synchronize sampling from an external trigger, or is it simply not possible to do with this part?
2024-04-10 07:13 AM
Hi @srv ,
To synchronize them, you could enable BDU (reg 12h, bit 6) and IF_INC (reg 12h, bit 2) and read them in quick succession.
In addition to minimize the synchronization error you can set the maximum ODR.
Hope this helps.
2024-04-10 10:17 AM
Hmm, no sorry, I'm not sure that answer my questions.
Will triggering the "sensor hub" with a pulse on the INT2 pin not trigger a sample of the accelerometer and gyro?
In the datasheet for the ISM330IS, it says:
"The ISM330IS features programmable interrupts and an on-chip sensor hub, which includes up to six sensors:
two internal (accelerometer and gyroscope) and four external sensors"
What does it mean that the accelerometer and gyro is part of the sensor hub, and as stated in AN5850 section 6.2.1, if configured, "the sensor hub trigger signal is the INT2 pin"?
I would assume that means that the INT2 pin can be used to trigger a sample. Is that not the case? If not, what does the descriptions in the datasheet and application note mean?