cancel
Showing results for 
Search instead for 
Did you mean: 

I got the MLC working on the lsm6dsox. But when i enable stepcount on FIFO my MLC stops working ? these are the 3 lines , is there anyway i can use MLC and stepcount? or will i have to make my own step count tree?

MJurk.1
Associate

/* Start Machine Learning Core configuration */

    for (uint32_t i = 0; i 

                              sizeof(ucf_line_t));

         i++)

    {

        lsm6dsox_write_reg(p_lsm6dsox, lsm6dsox_MLC[i].address,

                           (uint8_t *)&lsm6dsox_MLC[i].data, 1);

    }

    /*    Disable I3C interface   */

    lsm6dsox_i3c_disable_set(p_lsm6dsox, LSM6DSOX_I3C_DISABLE);

    /* Turn off Sensors */

    lsm6dsox_xl_data_rate_set(p_lsm6dsox, LSM6DSOX_XL_ODR_OFF);

    lsm6dsox_gy_data_rate_set(p_lsm6dsox, LSM6DSOX_GY_ODR_OFF);

    /*  Enable Block Data Update       */

    lsm6dsox_block_data_update_set(p_lsm6dsox, PROPERTY_ENABLE);

    //     /*

    //    * Set full scale

    //    */

    lsm6dsox_xl_full_scale_set(p_lsm6dsox, LSM6DSOX_4g);

    lsm6dsox_gy_full_scale_set(p_lsm6dsox, LSM6DSOX_2000dps);

    /*

   * Set FIFO watermark (number of unread sensor data TAG + 6 bytes

   * stored in FIFO) to 10 samples

   */

    lsm6dsox_fifo_watermark_set(p_lsm6dsox, 10);

    /*

       * Set FIFO batch XL/Gyro ODR to 12.5Hz

       */

    lsm6dsox_fifo_xl_batch_set(p_lsm6dsox, LSM6DSOX_XL_BATCHED_AT_26Hz);

    lsm6dsox_fifo_gy_batch_set(p_lsm6dsox, LSM6DSOX_XL_BATCHED_AT_26Hz);

    /*

       * Set FIFO mode to Stream mode (aka Continuous Mode)

    

       */

    lsm6dsox_fifo_mode_set(p_lsm6dsox, LSM6DSOX_STREAM_MODE);

 lsm6dsox_pin_int1_route_t int1_route;

    lsm6dsox_pin_int1_route_get(p_lsm6dsox, &int1_route);

    int1_route.int1_ctrl.int1_fifo_th = PROPERTY_ENABLE;

    lsm6dsox_pin_int1_route_set(p_lsm6dsox, &int1_route);

    /* Route signals on interrupt pin 1 */

    lsm6dsox_pin_int2_route_t pin_int2_route;

    lsm6dsox_pin_int2_route_get(p_lsm6dsox, &pin_int2_route);

    pin_int2_route.mlc_int2.int2_mlc1 = PROPERTY_ENABLE;

    lsm6dsox_pin_int2_route_set(p_lsm6dsox, &pin_int2_route);

    /* Configure interrupt pin mode notification */

    // lsm6dsox_int_notification_set(p_lsm6dsox, LSM6DSOX_BASE_PULSED_EMB_LATCHED);

    /* Set Output Data Rate.

   * Selected data rate have to be equal or greater with respect

   * with MLC data rate.

   */

    lsm6dsox_xl_data_rate_set(p_lsm6dsox, LSM6DSOX_XL_ODR_26Hz);

    lsm6dsox_gy_data_rate_set(p_lsm6dsox, LSM6DSOX_GY_ODR_26Hz);

    lsm6dsox_****_sens_set(p_lsm6dsox, LSM6DSOX_****_BASE_MODE);

    lsm6dsox_fifo_****_batch_set(p_lsm6dsox, PROPERTY_ENABLE);

    lsm6dsox_steps_reset(p_lsm6dsox);

1 ACCEPTED SOLUTION

Accepted Solutions
MJurk.1
Associate

you need to reset the mlc after writting registers to run off mlc

View solution in original post

3 REPLIES 3
AMALK.1
Associate

Hi,

I am having the same problem as you hare having. Did you solve it?

What i have done on my side, is loading the UCF file file,

From what i saw the the UCF file is actually overriding some of the gyro/acc output filter and changing the full scale. I have no idea if this is why the embedded functions and other non-mlc functionalities are not working properly.

I have not found clearly any indications in the code that could lead to this kind of limitations.

If anyone have clues why this happen?

Thank you

MJurk.1
Associate

you need to reset the mlc after writting registers to run off mlc

Hi @MJurk.1​ ,

great you come back to the Community after such a long time!

And glad you shared the solution to the issue.

-Eleon