RegForge

Comparisons / ADXL345 vs LIS3DH

ADXL345 vs LIS3DH

Register-level differences, generated from both maps.

ADXL345LIS3DH
ManufacturerAnalog DevicesSTMicroelectronics
What it is3-axis MEMS accelerometer with tap, activity and free-fall detection3-axis MEMS accelerometer with FIFO, click and 4D detection
Registers3040
BusesI2C, SPII2C, SPI
I²C addresses0x53, 0x1D0x18, 0x19
Shared registers00
Unique registers3040

Only on the ADXL345

AddrRegisterDescription
0x27ACT_INACT_CTLAxis enables for activity and inactivity detection
0x2BACT_TAP_STATUSWhich axis was involved in the most recent event
0x2CBW_RATEOutput data rate and low-power mode
0x32DATAX0X-axis measurement, low byte
0x33DATAX1X-axis measurement, high byte
0x34DATAY0Y-axis measurement, low byte
0x35DATAY1Y-axis measurement, high byte
0x36DATAZ0Z-axis measurement, low byte
0x37DATAZ1Z-axis measurement, high byte
0x31DATA_FORMATData presentation. FULL_RES changes how the 13-bit result is aligned, which is the usual cause of scaling that looks wrong by a factor of 2.
0x00DEVIDDevice ID. Always reads 0xE5.
0x21DURMaximum tap duration, 625 us per LSB
0x38FIFO_CTLFIFO mode and watermark
0x39FIFO_STATUSFIFO fill level
0x2EINT_ENABLEInterrupt enables
0x2FINT_MAPInterrupt routing. 0 sends the event to INT1, 1 sends it to INT2.
0x30INT_SOURCEWhich interrupts are asserted. Reading clears most of them.
0x22LATENTTap latency, 1.25 ms per LSB
0x1EOFSXX-axis offset, two's complement, 15.6 mg per LSB
0x1FOFSYY-axis offset, two's complement, 15.6 mg per LSB
0x20OFSZZ-axis offset, two's complement, 15.6 mg per LSB
0x2DPOWER_CTLPower-saving control. Measure is clear at reset, so the part boots in standby and produces no data until you set it.
0x2ATAP_AXESAxis enables for tap detection
0x24THRESH_ACTActivity threshold, 62.5 mg per LSB
0x28THRESH_FFFree-fall threshold, 62.5 mg per LSB
0x25THRESH_INACTInactivity threshold, 62.5 mg per LSB
0x1DTHRESH_TAPTap threshold, 62.5 mg per LSB
0x29TIME_FFFree-fall time, 5 ms per LSB
0x26TIME_INACTInactivity time, 1 s per LSB
0x23WINDOWDouble-tap window, 1.25 ms per LSB

Full ADXL345 register map

Only on the LIS3DH

AddrRegisterDescription
0x38CLICK_CFGClick detection configuration
0x39CLICK_SRCClick detection source
0x3ACLICK_THSClick threshold
0x1ECTRL_REG0SDO/SA0 pull-up control. The reserved bits must be written as 0b0010000.
0x20CTRL_REG1Output data rate, low-power mode and axis enables. Note the reset value: all three axes are enabled but ODR is power-down, so the part produces nothing until you set a rate.
0x21CTRL_REG2High-pass filter configuration
0x22CTRL_REG3INT1 pin routing
0x23CTRL_REG4Scale, resolution and SPI mode
0x24CTRL_REG5Memory reboot, FIFO and interrupt latching
0x25CTRL_REG6INT2 pin routing and interrupt polarity
0x2EFIFO_CTRL_REGFIFO mode and threshold
0x2FFIFO_SRC_REGFIFO status
0x30INT1_CFGInterrupt 1 configuration
0x33INT1_DURATIONInterrupt 1 duration
0x31INT1_SRCInterrupt 1 source. Cleared on read.
0x32INT1_THSInterrupt 1 threshold
0x34INT2_CFGInterrupt 2 configuration
0x37INT2_DURATIONInterrupt 2 duration
0x35INT2_SRCInterrupt 2 source. Cleared on read.
0x36INT2_THSInterrupt 2 threshold
0x09OUT_ADC1_HADC channel 1, high byte
0x08OUT_ADC1_LADC channel 1, low byte
0x0BOUT_ADC2_HADC channel 2, high byte
0x0AOUT_ADC2_LADC channel 2, low byte
0x0DOUT_ADC3_HADC channel 3, high byte
0x0COUT_ADC3_LADC channel 3, low byte
0x29OUT_X_HX-axis acceleration, high byte
0x28OUT_X_LX-axis acceleration, low byte
0x2BOUT_Y_HY-axis acceleration, high byte
0x2AOUT_Y_LY-axis acceleration, low byte
0x2DOUT_Z_HZ-axis acceleration, high byte
0x2COUT_Z_LZ-axis acceleration, low byte
0x26REFERENCEReference value for interrupt generation
0x27STATUS_REGAcceleration data status
0x07STATUS_REG_AUXADC data-ready and overrun flags
0x1FTEMP_CFG_REGTemperature sensor and ADC enable
0x3CTIME_LATENCYClick time latency
0x3BTIME_LIMITClick time limit
0x3DTIME_WINDOWClick time window
0x0FWHO_AM_IDevice identification. Always reads 0x33.

Full LIS3DH register map

Get either as C

regforge gen ADXL345 --out ./src --driver --tests
regforge gen LIS3DH --out ./src --driver --tests