Comparisons / ADXL345 vs LIS3DH
ADXL345 vs LIS3DH
Register-level differences, generated from both maps.
| ADXL345 | LIS3DH | |
|---|---|---|
| Manufacturer | Analog Devices | STMicroelectronics |
| What it is | 3-axis MEMS accelerometer with tap, activity and free-fall detection | 3-axis MEMS accelerometer with FIFO, click and 4D detection |
| Registers | 30 | 40 |
| Buses | I2C, SPI | I2C, SPI |
| I²C addresses | 0x53, 0x1D | 0x18, 0x19 |
| Shared registers | 0 | 0 |
| Unique registers | 30 | 40 |
Only on the ADXL345
| Addr | Register | Description |
|---|---|---|
| 0x27 | ACT_INACT_CTL | Axis enables for activity and inactivity detection |
| 0x2B | ACT_TAP_STATUS | Which axis was involved in the most recent event |
| 0x2C | BW_RATE | Output data rate and low-power mode |
| 0x32 | DATAX0 | X-axis measurement, low byte |
| 0x33 | DATAX1 | X-axis measurement, high byte |
| 0x34 | DATAY0 | Y-axis measurement, low byte |
| 0x35 | DATAY1 | Y-axis measurement, high byte |
| 0x36 | DATAZ0 | Z-axis measurement, low byte |
| 0x37 | DATAZ1 | Z-axis measurement, high byte |
| 0x31 | DATA_FORMAT | Data 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. |
| 0x00 | DEVID | Device ID. Always reads 0xE5. |
| 0x21 | DUR | Maximum tap duration, 625 us per LSB |
| 0x38 | FIFO_CTL | FIFO mode and watermark |
| 0x39 | FIFO_STATUS | FIFO fill level |
| 0x2E | INT_ENABLE | Interrupt enables |
| 0x2F | INT_MAP | Interrupt routing. 0 sends the event to INT1, 1 sends it to INT2. |
| 0x30 | INT_SOURCE | Which interrupts are asserted. Reading clears most of them. |
| 0x22 | LATENT | Tap latency, 1.25 ms per LSB |
| 0x1E | OFSX | X-axis offset, two's complement, 15.6 mg per LSB |
| 0x1F | OFSY | Y-axis offset, two's complement, 15.6 mg per LSB |
| 0x20 | OFSZ | Z-axis offset, two's complement, 15.6 mg per LSB |
| 0x2D | POWER_CTL | Power-saving control. Measure is clear at reset, so the part boots in standby and produces no data until you set it. |
| 0x2A | TAP_AXES | Axis enables for tap detection |
| 0x24 | THRESH_ACT | Activity threshold, 62.5 mg per LSB |
| 0x28 | THRESH_FF | Free-fall threshold, 62.5 mg per LSB |
| 0x25 | THRESH_INACT | Inactivity threshold, 62.5 mg per LSB |
| 0x1D | THRESH_TAP | Tap threshold, 62.5 mg per LSB |
| 0x29 | TIME_FF | Free-fall time, 5 ms per LSB |
| 0x26 | TIME_INACT | Inactivity time, 1 s per LSB |
| 0x23 | WINDOW | Double-tap window, 1.25 ms per LSB |
Only on the LIS3DH
| Addr | Register | Description |
|---|---|---|
| 0x38 | CLICK_CFG | Click detection configuration |
| 0x39 | CLICK_SRC | Click detection source |
| 0x3A | CLICK_THS | Click threshold |
| 0x1E | CTRL_REG0 | SDO/SA0 pull-up control. The reserved bits must be written as 0b0010000. |
| 0x20 | CTRL_REG1 | Output 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. |
| 0x21 | CTRL_REG2 | High-pass filter configuration |
| 0x22 | CTRL_REG3 | INT1 pin routing |
| 0x23 | CTRL_REG4 | Scale, resolution and SPI mode |
| 0x24 | CTRL_REG5 | Memory reboot, FIFO and interrupt latching |
| 0x25 | CTRL_REG6 | INT2 pin routing and interrupt polarity |
| 0x2E | FIFO_CTRL_REG | FIFO mode and threshold |
| 0x2F | FIFO_SRC_REG | FIFO status |
| 0x30 | INT1_CFG | Interrupt 1 configuration |
| 0x33 | INT1_DURATION | Interrupt 1 duration |
| 0x31 | INT1_SRC | Interrupt 1 source. Cleared on read. |
| 0x32 | INT1_THS | Interrupt 1 threshold |
| 0x34 | INT2_CFG | Interrupt 2 configuration |
| 0x37 | INT2_DURATION | Interrupt 2 duration |
| 0x35 | INT2_SRC | Interrupt 2 source. Cleared on read. |
| 0x36 | INT2_THS | Interrupt 2 threshold |
| 0x09 | OUT_ADC1_H | ADC channel 1, high byte |
| 0x08 | OUT_ADC1_L | ADC channel 1, low byte |
| 0x0B | OUT_ADC2_H | ADC channel 2, high byte |
| 0x0A | OUT_ADC2_L | ADC channel 2, low byte |
| 0x0D | OUT_ADC3_H | ADC channel 3, high byte |
| 0x0C | OUT_ADC3_L | ADC channel 3, low byte |
| 0x29 | OUT_X_H | X-axis acceleration, high byte |
| 0x28 | OUT_X_L | X-axis acceleration, low byte |
| 0x2B | OUT_Y_H | Y-axis acceleration, high byte |
| 0x2A | OUT_Y_L | Y-axis acceleration, low byte |
| 0x2D | OUT_Z_H | Z-axis acceleration, high byte |
| 0x2C | OUT_Z_L | Z-axis acceleration, low byte |
| 0x26 | REFERENCE | Reference value for interrupt generation |
| 0x27 | STATUS_REG | Acceleration data status |
| 0x07 | STATUS_REG_AUX | ADC data-ready and overrun flags |
| 0x1F | TEMP_CFG_REG | Temperature sensor and ADC enable |
| 0x3C | TIME_LATENCY | Click time latency |
| 0x3B | TIME_LIMIT | Click time limit |
| 0x3D | TIME_WINDOW | Click time window |
| 0x0F | WHO_AM_I | Device identification. Always reads 0x33. |
Get either as C
regforge gen ADXL345 --out ./src --driver --tests
regforge gen LIS3DH --out ./src --driver --tests