2025-10-29 3:04 AM
Hello,
I am testing the LIS2MDL magnetometer in single-shot mode with offset cancellation enabled, according to the datasheet (DS12144 - Rev 6, page 22). The documentation states that in single-shot mode both bits OFF_CANC and OFF_CANC_ONE_SHOT in register CFG_REG_B must be set to 1.
However, when these bits are both set (CFG_REG_B) and a single measurement is triggered by writing md = 01b in CFG_REG_A the measurement never completes — the ZYXDA flag in STATUS_REG remains 0 permanently.
If only OFF_CANC_ONE_SHOT=1 is set, the measurement finishes normally and ZYXDA is asserted, but the output values look identical to normal single-shot measurements (no visible offset compensation effect).
Test conditions:
BDU=1
verified data readout sequence (reading all 6 output bytes resets ZYXDA properly)
communication via SPI verified by WHO_AM_I = 0x40
It appears that combining OFF_CANC=1 and OFF_CANC_ONE_SHOT=1 prevents the internal FSM from completing a single measurement.
Questions:
Is this a known limitation or silicon bug of the LIS2MDL?
Is there any confirmed working configuration for single-shot with offset cancellation?
Should the offset cancellation be used only in continuous mode?