Hello, Margaret!
I hope you can help me. You gave me sensor adapter for MPL3115 and it works perfectly. But I have some questions. In example project for MPL3115 we have next settings:
mpl3115AppState.CfgBuffer.ctrlReg.reg = STATE_STOPPED_UNSUBSCRIBED;
mpl3115AppState.CfgBuffer.settings.nSettingsToUse = SM_GIVEN_SETTINGS;;
mpl3115AppState.CfgBuffer.settings.nFifoDepth = 1;
mpl3115AppState.CfgBuffer.settings.nCurrentReportRate = FSL_MPL3115_PRESS_1HZ;
I try to read it and I have next datas:
Miliseconds Pressure Alt Temperature
[00012210] Altimeter: 100195 94.8 22.7
[00013211] Altimeter: 100250 89.13 22.11
[00014213] Altimeter: 100212 93.1 22.8
[00015213] Altimeter: 100218 92.9 22.9
[00016208] Altimeter: 100209 93.5 22.9
[00017208] Altimeter: 100178 95.15 22.6
[00018209] Altimeter: 100215 92.13 22.9
[00019210] Altimeter: 100211 93.2 22.8
[00020211] Altimeter: 100200 94.1 22.9
As you can see I have different pressure and altitude every second from 89.13 to 94.8 meters.
Next day I try to read it and I have datas:
Miliseconds Pressure Alt Temperature
[00038198] Altimeter: 100082 103.15 25.12
[00039198] Altimeter: 100124 100.7 25.14
[00040198] Altimeter: 100038 107.10 25.9
[00041200] Altimeter: 100076 104.8 25.11
[00042200] Altimeter: 100037 107.12 25.8
[00043198] Altimeter: 100015 109.9 25.8
[00044198] Altimeter: 100052 106.7 25.10
[00045198] Altimeter: 100068 105.2 25.11
So IN THE SAME PLACE I have different datas of pressure and altitude: 89.13 to 94.8 meters - first day, 100.7 to 109.9 meters - second day. But the real altitude is something about 60 meters. It is 30-45 meters less than I can read from MPL3115!!!
Here are my questions:
1. Can I change nCurrentReportRate from 1Hz to 10Hz for example? How to do it?
2. In the file fsl_mpl3115_i2c_1D_press_config_types.h I can see the stucture with settings:
uint8 oversampleRatio; //Oversample Ratio = 2^OS (e.g., 0 = 1, 1 = 2, 2 = 4, ... 7=128).
uint8 rawMode; //0 = Normal output; 1 = Raw data with no post ADC processing.
uint8 altBaroMode; //0 = Barometer mode; 1 = Altimeter mode.
uint8 autoAcqTimeStep; //Auto acquisition time step = 2^ST (range of 1 second to 9.1 hours).
uint8 alarmSelect; //0 = Use absolute pressure-temperature targets; 1 = Use pressure-temperature windows and thresholds.
What does it mean? Can I use it to make datas more stable?
3. How to make datas more stable? Should I use my own low pass filter?