Skip to main content
Visitor II
August 14, 2024
Question

Reading SFLP Data from ism330bx

  • August 14, 2024
  • 1 reply
  • 773 views

I'm trying to extract the data Game Rotation Data from the ism330bx sensor. I'm just not quite sure, which setting to use for that. What I did so far:

Setting the sensor for an ODR of 480Hz with a range of 4000dps and 8g.

(ism330bx_reset(NULL))
(ism330bx_auto_inc(NULL)) // set auto increment register
(ism330bx_set_odr_g(NULL)) // 480Hz
(ism330bx_set_range_g(NULL)) // 8g
(ism330bx_set_odr_xl(NULL)) // 480Hz
(ism330bx_set_range_xl(NULL)) // 8g

 After that I can extract the sensor data from the registers 0x22 to 0x2D.

Now I'm trying to configure the SFLP function in the embedded functions:

 I2C_WRITE_PARAM writeParam = {
 .Address = ISM330BX_ADDRESS,
 .Data = 0b10000000, 	 
 .Register = FUNC_CFG_ACCESS
 }; 
 i2cWriteSuccess = i2c_write(&writeParam); // switches to embedded fuunctions

 writeParam.Register = EMB_FUNC_EN_A;
 writeParam.Data = 0b00000010;
 i2cWriteSuccess = i2c_write(&writeParam); // activation of SFLP

 writeParam.Register = SFLP_ODR;
 writeParam.Data = 0b01101011;
 i2cWriteSuccess = i2c_write(&writeParam); // ODR = 480Hz (for SFLP)

 writeParam.Register = EMB_FUNC_FIFO_EN_A;
 writeParam.Data = 0b00110010;
 i2cWriteSuccess = i2c_write(&writeParam); // FIFO Data (GameRotVector, GBIAS, Gravity)

 writeParam.Register = EMB_FUNC_INIT_A;
 writeParam.Data = 0b00000010;
 i2cWriteSuccess = i2c_write(&writeParam); // initialisation (für SFLP)

 writeParam.Register = EMB_FUNC_EN_A;
 writeParam.Data = 0b00000000;
 i2cWriteSuccess = i2c_write(&writeParam); // switches back from embedded functions

 From what I understand I have to read the SFLP data from the FIFO. However I'm not quite sure how to configure it.

1. Is there a setting (continous FIFO maybe?) to read the SFLP data easily like the sensor data? Which register do I have to use to read the FIFO and how do I know where my SFLP data is located.

2. Is there a mode to read automatically the last data stored. For example I want to do the fusion with a frequeny of 480 Hz, but I would read the data only at 5 to 10 Hz. So I would only be interested in the last calculation of the sensor fusion.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    August 30, 2024

    Hi @ritzmo93 ,

    Have you already tried to look at our examples on Github?

    Hope this helps.