cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to detect overflow with LIS2MDL?

wild
Associate II
Posted on June 06, 2018 at 19:15

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

2 REPLIES 2
Maciej Frankowski
Associate II
Posted on July 10, 2018 at 12:24

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

Peter M
Associate II

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