Datasheet docs

STMicroelectronics

LIS3MDL

Ultralow-power, high-performance digital 3-axis magnetometer with selectable ±4/±8/±12/±16 gauss ranges and 16-bit output.

3-axis digital magnetometerLIS3MDLTRLIS3MDLLGA-12L, 2.0 x 2.0 x 1.0 mmI2CSPI


LGA-12L (2.0 x 2.0 x 1.0 mm)

Digital output magnetic sensor: ultralow-power, high-performance 3-axis magnetometer

Features

• Wide supply voltage, 1.9 V to 3.6 V

• Independent IO supply (1.8 V)

• ±4/±8/±12/±16 gauss selectable magnetic full scales

• Continuous and single-conversion modes

• 16-bit data output

- Interrupt generator

- Self-test

• I²C/SPI digital output interface

• Power-down mode / low-power mode

• ECOPACK and RoHS compliant

Product status link

LIS3MDL

Product summary

Order codeLIS3MDLTR
Temperature range [°C]-40 to +85
PackageLGA-12L
PackingTape and reel

Product resources

AN4602 (device application note)

TN0018 (design and soldering)

Applications

- Magnetometers

- Compasses

Description

The LIS3MDL is an ultralow-power high-performance 3-axis magnetic sensor with user-selectable full scales of $\pm 4 / \pm 8 / \pm 12 / \pm 16$ gauss.

The self-test capability allows the user to check the functioning of the sensor in the final application.

The device may be configured to generate interrupt signals for magnetic field detection.

The LIS3MDL includes an I²C serial bus interface that supports standard and fast mode (100 kHz and 400 kHz) and SPI serial standard interfaces.

The device is available in a small thin plastic, land grid array (LGA) package and is guaranteed to operate over an extended temperature range of $-40^{\circ}C$ to $+85^{\circ}C$ .

Block diagram and pin description

1.1 Block diagram

Figure 1. Block diagram

CONTROL LOGIC

1.2 Pin description

DIRECTION OF
DETECTABLE
MAGNETIC FIELDS

Figure 2. Pin description

Table 1. Pin description

Pin#NameFunction
1SCL $I^{2}C$ serial clock (SCL)
SPCSPI serial port clock (SPC)
2ReservedConnect to GND
3GNDConnect to GND
4C1Capacitor connection ( $C1 = 100 nF$ )
5VddPower supply
6Vdd_IOPower supply for I/O pins
7INTInterrupt
8DRDYData ready
9SDOSPI serial data output (SDO)
SA1 $I^{2}C$ less significant bit of the device address (SA1)
10CSEnable SPI $I^{2}C/SPI$ mode selection(1: SPI idle mode / $I^{2}C$ communication enabled;0: SPI communication mode / $I^{2}C$ disabled)
11SDA $I^{2}C$ serial data (SDA)
SDISPI serial data input (SDI)
SDO3-wire interface serial data output (SDO)
12ReservedConnect to GND

Magnetic and electrical specifications

2.1 Magnetic characteristics

@Vdd = 2.5 V, T = 25°C unless otherwise noted. The product is factory calibrated at 2.5 V. The operational power supply range is from 1.9 V to 3.6 V.

Table 2. Magnetic characteristics

SymbolParameterTest conditionsMin. $Typ.^{(1)}$ Max.Unit
FSMeasurement range±4gauss
±8
±12
±16
GNSensitivityFS = ±4 gauss6842LSB/ gauss
FS = ±8 gauss3421
FS = ±12 gauss2281
FS = ±16 gauss1711
ZgaussZero-gauss levelFS = ±4 gauss±1gauss
RMSRMS noiseX-axis; FS = ±12 gauss; Ultrahigh-performance mode3.2mgauss
Y-axis; FS = ±12 gauss Ultrahigh-performance mode3.2mgauss
Z-axis; FS = ±12 gauss Ultrahigh-performance mode4.1mgauss
NLNonlinearityBest-fit straight line FS = ±12 gauss Happlied = ±6 gauss±0.12%FS
STSelf $test^{(2)}$ X-axis FS = ±12 gauss13gauss
Y-axis FS = ±12 gauss13
Z-axis FS = ±12 gauss0.11
DFMagnetic disturbance fieldZero-gauss offset starts to degrade50gauss
TopOperating temperature range-40+85°C
  1. Absolute value
  2. Typical specifications are not guaranteed.

2.2

Temperature sensor characteristics

@Vdd = 2.5 V, T = 25°C unless otherwise noted. The product is factory calibrated at 2.5 V.

Table 3. Temperature sensor characteristics

SymbolParameterTest conditionsMin. $Typ.^{(1)}$ Max.Unit
TSDrTemperature sensor output change vs. temperature-8LSB/°C
TODR $Temperature refresh rate^{(2)}$ ODRHz
TopOperating temperature range-40+85°C
  1. Typical specifications are not guaranteed.
  2. If the TEMP_EN bit in CTRL_REG1 (20h) is set to 1, temperature data is acquired at each conversion cycle. Refer to Table 21.

Electrical characteristics

@Vdd = 2.5 V, T = 25°C unless otherwise noted. The product is factory calibrated at 2.5 V. The operational power supply range is from 1.9 V to 3.6 V.

Table 4. Electrical characteristics

SymbolParameterTest conditionsMin. $Typ.^{(1)}$ Max.Unit
VddSupply voltage1.93.6V
Vdd_IOPower supply for I/O1.711.8Vdd+0.1
Idd_HRCurrent consumption in ultrahigh-resolution modeODR = 20 Hz270μA
Idd_LPCurrent consumption in low-power modeODR = 20 Hz40μA
Idd_PDCurrent consumption in power down1μA
TopOperating temperature range-40+85°C

1. Typical specifications are not guaranteed.

2.4

Communication interface characteristics

2.4.1

SPI - serial peripheral interface

Subject to general operating conditions for Vdd and Top.

Table 5. SPI slave timing values

SymbolParameterValue(1)Unit
Min.Max.
$t_{c(SPC)}$ SPI clock cycle100ns
$f_{c(SPC)}$ SPI clock frequency10MHz
$t_{su(CS)}$ CS setup time5ns
$t_{h(CS)}$ CS hold time20
$t_{su(SI)}$ SDI input setup time5
$t_{h(SI)}$ SDI input hold time15
$t_{v(SO)}$ SDO valid output time50
$t_{h(SO)}$ SDO output hold time5
$t_{dis(SO)}$ SDO output disable time50
  1. Values are guaranteed at 10 MHz clock frequency for SPI with both 4 and 3 wires, based on characterization results, not tested in production.

Figure 3. SPI slave timing diagram

Note: Measurement points are done at 0.3*Vdd_IO and 0.7*Vdd_IO for both input and output ports.

2.4.2

I²C - inter IC control interface

Subject to general operating conditions for Vdd and Top.

Table 6. I²C slave timing values

SymbolParameter $I^2C standard mode^{(1)}$ $I^2C fast mode^{(1)}$ Unit
Min.Max.Min.Max.
$f_{(SCL)}$ SCL clock frequency01000400kHz
$t_{w(SCLL)}$ SCL clock low time4.71.3μs
$t_{w(SCLH)}$ SCL clock high time4.00.6
$t_{su(SDA)}$ SDA setup time250100ns
$t_{h(SDA)}$ SDA data hold time03.4500.9μs
$t_{r(SDA)} t_{r(SCL)}$ SDA and SCL rise time1000 $20 + 0.1C_b^{(2)}$ 300ns
$t_{f(SDA)} t_{f(SCL)}$ SDA and SCL fall time300 $20 + 0.1C_b^{(2)}$ 300
$t_{h(ST)}$ START condition hold time40.6μs
$t_{su(SR)}$ Repeated START condition setup time4.70.6
$t_{su(SP)}$ STOP condition setup time40.6
$t_{w(SP:SR)}$ Bus free time between STOP and START condition4.71.3
  1. Data based on standard I²C protocol requirement, not tested in production.
  2. $C_{b}$ = total capacitance of one bus line, in pF.

Figure 4. I²C slave timing diagram

Measurement points are done at 0.3*Vdd_IO and 0.7*Vdd_IO for both ports.

2.5

Absolute maximum ratings

Stresses above those listed as absolute maximum ratings may cause permanent damage to the device. This is a stress rating only and functional operation of the device under these conditions is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability.

Table 7. Absolute maximum ratings

SymbolRatingsMaximum valueUnit
VddSupply voltage-0.3 to +4.8V
Vdd_IOI/O pins supply voltage-0.3 to +4.8V
VinInput voltage on any control pin (SCL/SPC, SDA/SDI/SDO, SDO/SA1, CS)-0.3 to Vdd_IO +0.3V
$A_{UNP}$ Acceleration (any axis)3,000 for 0.5 msg
10,000 for 0.1 msg
$M_{EF}$ Maximum exposed field1000gauss
$T_{OP}$ Operating temperature range-40 to +85°C
$T_{STG}$ Storage temperature range-40 to +125°C

Supply voltage on any pin should never exceed 4.8 V.

This device is sensitive to mechanical shock, improper handling can cause permanent damage to the part.

This device is sensitive to electrostatic discharge (ESD), improper handling can cause permanent damage to the part.

3 Terminology and functionality

3.1 Sensitivity

Sensitivity describes the gain of the sensor and can be determined, for example, by applying a magnetic field of 1 gauss to it.

3.2 Zero-gauss level

Zero-gauss level offset describes the deviation of an actual output signal from the ideal output if no magnetic field is present.

3.3 Factory calibration

The IC interface is factory calibrated for sensitivity (So) and zero-gauss level (TyOff).

The trimming values are stored in the device in nonvolatile memory. Each time the device is turned on, the trimming parameters are downloaded to the registers to be employed during active operation, which allows using the device without further calibration.

Application hints


Figure 5. LIS3MDL electrical connections
DIRECTION OF
DETECTABLE
MAGNETIC FIELDS

4.1

External capacitors

The LIS3MDL requires one external capacitor (C1 = 100 nF) connected between pin 4 and GND.

The device core power supply line (Vdd) needs one high-frequency decoupling capacitor (C3 = 100 nF, ceramic) as near as possible to the supply pin, and a low-frequency electrolytic capacitor (C2 = 1 $\mu$ F). All the voltage and ground supplies must be present at the same time to have proper behavior of the IC (refer to Figure 5).

The functionality of the device and the measured magnetic field data are selectable and accessible through the I²C / SPI interfaces.

The functions, the threshold, and the timing of the interrupt pin (INT) can be completely programmed by the user through the I²C / SPI interfaces.

When the I²C or 3-wire SPI is used, the SDO/SA1 pin must be connected to Vdd_IO or GND.

4.2

Soldering information

The LGA package is compliant with the ECOPACK and RoHS standard.

It is qualified for soldering heat resistance according to JEDEC J-STD-020.

For land pattern and soldering recommendations, consult technical note TN0018 available on www.st.com.

4.3

High-current wiring effects

High current in wiring and printed circuit traces can cause errors in magnetic field measurements for compassing. Conductor-generated magnetic fields add to the Earth's magnetic field, causing errors in compass heading computation.

Keep currents higher than 10 mA a few millimeters away from the sensor IC.

Digital interfaces

The registers embedded in the LIS3MDL may be accessed through both the I²C and SPI serial interfaces. The latter may be software configured to operate either in 3-wire or 4-wire interface mode.

The serial interfaces are mapped to the same pads. To select/exploit the I²C interface, the CS line must be tied high (that is, connected to Vdd_IO).

Table 8. Serial interface pin description

Pin namePin description
CSEnable SPI $I^{2}C/SPI$ mode selection (1: SPI idle mode / $I^{2}C$ communication enabled;0: SPI communication mode / $I^{2}C$ disabled)
SCL $I^{2}C$ serial clock (SCL)
SPCSPI serial port clock (SPC)
SDA $I^{2}C$ serial data (SDA)
SDISPI serial data input (SDI)
SDO3-wire interface serial data output (SDO)
SA1 $I^{2}C$ less significant bit of the device address (SA1)
SDOSPI serial data output (SDO)

5.1

I²C serial interface

The LIS3MDL I $^{2}$ C is a bus slave. The I $^{2}$ C is employed to write data to registers whose content can also be read back.

The relevant I $^{2}$ C terminology is given in the table below.

Table 9. I²C terminology

TermDescription
TransmitterThe device that sends data to the bus
ReceiverThe device that receives data from the bus
MasterThe device that initiates a transfer, generates clock signals, and terminates a transfer
SlaveThe device addressed by the master

There are two signals associated with the I²C bus: the serial clock line (SCL) and the serial data line (SDA). The latter is a bidirectional line used for sending and receiving the data to/from the interface. Both lines must be connected to Vdd_IO through an external pull-up resistor. When the bus is free, both the lines are high. The I²C interface is compliant with fast mode (400 kHz) I²C standards, as well as with normal mode. When the I²C interface is used, the SDO/SA1 pin has to be connected to Vdd_IO or GND.

5.1.1

I²C operation

The transaction on the bus is started through a START (ST) signal. A START condition is defined as a high to low transition on the data line while the SCL line is held high. After this has been transmitted by the master, the bus is considered busy. The next byte of data transmitted after the start condition contains the address of the slave in the first seven bits and the eighth bit tells whether the master is receiving data from the slave or transmitting data to the slave. When an address is sent, each device in the system compares the first seven bits after a start condition with its address. If they match, the device considers itself addressed by the master.

The slave address (SAD) associated to the LIS3MDL is 00111x0b, whereas the x bit is modified by the SDO/SA1 pin in order to modify the device address. If the SDO/SA1 pin is connected to the voltage supply, the address is 0011110b, otherwise, if the SDO/SA1 pin is connected to ground, the address is 0011100b.

Data transfer with acknowledge is mandatory. The transmitter must release the SDA line during the acknowledge pulse. The receiver must then pull the data line low so that it remains stable low during the HIGH period of the acknowledge clock pulse. A receiver that has been addressed is obliged to generate an acknowledge after each byte of data received.

The I²C embedded inside the LIS3MDL behaves like a slave device and the following protocol must be adhered to. After the START condition (ST) a slave address is sent, once a slave acknowledge (SAK) has been returned, an 8-bit subaddress (SUB) is transmitted: the 7 LSb represent the actual register address while the MSb enables address autoincrement. If the MSb of the SUB field is 1, the SUB (register address) is automatically increased to allow multiple data read/write.

The slave address is completed with a read/write bit. If the bit is 1 (read), a repeated START (SR) condition must be issued after the two subaddress bytes; if the bit is 0 (write) the master transmits to the slave with direction unchanged. Table 10 explains how the SAD+read/write bit pattern is composed, listing all the possible configurations.

Table 10. SAD+read/write patterns

CommandSAD[6:2]SAD[1] = SDO/SA1SAD[0]R/WSAD+R/W
Read0011100100111001 (39h)
Write0011100000111000 (38h)
Read0011110100111101 (3Dh)
Write0011110000111100 (3Ch)

Table 11. Transfer when master is writing one byte to slave

MasterSTSAD + WSUBDATASP
SlaveSAKSAKSAK

Table 12. Transfer when master is writing multiple bytes to slave

MasterSTSAD + WSUBDATADATASP
SlaveSAKSAKSAKSAK

Table 13. Transfer when master is receiving (reading) one byte of data from slave

MasterSTSAD + WSUBSRSAD + RNMAKSP
SlaveSAKSAKSAKDATA

Table 14. Transfer when master is receiving (reading) multiple bytes of data from slave

MasterSTSAD+WSUBSRSAD+RMAKMAKNMAKSP
SlaveSAKSAKSAKDATADATADATA

Data are transmitted in byte format (DATA). Each data transfer contains 8 bits. The number of bytes transferred per transfer is unlimited. Data is transferred with the most significant bit (MSb) first. If a receiver cannot receive another complete byte of data until it has performed some other function, it can hold the clock line SCL low to force the transmitter into a wait state. Data transfer only continues when the receiver is ready for another byte and releases the data line. If a slave receiver does not acknowledge the slave address (that is, it is not able to receive because it is performing some real-time function) the data line must be left high by the slave. The master can then abort the transfer. A low to high transition on the SDA line while the SCL line is high is defined as a STOP condition. Each data transfer must be terminated by the generation of a STOP (SP) condition.

In order to read multiple bytes, it is necessary to assert the most significant bit of the subaddress field. In other words, SUB(7) must be equal to 1, while SUB(6-0) represents the address of the first register to be read. In the presented communication format, MAK is master acknowledge and NMAK is no master acknowledge.

5.2

SPI bus interface

The LIS3MDL SPI is a bus slave. The SPI allows writing to and reading from the registers of the device. The serial interface interacts with the application using four wires: CS, SPC, SDI, and SDO.

Figure 6. Read and write protocol

CS enables the serial port and it is controlled by the SPI master. It goes low at the start of the transmission and goes back high at the end. SPC is the serial port clock and it is controlled by the SPI master. It is stopped high when CS is high (no transmission). SDI and SDO are respectively the serial port data input and output. Those lines are driven at the falling edge of SPC and should be captured at the rising edge of SPC.

Both the read register and write register commands are completed in 16 clock pulses or in multiples of 8 in the case of multiple byte read/write. Bit duration is the time between two falling edges of SPC. The first bit (bit 0) starts at the first falling edge of SPC after the falling edge of CS while the last bit (bit 15, bit 23, ...) starts at the last falling edge of SPC just before the rising edge of CS.

bit 0: R $\overline{W}$ bit. When 0, the data DI(7:0) is written into the device. When 1, the data DO(7:0) from the device is read. In the latter case, the chip drives SDO at the start of bit 8.

bit 1: MS bit. When 0, the address remains unchanged in multiple read/write commands. When 1, the address is autoincremented in multiple read/write commands.

bit 2-7: address AD(5:0). This is the address field of the indexed register.

bit 8-15: data DI(7:0) (write mode). This is the data that is written into the device (MSb first).

bit 8-15: data DO(7:0) (read mode). This is the data that is read from the device (MSb first).

In multiple read/write commands further blocks of 8 clock periods are added. When the M $\overline{S}$ bit is 0, the address used to read/write data remains the same for every block. When the M $\overline{S}$ bit is 1, the address used to read/write data is increased at every block.

The function and the behavior of SDI and SDO remain unchanged.

Figure 7. SPI read

The SPI read command is performed with 16 clock pulses. A multiple byte read command is performed by adding blocks of 8 clock pulses to the previous one.

bit 0: READ bit. The value is 1.

bit 1: M $\overline{S}$ bit. When 0, does not increment the address; when 1, increments the address in multiple reads.

bit 2-7: address AD(5:0). This is the address field of the indexed register.

bit 8-15: data DO(7:0) (read mode). This is the data that is read from the device (MSb first).

bit 16-... : data DO(...-8). Further data in multiple byte reads.

Figure 8. Multiple byte SPI read protocol (2-byte example)

5.2.2

SPI write

Figure 9. SPI write protocol

The SPI write command is performed with 16 clock pulses. A multiple byte write command is performed by adding blocks of 8 clock pulses to the previous one.

bit 0: WRITE bit. The value is 0.

bit 1: MS bit. When 0, does not increment the address; when 1, increments the address in multiple writes.

bit 2 -7: address AD(5:0). This is the address field of the indexed register.

bit 8-15: data DI(7:0) (write mode). This is the data that is written inside the device (MSb first).

bit 16-... : data DI(...-8). Further data in multiple byte writes.

Figure 10. Multiple byte SPI write protocol (2-byte example)

MS AD5 AD4 AD3 AD2 AD1 AD0

5.2.3

SPI read in 3-wire mode

3-wire mode is entered by setting bit SIM to 1 (SPI serial interface mode selection) in CTRL_REG3 (22h). When 3-wire mode is used, the SDO/SA1 pin has to be connected to GND or Vdd_IO.

Figure 11. SPI read protocol in 3-wire mode

The SPI read command is performed with 16 clock pulses:

bit 0: READ bit. The value is 1.

bit 1: M$\overline{S}$ bit. When 0, does not increment the address; when 1, increments the address in multiple reads.

bit 2-7: address AD(5:0). This is the address field of the indexed register.

bit 8-15: data DO(7:0) (read mode). This is the data that is read from the device (MSb first).

A multiple read command is also available in 3-wire mode.

Register mapping

The table below provides a list of the 8-bit registers embedded in the device and their respective addresses.

Table 15. Register address map

NameTypeRegister addressDefaultComment
HexBinary
Reserved00 - 04----Reserved
OFFSET_X_REG_L_MR/W050000010100000000Hard-iron registers
OFFSET_X_REG_H_MR/W060000011000000000
OFFSET_Y_REG_L_MR/W070000011100000000
OFFSET_Y_REG_H_MR/W080000100000000000
OFFSET_Z_REG_L_MR/W090000100100000000
OFFSET_Z_REG_H_MR/W0A0000101000000000
Reserved0B - 0E----Reserved
WHO_AM_IR0F0000 111100111101Dummy register
Reserved10 - 1F----Reserved
CTRL_REG1R/W200010 000000010000
CTRL_REG2R/W210010 000100000000
CTRL_REG3R/W220010 001000000011
CTRL_REG4R/W230010 001100000000
CTRL_REG5R/W240010 010000000000
Reserved25 - 26----Reserved
STATUS_REGR270010 0111Output
OUT_X_LR280010 1000Output
OUT_X_HR290010 1001Output
OUT_Y_LR2A0010 1010Output
OUT_Y_HR2B0010 1011Output
OUT_Z_LR2C0010 1100Output
OUT_Z_HR2D0010 1101Output
TEMP_OUT_LR2E0010 1110Output
TEMP_OUT_HR2F0010 1111Output
INT_CFGR/W300011000011101000
INT_SRCR310011000100000000
INT_THS_LR/W320011001000000000
INT_THS_HR/W330011001100000000

Reserved registers or those not listed in the table above must not be changed. Writing to those registers may cause permanent damage to the device.

The content of the registers that are loaded at boot should not be changed. They contain the factory calibration values. Their content is automatically restored when the device is powered up.

Registers description

7.1 OFFSET_X_REG_L_M (05h) and OFFSET_X_REG_H_M (06h)

These registers comprise a 16-bit register and represent X hard-iron offset in order to compensate environmental effects (data in two's complement). These values act on the magnetic output data value in order to delete the environmental offset.

7.2 OFFSET_Y_REG_L_M (07h) and OFFSET_Y_REG_H_M (08h)

These registers comprise a 16-bit register and represent Y hard-iron offset in order to compensate environmental effects (data in two's complement). These values act on the magnetic output data value in order to delete the environmental offset.

7.3 OFFSET_Z_REG_L_M (09h) and OFFSET_Z_REG_H_M (0Ah)

These registers comprise a 16-bit register and represent Z hard-iron offset in order to compensate environmental effects (data in two's complement). These values act on the magnetic output data value in order to delete the environmental offset.

7.4 WHO_AM_I (0Fh)

Device identification register

Table 16. WHO_AM_I register

00111101

7.5

CTRL_REG1 (20h)

Table 17. CTRL_REG1 register

TEMP_ENOM1OM0DO2DO1DO0FAST_ODRST

Table 18. CTRL_REG1 description

TEMP_ENEnables temperature sensor. Default value: 0(0: temperature sensor disabled; 1: temperature sensor enabled)
OM[1:0]X and Y axes operative mode selection (refer to Table 20). Default value: 00
DO[2:0]Output data rate selection (refer to Table 21). Default value: 100
FAST_ODRFAST_ODR enables data rates higher than 80 Hz (refer to Table 19). Default value: 0(0: FAST_ODR disabled; 1: FAST_ODR enabled)
STEnables self-test. Default value: 0(0: self-test disabled; 1: self-test enabled)

Table 19. Data rate configuration

DO2DO1DO0FAST_ODRODR [Hz]OM
XXX11000LP
XXX1560MP
XXX1300HP
XXX1155UHP

Table 20. X and Y axes operating mode selection

OM1OM0Operating mode for X and Y axes
00Low-power mode
01Medium-performance mode
10High-performance mode
11Ultrahigh-performance mode

Table 21. Output data rate configuration

DO2DO1DO0ODR [Hz]
0000.625
0011.25
0102.5
0115
10010
10120
11040
11180

CTRL_REG2 (21h)

Table 22. CTRL_REG2 register

$0^{(1)}$ FS1FS0 $0^{(1)}$ REBOOTSOFT_RST $0^{(1)}$ $0^{(1)}$
  1. This bit must be set to 0 for the correct operation of the device.

Table 23. CTRL_REG2 description

FS[1:0]Full-scale configuration (refer to Table 24). Default value: 00
REBOOTReboots memory content. Default value: 0(0: normal mode; 1: reboot memory content)
SOFT_RSTConfiguration registers and user register reset function.(0: default value; 1: reset operation)

Table 24. Full-scale selection

FS1FS0Full-scale
00±4 gauss
01±8 gauss
10±12 gauss
11±16 gauss

7.7 CTRL_REG3 (22h)

Table 25. CTRL_REG3 register

$0^{(1)}$ $0^{(1)}$ LP $0^{(1)}$ $0^{(1)}$ SIMMD1MD0
  1. This bit must be set to 0 for the correct operation of the device.

Table 26. CTRL_REG3 description

LPLow-power mode configuration. Default value: 0If this bit is 1, DO[2:0] is set to 0.625 Hz and the system performs, for each channel, the minimum number of averages. Once the bit is set to 0, the magnetic data rate is configured by the DO bits in the CTRL_REG1 (20h) register.
SIMSPI serial interface mode selection. Default value: 0(0: 4-wire interface; 1: 3-wire interface)
MD[1:0]Operating mode selection (refer to Table 27). Default value: 11

Table 27. System operating mode selection

MD1MD0Mode
00Continuous-conversion mode
01Single-conversion modeSingle-conversion mode has to be used with sampling frequency from 0.625 Hz to 80 Hz.
10Power-down mode
11Power-down mode

7.8

CTRL_REG4 (23h)

Table 28. CTRL_REG4 register

$0^{(1)}$ $0^{(1)}$ $0^{(1)}$ $0^{(1)}$ OMZ1OMZ0BLE $0^{(1)}$
  1. This bit must be set to 0 for the correct operation of the device.

Table 29. CTRL_REG4 description

OMZ[1:0]Z-axis operative mode selection (refer to Table 30). Default value: 00
BLEBig/little endian data selection. Default value: 0(0: data LSb at lower address; 1: data MSb at lower address)

Table 30. Z-axis operating mode selection

OMZ1OMZ0Operating mode for Z-axis
00Low-power mode
01Medium-performance mode
10High-performance mode
11Ultrahigh-performance mode

CTRL_REG5 (24h)

Table 31. CTRL_REG5 register

FAST_READBDU $0^{(1)}$ $0^{(1)}$ $0^{(1)}$ $0^{(1)}$ $0^{(1)}$ $0^{(1)}$
  1. This bit must be set to 0 for the correct operation of the device.

Table 32. CTRL_REG5 description

FAST_READFAST READ allows reading the high part of DATA OUT only in order to increase reading efficiency. Default value: 0(0: FAST_READ disabled; 1: FAST_READ enabled)
BDUBlock data update for magnetic data. Default value: 0(0: continuous update;1: output registers not updated until MSb and LSb have been read)

STATUS_REG (27h)

Table 33. STATUS_REG register

ZYXORZORYORXORZYXDAZDAYDAXDA

Table 34. STATUS_REG description

ZYXORX-, Y- and Z-axis data overrun. Default value: 0(0: no overrun has occurred;1: a new set of data has overwritten the previous set)
ZORZ-axis data overrun. Default value: 0(0: no overrun has occurred;1: new data for the Z-axis has overwritten the previous data)
YORY-axis data overrun. Default value: 0(0: no overrun has occurred;1: new data for the Y-axis has overwritten the previous data)
XORX-axis data overrun. Default value: 0(0: no overrun has occurred;1: new data for the X-axis has overwritten the previous data)
ZYXDAX-, Y- and Z-axis new data available. Default value: 0(0: a new set of data is not yet available;1: a new set of data is available)
ZDAZ-axis new data available. Default value: 0(0: new data for the Z-axis is not yet available;1: new data for the Z-axis is available)
YDAY-axis new data available. Default value: 0(0: new data for the Y-axis is not yet available;1: new data for the Y-axis is available)
XDAX-axis new data available. Default value: 0(0: new data for the X-axis is not yet available;1: new data for the X-axis is available)

7.11 OUT_X_L (28h), OUT_X_H (29h)

X-axis data output. The value of the magnetic field is expressed as two's complement.

7.12 OUT_Y_L (2Ah), OUT_Y_H (2Bh)

Y-axis data output. The value of the magnetic field is expressed as two's complement.

7.13 OUT_Z_L (2Ch), OUT_Z_H (2Dh)

Z-axis data output. The value of the magnetic field is expressed as two's complement.

7.14 TEMP_OUT_L (2Eh), TEMP_OUT_H (2Fh)

Temperature sensor data. The value of the temperature is expressed as two's complement.

Table 35. INT_CFG register

XIENYIENZIEN $0^{(1)}$ 1IEALIRIEN
  1. This bit must be set to 0 for the correct operation of the device.

Table 36. INT_CFG description

XIENEnables interrupt generation on the X-axis. Default value: 1(0: disable interrupt request; 1: enable interrupt request)
YIENEnables interrupt generation on the Y-axis. Default value: 1(0: disable interrupt request; 1: enable interrupt request)
ZIENEnables interrupt generation on the Z-axis. Default value: 1(0: disable interrupt request; 1: enable interrupt request)
IEAInterrupt active configuration on INT. Default value: 0(0: low; 1: high)
LIRLatch interrupt request. Default value: 0(0: interrupt request latched; 1: interrupt request not latched)Once latched, the INT pin remains in the same state until INT_SRC (31h) is read.
IENEnables the interrupt on the INT pin. Default value: 0(0: disabled; 1: enabled)

INT_SRC (31h)

Table 37. INT_SRC register

PTH_XPTH_YPTH_ZNTH_XNTH_YNTH_ZMROIINT

Table 38. INT_SRC description

PTH_XValue on the X-axis exceeds the threshold on the positive side. Default value: 0
PTH_YValue on the Y-axis exceeds the threshold on the positive side. Default value: 0
PTH_ZValue on the Z-axis exceeds the threshold on the positive side. Default value: 0
NTH_XValue on the X-axis exceeds the threshold on the negative side. Default value: 0
NTH_YValue on the Y-axis exceeds the threshold on the negative side. Default value: 0
NTH_ZValue on the Z-axis exceeds the threshold on the negative side. Default value: 0
MROIInternal measurement range overflow on the magnetic value. Default value: 0
INTThis bit signals when an interrupt event occurs.

7.17

INT_THS_L(32h), INT_THS_H(33h)

Interrupt threshold. Default value: 0.

The value is expressed in 16-bit unsigned.

Even if the threshold is expressed in absolute value, the device detects both positive and negative thresholds.

Table 39. INT_THS_L_M

THS7THS6THS5THS4THS3THS2THS1THS0

Table 40. INT_THS_H_M

$0^{(1)}$ THS14THS13THS12THS11THS10THS9THS8
  1. This bit must be set to 0 for the correct operation of the device.

Package information

In order to meet environmental requirements, ST offers these devices in different grades of ECOPACK packages, depending on their level of environmental compliance. ECOPACK specifications, grade definitions and product status are available at: www.st.com. ECOPACK is an ST trademark.

8.1 LGA-12L package information

Figure 12. LGA-12 2.0 x 2.0 x 1.0 mm package outline and mechanical data

Dimensions are in millimeter unless otherwise specified General Tolerance is +/-0.1mm unless otherwise specified

OUTER DIMENSIONS

ITEMDIMENSION [mm]TOLERANCE [mm]
Length [L]2.00±0.15
Width [W]2.00±0.15
Height [H]1.027MAX

8365767_5

Revision history

Table 41. Document revision history

DateVersionChanges
01-Feb-20131Initial release
22-Apr-20132Updated note on page 12Product status changed from preliminary data to production data
12-Dec-20143Added FAST_ODR bit to Table 18: CTRL_REG1 register and Table 19: CTRL_REG1 descriptionAdded FAST_READ bit to Table 32: CTRL_REG5 register and Table 33: CTRL_REG5 descriptionUpdated Table 16: Register address mapMinor textual updates throughout document
15-May-20154Added Table 20: Data rate configuration
28-Oct-20155Updated registers 32h and 33h in Table 16: Register address map
02-May-20176Updated Table 1: Device summaryUpdated default values of INT_CFG (30h)
05-Dec-20237Updated Notes below Figure 3. SPI slave timing diagram and Figure 4. I2C slave timing diagramAdded hard-iron offset registers OFFSET_X_REG_L_M (05h) and OFFSET_X_REG_H_M (06h) through OFFSET_Z_REG_L_M (09h) and OFFSET_Z_REG_H_M (0Ah)Updated Section 8.1 LGA-12L package information

Contents

1 Block diagram and pin description....2
1.1 Block diagram....2
1.2 Pin description....3
2 Magnetic and electrical specifications....4
2.1 Magnetic characteristics....4
2.2 Temperature sensor characteristics....5
2.3 Electrical characteristics....5
2.4 Communication interface characteristics....6
2.4.1 SPI - serial peripheral interface....6
2.4.2 I²C - inter IC control interface....7
2.5 Absolute maximum ratings....8
3 Terminology and functionality....9
3.1 Sensitivity....9
3.2 Zero-gauss level....9
3.3 Factory calibration....9
4 Application hints....10
4.1 External capacitors....10
4.2 Soldering information....10
4.3 High-current wiring effects....10
5 Digital interfaces....11
5.1 I²C serial interface....11
5.1.1 I²C operation....12
5.2 SPI bus interface....14
5.2.1 SPI read....15
5.2.2 SPI write....16
5.2.3 SPI read in 3-wire mode....17
6 Register mapping....18
7 Registers description....19
7.1 OFFSET_X_REG_L_M (05h) and OFFSET_X_REG_H_M (06h)....19
7.2 OFFSET_Y_REG_L_M (07h) and OFFSET_Y_REG_H_M (08h)....19
7.3 OFFSET_Z_REG_L_M (09h) and OFFSET_Z_REG_H_M (0Ah)....19
7.4 WHO_AM_I (0Fh)....19
7.5 CTRL_REG1 (20h)....20
7.6 CTRL_REG2 (21h)....21

7.7 CTRL_REG3 (22h) 21
7.8 CTRL_REG4 (23h) 22
7.9 CTRL_REG5 (24h) 22
7.10 STATUS_REG (27h) 23
7.11 OUT_X_L (28h), OUT_X_H (29h) 23
7.12 OUT_Y_L (2Ah), OUT_Y_H (2Bh) 23
7.13 OUT_Z_L (2Ch), OUT_Z_H (2Dh) 23
7.14 TEMP_OUT_L (2Eh), TEMP_OUT_H (2Fh) 23
7.15 INT_CFG (30h) 24
7.16 INT_SRC (31h) 24
7.17 INT_THS_L(32h), INT_THS_H(33h) 25
8 Package information 26
8.1 LGA-12L package information 26
Revision history 27
List of tables 30
List of figures 31

List of tables

Table 1. Pin description ..... 3
Table 2. Magnetic characteristics ..... 4
Table 3. Temperature sensor characteristics ..... 5
Table 4. Electrical characteristics ..... 5
Table 5. SPI slave timing values ..... 6
Table 6. I²C slave timing values ..... 7
Table 7. Absolute maximum ratings ..... 8
Table 8. Serial interface pin description ..... 11
Table 9. I²C terminology ..... 11
Table 10. SAD+read/write patterns ..... 12
Table 11. Transfer when master is writing one byte to slave ..... 12
Table 12. Transfer when master is writing multiple bytes to slave ..... 12
Table 13. Transfer when master is receiving (reading) one byte of data from slave ..... 12
Table 14. Transfer when master is receiving (reading) multiple bytes of data from slave ..... 12
Table 15. Register address map ..... 18
Table 16. WHO_AM_I register ..... 19
Table 17. CTRL_REG1 register ..... 20
Table 18. CTRL_REG1 description ..... 20
Table 19. Data rate configuration ..... 20
Table 20. X and Y axes operating mode selection ..... 20
Table 21. Output data rate configuration ..... 20
Table 22. CTRL_REG2 register ..... 21
Table 23. CTRL_REG2 description ..... 21
Table 24. Full-scale selection ..... 21
Table 25. CTRL_REG3 register ..... 21
Table 26. CTRL_REG3 description ..... 21
Table 27. System operating mode selection ..... 21
Table 28. CTRL_REG4 register ..... 22
Table 29. CTRL_REG4 description ..... 22
Table 30. Z-axis operating mode selection ..... 22
Table 31. CTRL_REG5 register ..... 22
Table 32. CTRL_REG5 description ..... 22
Table 33. STATUS_REG register ..... 23
Table 34. STATUS_REG description ..... 23
Table 35. INT_CFG register ..... 24
Table 36. INT_CFG description ..... 24
Table 37. INT_SRC register ..... 24
Table 38. INT_SRC description ..... 24
Table 39. INT_THS_L_M ..... 25
Table 40. INT_THS_H_M ..... 25
Table 41. Document revision history ..... 27

List of figures

Figure 1. Block diagram ..... 2
Figure 2. Pin description ..... 3
Figure 3. SPI slave timing diagram ..... 6
Figure 4. I²C slave timing diagram ..... 7
Figure 5. LIS3MDL electrical connections ..... 10
Figure 6. Read and write protocol ..... 14
Figure 7. SPI read ..... 15
Figure 8. Multiple byte SPI read protocol (2-byte example) ..... 15
Figure 9. SPI write protocol ..... 16
Figure 10. Multiple byte SPI write protocol (2-byte example) ..... 16
Figure 11. SPI read protocol in 3-wire mode ..... 17
Figure 12. LGA-12 2.0 x 2.0 x 1.0 mm package outline and mechanical data ..... 26

IMPORTANT NOTICE – READ CAREFULLY

STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgment.

Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of purchasers' products.

No license, express or implied, to any intellectual property right is granted by ST herein.

Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.

ST and the ST logo are trademarks of ST. For additional information about ST trademarks, refer to www.st.com/trademarks. All other product or service names are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.

© 2023 STMicroelectronics – All rights reserved

Extracted Images

Figures and diagrams from the PDF

Preview the extracted datasheet assets and open any image in a separate tab for closer inspection.

Register bit-field row showing OMZ1, OMZ0, and BLE fields

Register bit-field row showing OMZ1, OMZ0, and BLE fields

Pin number, name, and function table

Pin number, name, and function table

Serial communication timing sequence

Serial communication timing sequence

Device application connection schematic with supply decoupling

Device application connection schematic with supply decoupling

Pin name and pin description table

Pin name and pin description table

Serial communication timing sequence with repeated data phases

Serial communication timing sequence with repeated data phases

Extracted datasheet image c6c4b29a042a9b86ab023c9b8e5ad6a887a0e139afa03a68e266734a067ed964.jpg.

Extracted datasheet image c6c4b29a042a9b86ab023c9b8e5ad6a887a0e139afa03a68e266734a067ed964.jpg.

Extracted datasheet image af3284df55aca66eac2bc8e0ff48db8362e54c6ad3762781eebfb3cee0ebc8d5.jpg.

Extracted datasheet image af3284df55aca66eac2bc8e0ff48db8362e54c6ad3762781eebfb3cee0ebc8d5.jpg.

Extracted datasheet image 78c2fc93f11eea9a848fd7a94b3dc8de0a456fcda2774aaf1de10c87787e55c4.jpg.

Extracted datasheet image 78c2fc93f11eea9a848fd7a94b3dc8de0a456fcda2774aaf1de10c87787e55c4.jpg.

Extracted datasheet image 885e16bc5ea549a8e46e0f2e0bb391e764c616bb398f52b525e515e3f9e37b85.jpg.

Extracted datasheet image 885e16bc5ea549a8e46e0f2e0bb391e764c616bb398f52b525e515e3f9e37b85.jpg.

Extracted datasheet image 24565e120efe1314557baa802440642e52bd90d2c05d9bc1f3d8d247912d13db.jpg.

Extracted datasheet image 24565e120efe1314557baa802440642e52bd90d2c05d9bc1f3d8d247912d13db.jpg.

Extracted datasheet image 5eaa0fa48af69e94e462f2e0846522cc08e7f53d79d6c137f2d7b9e2527ab7a2.jpg.

Extracted datasheet image 5eaa0fa48af69e94e462f2e0846522cc08e7f53d79d6c137f2d7b9e2527ab7a2.jpg.

Bottom-view package pinout

Bottom-view package pinout

Sensor signal processing block diagram

Sensor signal processing block diagram

Ordering and package information

Ordering and package information

Package top-view and side-view dimensions

Package top-view and side-view dimensions

Package dimension tolerance table

Package dimension tolerance table

Register bit-field row

Register bit-field row

Extracted datasheet image 9f58fa7cb766e756ea5b118cf0fd504666d0e907acba2f09435043133ed25c39.jpg.

Extracted datasheet image 9f58fa7cb766e756ea5b118cf0fd504666d0e907acba2f09435043133ed25c39.jpg.

Extracted datasheet image 57ae8a7b66ca11f7e8b4f20496cbc19d186de8516593197e316110c5bf163053.jpg.

Extracted datasheet image 57ae8a7b66ca11f7e8b4f20496cbc19d186de8516593197e316110c5bf163053.jpg.

Extracted datasheet image 36b80d4891155b7c518bd074ec42604911d0f5a7833c90132c592036f9d9a591.jpg.

Extracted datasheet image 36b80d4891155b7c518bd074ec42604911d0f5a7833c90132c592036f9d9a591.jpg.

Extracted datasheet image 30e5c3b9284402272928c7fea6cc8bd39b331243282fe456d214798d2b5da662.jpg.

Extracted datasheet image 30e5c3b9284402272928c7fea6cc8bd39b331243282fe456d214798d2b5da662.jpg.

Extracted datasheet image d194f9c381c29714c4599e65fd1a51542c04efe2e9d232b9e9b03da1e29208b1.jpg.

Extracted datasheet image d194f9c381c29714c4599e65fd1a51542c04efe2e9d232b9e9b03da1e29208b1.jpg.

Extracted datasheet image 9f4c7997e2c11196bec20fde71cc89835cca0ff3861ec36354833381e28e6f6e.jpg.

Extracted datasheet image 9f4c7997e2c11196bec20fde71cc89835cca0ff3861ec36354833381e28e6f6e.jpg.

Extracted datasheet image 02d2656f95be7e0b54d357dcfda25ace479c699bf5f8c045a52df647e41f2def.jpg.

Extracted datasheet image 02d2656f95be7e0b54d357dcfda25ace479c699bf5f8c045a52df647e41f2def.jpg.

Extracted datasheet image fa182c29af67ba910702a14ed6a111a95164188a35f10f31e156552f7f409785.jpg.

Extracted datasheet image fa182c29af67ba910702a14ed6a111a95164188a35f10f31e156552f7f409785.jpg.

Extracted datasheet image 07772cda872acbb09c779a091e2af115761894c41785868e22e4b0d18586e64e.jpg.

Extracted datasheet image 07772cda872acbb09c779a091e2af115761894c41785868e22e4b0d18586e64e.jpg.

Extracted datasheet image ef35ccccd042fdc57f1dd31651bc4c5f42b3d8555d3ef237ae4808f4c04db644.jpg.

Extracted datasheet image ef35ccccd042fdc57f1dd31651bc4c5f42b3d8555d3ef237ae4808f4c04db644.jpg.

Extracted datasheet image edbcc88cfe482150632852f438750174802e6d7624a19dbc8ea9a95b1cc5074a.jpg.

Extracted datasheet image edbcc88cfe482150632852f438750174802e6d7624a19dbc8ea9a95b1cc5074a.jpg.

Extracted datasheet image a9c9f9eb262781d559f7f502ed280685b133dbd5a6f7020933d7aca81bbf9dea.jpg.

Extracted datasheet image a9c9f9eb262781d559f7f502ed280685b133dbd5a6f7020933d7aca81bbf9dea.jpg.

Register bit-field labels

Register bit-field labels

Temperature status bit-field labels

Temperature status bit-field labels

ST LIS3MDL package photo

ST LIS3MDL package photo

Warning symbol

Warning symbol

Register field descriptions

Register field descriptions

Register field descriptions

Register field descriptions

Prohibition symbol with crossed object

Prohibition symbol with crossed object

Register field descriptions for FS, REBOOT, and SOFT_RST

Register field descriptions for FS, REBOOT, and SOFT_RST

FS1 and FS0 full-scale selection table

FS1 and FS0 full-scale selection table

Register bit values

Register bit values

Interrupt configuration register field descriptions

Interrupt configuration register field descriptions

Bottom-view package drawing with pin locations and dimensions

Bottom-view package drawing with pin locations and dimensions

Extracted datasheet image 6145fd3293fe1aee7c53c1fb3ada10263cea412537cb7284e7a41b1304ebf09d.jpg.

Extracted datasheet image 6145fd3293fe1aee7c53c1fb3ada10263cea412537cb7284e7a41b1304ebf09d.jpg.

Extracted datasheet image 87971ed4dcb3834dd80e5e0db8364cadb4e571eb4721e876fa7dd2b3b5e11013.jpg.

Extracted datasheet image 87971ed4dcb3834dd80e5e0db8364cadb4e571eb4721e876fa7dd2b3b5e11013.jpg.

Extracted datasheet image 53cfbb68b2e833150a798cf6d815d5036467e15ba76fee731c7a2ccfa98799c5.jpg.

Extracted datasheet image 53cfbb68b2e833150a798cf6d815d5036467e15ba76fee731c7a2ccfa98799c5.jpg.

Extracted datasheet image 5686d8e7321e78ede39b1a091f2f309d701db89ded104e2fe251f3b1a05b8c2a.jpg.

Extracted datasheet image 5686d8e7321e78ede39b1a091f2f309d701db89ded104e2fe251f3b1a05b8c2a.jpg.

Extracted datasheet image 6c8e6fa83cdb25f349ddde0727ea34049c3182a13fb1d1310dfa44b388c239d4.jpg.

Extracted datasheet image 6c8e6fa83cdb25f349ddde0727ea34049c3182a13fb1d1310dfa44b388c239d4.jpg.

Extracted datasheet image e16a1f52f1f84ff9ee0cea7786e483be8cad681442f88ff715797bd361e29ab2.jpg.

Extracted datasheet image e16a1f52f1f84ff9ee0cea7786e483be8cad681442f88ff715797bd361e29ab2.jpg.

SPI serial transfer timing showing CS, SPC, and SDI signals

SPI serial transfer timing showing CS, SPC, and SDI signals

Small abstract circular and triangular symbol

Small abstract circular and triangular symbol

Definitions of transmitter, receiver, master, and slave

Definitions of transmitter, receiver, master, and slave

Register bit-field row for FAST_READ

Register bit-field row for FAST_READ

SPI timing diagram for serial data input and output

SPI timing diagram for serial data input and output

Z-axis operating mode selection table

Z-axis operating mode selection table

Register bit-field row with logic values and signal labels

Register bit-field row with logic values and signal labels

Register bit-field row with master/slave and communication signals

Register bit-field row with master/slave and communication signals

Magnetic sensor performance characteristics table

Magnetic sensor performance characteristics table

Supply voltage, current consumption, and temperature specifications

Supply voltage, current consumption, and temperature specifications

Output data rate and operating mode register settings

Output data rate and operating mode register settings

Register bit-field row with thermal sensor channel labels

Register bit-field row with thermal sensor channel labels

Agent APIs

Use this datasheet from any agent

Send the page, markdown, chunks, or search endpoint to ChatGPT, Claude, embedr-app, or your own tooling.