cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3MDL: Understanding REBOOT and SOFT_RST

Nick1
Associate II

Hi,

I am using the LIS3MDL in a battery powered data logging application. I would like to be able to "reset" the part, but I do not understand the difference between the REBOOT and SOFT_RST bits in CNTRL_REG2 (21h).

Page 25 of the LIS3MDL data sheet (Rev 6) states that REBOOT "Reboot memory content." What memory content? Specifically, which registers? or is these memory locations that are not accessible? How is this different from power-cycling the part?

On the same page, the data sheet states that SOFT_RST "Configuration registers and user register reset function." This is more self explanatory, but how is it different from REBOOT? Is SOFT_RST a subset of REBOOT?

How is the reset/soft-reset used? I assume the process is to write to CRTL_REG2 with either REBOOT or SOFT_RST set, delay, write with bits cleared? Or do the bits clear themselves after the reboot/soft-reset is complete?

Thank you,

Nick

6 REPLIES 6
Eleon BORLINI
ST Employee

HI Nick, the BOOT procedure (REBOOT bit in CNTRL_REG2 (21h) reg) allows you to reload the calibration parameters in the LIS3MDL registers; it is not like a power off, and so for example the device operating mode doesn’t change after boot (if before was e.g high performance mode, it will remain hp mode). The SOFT_RST is a software reset, so it is more like a power toggle: you reset (an not only reboot the calibration values, but also resetting e.g. the operating mode and the other registers) your device even if Vdd is still on. Regards

Nick1
Associate II

Thank you for the explanation. That is very helpful.

Two follow up questions:

  1. Can you give me an example of when the REBOOT would be needed? Is it needed in case of accidentally writing to a reserved register? Are there other ways the calibration parameters can be changed/corrupted? How/when/under what circumstances are they changing?
  2. How long does a REBOOT or SOFT_RST take? I don't seen any specific timing info in the datasheet for either.

I suspect that the calibration parameters are getting changed in my device. But it is not obvious to me how/when this occurs.

Thanks again,

Nick

Eleon BORLINI
ST Employee

Hi Nick,

  1. yes you could need a simple REBOOT in case you accidentally write a reserved reg and you don't want to change the other settings (e.g. ODR, operation mode, etc, in general all the CONFIG registers).
  2. Should be around 20ms with some margin for both cases

>> I suspect that the calibration parameters are getting changed in my device

which is the symptom of the issue you are facing?

Regards

Nick1
Associate II

The symptoms are that we calibrate the magnetometer and verify that we have a good calibration. Then, after a period of time and limited use, we re-check and the magnetometer calibration is no longer accurate. The binary values have shifted by approximately 0-300 bits (8 Gauss range) with the X and Y channels usually worse than the Z. Issuing the REBOOT command restores the values to original. That indicates that there is not a strong magnetic field (over 50 G) that is changing the zero offset or some other physical explanation. The more likely scenario is that the reserved registers are being corrupted and then restored with the REBOOT.

We are using I2C for communication and the lines are shared with another part. I will take a close look at them for problems. Thank you very much for the help.

Eleon BORLINI
ST Employee

​You're welcome Nick

btw are you sure the magnetometer is not influenced by the surrounding emc, e.g. when the electrical circuit is on and running (e.g. putting the LIS3MDL away from the test board)?

I am sure it is not being influenced by the surrounding emc etc.. With the LIS3MDL locked in place, REBOOT restores the values to what they were on power-up. Nothing else is changing, so it must be the REBOOT is fixing the errors.

You can resolve this issue. I am all set .

Thanks,

Nick