IMU & Motion

STMicroelectronics LIS2DH12 in the datasheet corpus

Ultra-low-power 3-axis MEMS accelerometer with 32-level FIFO and tap/free-fall interrupts.

standing: provisionalI2C / SPII2C 0x18/0x19; SPI Mode 0/3
VendorSTMicroelectronicsIMU & Motion
InterfaceI2C / SPII2C 0x18/0x19; SPI Mode 0/3
Record StatusCatalog profileDatasheet / behavioral twin

Driver oracle & capability record

Used on BBC micro:bit v2 Zephyr builds in the CircuitTwin confidence registry and indexed in the datasheet corpus.

Driver referenceZephyr lis2dh driver / ST lis2dh12-pid
Evidence standingprovisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples).
Published recordGenerate or inspect locally via ct twin generate (see /docs/twin-generation).

Key registers & reset values

Address / FieldRegisterReset / ExpectedPurpose
0x0FWHO_AM_I0x33Fixed ST accelerometer chip ID
0x20CTRL_REG10x07ODR [7:4], LPen and X/Y/Z axis enables
0x23CTRL_REG40x00BDU, full-scale (2g..16g) and HR mode
0x28-0x2DOUT_X_L..OUT_Z_HLeft-justifiedX, Y, Z acceleration words (MSB=1 auto-inc on I2C)

Attach with ct CLI

Shell - run firmware with LIS2DH12
# Run compiled firmware with LIS2DH12 attached on microbit-v2
ct run --json --board microbit-v2 --device lis2dh12 build/app.elf

# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/lis2dh12.xml tests/lis2dh12-fault.suite.yaml

Fault-injection test snippet (suite.yaml)

tests/lis2dh12-fault.suite.yaml
version: 1
board: microbit-v2
firmware: build/app.elf
tests:
  - name: lis2dh12-i2c-nack-recovery
    faults:
      - at_ms: 30
        bus: I2C1
        kind: nack
        address: 0x19
        count: 2
      - at_ms: 140
        part: lis2dh12
        kind: register_override
        register: 0x0F
        value: 0xFF
    expect:
      console_contains: "DRIVER_FAULT_HANDLED"
      exit_code: 0

Compatible board twins

More in IMU & Motion