2021-12-28 12:04 AM
The description of the threshold registers says: "The value is expressed in 15-bit unsigned. Even if the threshold is expressed in absolute value, the device detects both positive and negative thresholds.".
There is only one threshold to be set, despite the magnetometer having three axes.
I found a potentially matching explanation in an application note for the LSM303AGR magnetometer (AN4825):
"The interrupt threshold can be programmed using the [INT_THS_L]* and [INT_THS_H]* registers. When magnetic data exceeds the positive or the negative threshold, the interrupt signal is generated and the information about the type of interrupt is stored in the [INT_SRC_M]* register. In particular, when magnetic data exceeds the positive threshold, the [PTH_axis]* bit is set to '1', while if data exceeds the negative threshold, the [NTH_axis]* bit is set to '1'. If magnetic data lay between the positive and the negative thresholds, no interrupt signal is released."
*I replaced the register names with those of LSM9DS1
Is that also true for LSM9DS1? In other words:
Could anyone confirm this? I haven't found a similar application note for LSM9DS1, and sometimes the datasheets are a bit vague, or they assume prior knowledge of a similar sensor maybe.
Solved! Go to Solution.
2022-01-28 06:06 AM
Hi @nebelgrau77 ,
The IG_XL and IG_G are general interrupt flags (the "OR" sum of the INT_GEN_SRC_XL and INT_GEN_SRC_G interrupts).
So yes, you are basically right, the two bits of the different registers refer to the same interrupts.
-Eleon
2022-01-05 06:28 AM
Hi @nebelgrau77 ,
the description of the two threshold registers for the magnetometer interrupt are correct.
The interrupt is generated in the positive direction when the magnetic field goes above threshold from a lower value, while the negative flag is risen when the magnetic field diminishes under the defined threshold. This threshold is the same for the 3 axis.
Moreover, as you pointed out, the threshold's LSB depends upon the FullScale, according to the formula FS / 2^15.
Hence, your assumptions are mostly correct.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2022-01-05 06:41 AM
Great, thank you Eleon! I have an additional question regarding this sensor: there are two seemingly identical registers in the accelerometer/gyroscope part of the sensor, named STATUS_REG (17h and 27h). They seem to have identical fields, too. Are they simply duplicated for some convenience reason?
2022-01-10 07:51 AM
Hi @nebelgrau77 ,
you are right, they are just duplicated, probably coming from the merging of the accelerometer and the gyroscope modules (sharing the bits in the final ASIC). On the other side, the magnetometer has its own STATUS_REG_M.
-Eleon
2022-01-12 11:37 AM
Great, thanks!
2022-01-26 12:50 PM
Hi Eleon,
I have one more question regarding the interrupts, this time XL/G. The STATUS_REG has two bits: IG_XL and IG_G, that go high when "one or more interrupt events have been generated" by accelerometer or gyroscope, respectively. At the same time the interrupt-specific registers INT_GEN_SRC_G and INT_GEN_SRC_XL both have IA_G and IA_XL bits, described exactly the same. Does it mean that an accelerometer interrupt event sets both IA_XL and IG_XL bits, etc.? What is the difference between those registers/bits?
2022-01-28 06:06 AM
Hi @nebelgrau77 ,
The IG_XL and IG_G are general interrupt flags (the "OR" sum of the INT_GEN_SRC_XL and INT_GEN_SRC_G interrupts).
So yes, you are basically right, the two bits of the different registers refer to the same interrupts.
-Eleon
2022-01-28 07:45 AM
~Thank you!