2018-06-06 10:15 AM
Greetings
I am using the LIS2MDL to build a magnetic field sensor for the education market. When the magnetic field being measured exceeds the maximum allowed value, I notice that the LIS2MDL returns unpredictable data rather than 0x7fff (32767) or 0x8000 (-32768).
Is there a way I can detect a magnetic field measurement overflow so that our visualization software can let the user know the measurement data is invalid?
Thank you
Scott Wild
2018-07-10 03:24 AM
Hi,
You can check the MROI bit in INT_SOURCE_REG. This flag alerts if a measurement range overflow has occured. Make sure that the interrupt generator is active (IEN bit = 1). Latched MROI bit is reset by reading INT_SOURCE_REG.
Greetings
Maciej
2018-07-30 01:13 AM
Hi, I have the same behaviour with LIS2MDL and also with a LIS3MDL.
My application is to detect the proximity of a magnet. Under about 1cm the measures are unexpected.
I have done some experiments with some other sensors but with only one axe and the behaviour is as expected : the closer the magnet, the higher the measurement until saturation, which stays saturation...
I have tried the Maciej's proposition but this process comes too late, the measures are already false.
Scott did you manage to get a correct operation ?
Thanks
Peter