Increasing FXOS8700 sample rate from 200Hz to 400Hz

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Increasing FXOS8700 sample rate from 200Hz to 400Hz

1,273 Views
michaelestanley
NXP Employee
NXP Employee

If you desire to increase the sensor sampling rate in the V5.00 library from 200Hz to 400Hz, a change is required to the FXOS8700_Init() function in drivers.h.

You will need to modify the 2nd write to FXOS8700_CTRL_REG1 from a value of 0x0D to 0x05.  The changes the output data rate as per Table 33 in the data sheet.

The FXAS2100X_ReadData function (used to initialize the FXAS21002 gyroscope) DOES have the code necessary to bump the rate to 400Hz once you change

the value of SENSORFS to 400 at the bottom of build.h.

 

An important caveat is to not exceed the MIPS rating of whichever MCU you are using.  Cortex-M4F devices will obviously be able to run at higher sampling/fusion rates than those based on Cortex-M0+.  To test this post, I successfully ran at 400Hz sampling / 100Hz fusion rate using the V5.00 library.
Mike

Labels (1)
7 Replies

708 Views
zmays
Contributor II

If I wanted to increase the fusion rate from 25 Hz, would I simply change the value in the build.h file and reflash the board? I have very little experience with this and would simply like to increase the frequency at which the board outputs data.

0 Kudos

708 Views
michaelestanley
NXP Employee
NXP Employee

yes, that should do it.

0 Kudos

708 Views
zmays
Contributor II

I wasn't able to get the sampling rate to change. Do you have any ideas on what I could check to verify that I've edited the right thing? This is the only line I edited.

// sampling rate and kalman filter timing

#define SENSORFS          50                                  // int32: 50Hz: frequency (Hz) of sensor sampling process

Thank you so much fr your help.

0 Kudos

708 Views
michaelestanley
NXP Employee
NXP Employee

Apologies, I did not read your prior question closely enough.  The default builds for V5.00 are 200Hz sensor sampling rate and 25Hz fusion rate (which is SENSORFS/OVERSAMPLE_RATIO).  HOWEVER, due to bandwidth limitations, we've limited how many update packets are sent to the GUI over the UART.  You will see this throttle coded in function name UserMediumFrequencyTaskRun() at the bottom of user_tasks.c.  Packet updates run at the fusion rate up to a maximum 40Hz.  You could run faster updates if you cut back what data you are sending in function CreateAndSendPacketsViaUART(), but then you are moving far beyond a simple 1 line change in a header file.

Mike

708 Views
zmays
Contributor II

Oh okay. That's good to know. Thank you

0 Kudos

708 Views
a8Chcx
Contributor V

Hi Mike,

What is the benefit to increase the speed? Just fast updating???

Thanks,

Christie

0 Kudos

708 Views
michaelestanley
NXP Employee
NXP Employee

You would increase sensor sampling and fusion rates if you needed higher bandwidth response.  In general, for any given application, you want to keep them as low as possible to minimize power consumption.

0 Kudos