Post Go back to editing

ADXL372 FIFO data error with long time reading

Hello,

I am using the adxl372 to measure the x,y,z acc data, the initialization is normal.

and i get the data through the FIFO, here comes the problem.

I set FIFO samples num as 480 (0xE0,160 samples for each axis),set the watermark interrupt, in the interrupt callback function,

I read the FIFO data through SPI.(read 157 samples each time)

Everything is fine in the begining, but a little moment later, the data goes wrong, and then three axes data begin to swap. 

As the picture shows below,

I don't know why this comes like this, the data swaps every time i read the fifo(157 samples).

Best regards.

Parents
  • I am experiencing the same problem for sampling rates above 3200 Hz, with and without EXT_CLK (<= 3200 Hz works perfectly fine). In short, the series start indicator moves from X axis to another one as shown on picture below. I check all STATUS register flags before read and I control that at least one sample set (6 bytes for XYZ) remains in a FIFO after read. I do 960 multi-byte read on watermark, FIFO_SAMPLES=0x01E3, so 160 XYZ concurrent samples are read all at once. The FIFO is in a stream mode, package marking code "372B 1904 3263" (space=new line).

    Did anyone found out what might be the cause?

  • I know this is an old thread, but I had a very similar problem when I first started working with XYZ data in the FIFO.  I don’t know if it is this exact problem described in this thread but it certainly looks like it to me.  In case it helps anyone, I’m posting my solution here.

    I configured the ADXL372 to stream at 6400Hz, set the watermark interrupt at 384 entries, started streaming and went to sleep waiting for the FIFO to fill.  After each watermark interrupt, I would read the STATUS, STATUS2 and FIFO_ENTRIES registers.  If everything was OK, I would then read FIFO_ENTRIES - 3 entries from the FIFO_DATA register to always leave a full sample set in the FIFO.  I used a fairly regular vibration input for testing, and I noticed that periodically the axes would obviously swap/rotate (e.g. X->Z, Y->X, Z->Y).  It turned out that when the swap occurred it would happen near a FIFO read boundary and usually several in a row if not every single one; (e.g. it happened about every 384 samples and if I reduced the watermark to 15 samples, the swap would occur in multiples of around 15 samples).  After a lot of experimenting and debugging, the solution I found that finally worked was to calculate FIFO_ENTRIES MOD 3 and then subtract three samples from that value as the number of samples to read from the FIFO_DATA.  This guaranteed that I would only read samples in multiples of three and never empty the FIFO.  The problem completely stopped occurring with this change.  I had previously been blindly using whatever was in the FIFO_ENTRIES register, which was sometimes not a multiple of three.

  • Thank you,  for sharing your experience with us, in this forum! 

     If you have a moment, can you share if  this correlates with what you have learned about the FIFO function, on this unit? 

Reply Children