Skip to main content
Explorer
January 22, 2024
Solved

IIS3DWB Question about Reading Multiple Data from FIFO

  • January 22, 2024
  • 2 replies
  • 1895 views

I am using the IIS3DWB sensor and have a question about reading data from the FIFO.

Currently, I use the following function to retrieve one set of x, y, z values at a time:

int32_t iis3dwb_fifo_out_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
{
int32_t ret;
ret = iis3dwb_read_reg(ctx, IIS3DWB_FIFO_DATA_OUT_X_L, buff, 6);
return ret;
}

If I want to retrieve 1024 sets of data at once, can I modify it like this:

ret = iis3dwb_read_reg(ctx, IIS3DWB_FIFO_DATA_OUT_X_L, buff, 1024 * 6);

Will this allow the SPI to fetch all 1024 sets of data in a single cycle?

Additionally, I am using the sensor's FIFO feature with an ODR set to ODR/10, resulting in approximately a 2.6 kHz data FIFO buffer rate. I am interested in reading the buffer data at once when the COUNTER_BDR_IA flag is enabled.

 

    This topic has been closed for replies.
    Best answer by Federica Bossi

    Hi @HKim.23 ,

    You can retrieve 1024 sets of data at once, please refer to our drivers on github to develop this correctly using the multiread function: 

    FedericaBossi_0-1705930588230.png

     

    Yes, you can read the buffer data at once when the COUNTER_BDR_IA flag is enabled.

    2 replies

    Technical Moderator
    January 22, 2024

    Hi @HKim.23 ,

    You can retrieve 1024 sets of data at once, please refer to our drivers on github to develop this correctly using the multiread function: 

    FedericaBossi_0-1705930588230.png

     

    Yes, you can read the buffer data at once when the COUNTER_BDR_IA flag is enabled.

    HKim.23Author
    Explorer
    January 23, 2024

    Thanks, Federica.

    I will try it.