Skip to main content
Visitor II
July 2, 2019
Question

How to change steval-mki109v3 with lsm6dso unico into magnetometer mode

  • July 2, 2019
  • 1 reply
  • 597 views

I checked the video posted. And I can use most functions of the video said. While I can't find the way to change the mode into magnetometer. In video, it just directly changed to that mode and didn't mention the method.

    This topic has been closed for replies.

    1 reply

    ST Employee
    July 3, 2019

    ​Hi @Sunny.Q​ , are you referring to the possibility for the LSM6DSO to work as sensor hub for an external magnetometer such as LIS2MDL, right? Did you check the paragraph 7.4 of the AN5192 (Sensor hub mode example)? After having physically connected the two sensors, you have to follow this procedure:

    Write 40h to CTRL1_XL // Turn on the accelerometer (for trigger signal) at 104 Hz
    2. Perform one-shot read with
    SLV0_ADD = 3Dh
    SLV0_SUBADD = 4Fh
    // Check LIS2MDL WHO_AM_I register
    // LIS2MDL slave address is 3Ch and rw_0=1
    // WHO_AM_I register address is 4Fh
    3. Perform one-shot write with
    SLV0_ADD = 3Ch
    SLV0_SUBADD = 60h
    DATAWRITE_SLV0 = 8Ch
    // Write LIS2MDL register CFG_REG_A (60h) = 8Ch
    // LIS2MDL slave address is 3Ch and rw_0=0
    // Enable temperature compensation
    // Enable magnetometer at 100 Hz ODR in continuous mode
    4. Perform one-shot write with
    SLV0_ADD = 3Ch
    SLV0_SUBADD = 61h
    DATAWRITE_SLV0 = 02h
    // Write LIS2MDL register CFG_REG_B (61h) = 02h
    // LIS2MDL slave address is 3Ch and rw_0=0
    // Enable magnetometer offset-cancellation
    5. Perform one-shot write with
    SLV0_ADD = 3Ch
    SLV0_SUBADD = 62h
    DATAWRITE_SLV0 = 10h
    // Write LIS2MDL register CFG_REG_B (62h) = 10h
    // LIS2MDL slave address is 3Ch and rw_0=0
    // Enable magnetometer BDU
    6. Setup continuous read with
    SLV0_ADD = 3Dh
    SLV0_SUBADD = 68h
    SLAVE0_CONFIG = 06h
    // LIS2MDL slave address is 3Ch and rw_0=1
    // Magnetometer output registers start from 68h
    // Set up a continuous 6-byte read from I²C master interface

    Regards