AnsweredAssumed Answered

ADXL362 retrieved samples not equal to the ODR

Question asked by CyrilPz on May 31, 2016
Latest reply on Jun 3, 2016 by STallur

Hello everybody!

 

I am working on a project with an ADXL362. To retrieve the data, I decided to use the FIFO and every seconds I read the number of samples I have setted before with the Output Data Rate. You can see here the initialization of the peripheral:

 

     // reset the accelerometer
     Factory::acc.ADXL362_reset();
     // display the id of the accelerometer
     uint8_t device_id;
     Factory::acc.ADXL362_ReadReg(ADXL362_REG_DEVID_AD, &device_id);
     STC_DEBUG(("[STController] enable() > Device Id: %x", device_id));
     // set accelerometer frequency to 25Hz
     Factory::acc.ADXL362_setODR(ADXL362_ODR_25);
     _odr=25;
     // set accelerometer range to 4G
     Factory::acc.ADXL362_setMeasRange(ADXL362_MEAS_RANGE_4G);
     // set adxl to measurement at ultra low power
     Factory::acc.ADXL362_setLowNoiseMode(ADXL362_LOW_NOISE_ULTRA);
     // set FIFO mode to stream
     Factory::acc.ADXL362_setFIFOMode(ADXL362_FIFO_CTRL_MODE_STREAM);
     // Start measuring 
     Factory::acc.ADXL362_startMeasuring();

 

And here how I retrieve the data:

const uint8_t accDatalength = 2;
const uint8_t nbData = 3; //axis x y and z , add one if FIFO store also temperature data
uint16_t dataLength = samples * accDatalength * nbData;
uint8_t data [512];
if( !ADXL362_ReadFIFO(data,dataLength) )
return MEMS_ERROR;

 

My problem is: I have never the number of samples corresponding to the Data Output Rate

[STController] _meas() > -> FIFO samples = 72

AXIS_X : 38

AXIS_Y : 305

AXIS_Z : 3724

...

AXIS_X : 38

AXIS_Y : 305

AXIS_Z : 3724

AXIS_X : 38

AXIS_X : 38

AXIS_X : 38

SAMPLES retrived: 24

[STController] _meas() > -> FIFO samples = 69

All the test was made with an ODR of 25Hz but with an ODR of 50Hz it's worst we lost more than three samples

 

Do you have an idea where the problem come from?

 

Best Regards,

 

Cyril Praz

Outcomes