cancel
Showing results for 
Search instead for 
Did you mean: 

I am using the ISM330 for measuring Acceleration and Gyro data. Both are set to ODR=416Hz. The FIFO is used in Continues Mode with an ODR=416Hz. The Problem is, that sometimes the data in the FIFO seems to be shifted.

CSchu.2079
Associate

Is there a Problem when the Sensor is sampling and doing a i2c communication(reading the FIFO) in parallel?

I saw that, that the FIFO gets shifted(or data is overwritten) a few times during collecting data.

Can someone help me please?

Best Regards,

Christof

5 REPLIES 5
Eleon BORLINI
ST Employee

Hi @CSchu.2079​ , what do you mean with "FIFO shifted"? That if you acquire the data with the FIFO or directly from the output you experiences a time-shift of the data itself? Please check first of all that the IF_INC and BDU bits of the CTRL3_C register must be equal to 1 (please check p.84 and sgg of AN5125), to enable automatic register index increment and block data update.

Follow these steps for Continuous mode configuration (if the accelerometer/gyroscope data-ready is used as the FIFO trigger):

1. Choose the decimation factor for each sensor through the decimation bits in the FIFO_CTRL3 and FIFO_CTRL4 registers (see Section 8.3 Setting the FIFO trigger, FIFO ODR and decimation factors for details);

2. Choose the FIFO ODR through the ODR_FIFO_[3:0] bits in the FIFO_CTRL5 register;

3. Set the FIFO_MODE_[2:0] bits in the FIFO_CTRL5 register to 110b to enable FIFO Continuous mode. When this mode is selected, the FIFO collects data continuously. The FIFO_STATUS1 and FIFO_STATUS2 registers are updated according to the number of samples stored. When the next stored set of data will make the FIFO full, the FIFO_FULL_SMART bit of the FIFO_STATUS2 register is set to 1. The OVER_RUN bit in the FIFO_STATUS2 register indicates when at least one sample has been overwritten to store the new data.

Regards

CSchu.2079
Associate

Hey,

Thanks for the quick answer.

Yes, I have this options in my configuration.

I can see in my data, that some Axes are shifted. So, the z-axis gets the y-axis and the x-axis get the z-axis. The Problem ist, that it does not come every read from the FIFO. It is really random when the shift appears in the data.

In the Project, i use the ISM330 with FIFO (Continues Mode) and a FIFO Threshold Interrupt, to read everytime exactly 21 Samples. After the read from the FIFO, the FIFO Pattern shows, that the next Byte is from a different axis than i expect and that happen to me everytime on the last Sample (burst read -> after that, FIFO pattern is different than expected).

I tested this with a Sample rate = 208Hz and here the problem does not appear.

Could it be, that there is a BUG in the Chip when I read from the FIFO (more than 128 Bytes for example)?

Regards,

Christof

NJong.1
Associate II

Did you already solved this problem? I have the same problem.

I will include a picture to to clarify the issue.

The 3 measurements at the top are the g-values (accelerometer) measured on the x, y and z axis. These are also indicated. 

The bottom measurements are the measurements coming out of the buffer. 

This way you can see that the buffer does not store every axis in order

0693W000000WtglQAC.png. But everything is mixed up. Because of this, in this case the x and z value are stored a few times before the y axis is stored once.

Hi, did you try to set the BDU bit in CTRL3_C (12h) register to block the data update if the specific axis is not ready (this can occur in case of high ODR)? Btw, on Github repository you can find some C code examples on the FIFO usage on ASM330LHH device, which has some commonality with the ISM330DLC. Regards

NJong.1
Associate II

Yeah, I have set this one. But the BDU bit only concerns the FIFO readout and has no influence on the automatic storage of data.

Thank you for github link. I will check it.