2016-12-29 11:14 PM
Here's my configuration:
set(CTRL_REG1, 0x00);
set(CTRL_REG2, 0x80); set(CTRL_REG3, 0x00); set(FIFO_CTRL, 0x00); //Flush FIFO set(CTRL_REG1, 0x3A); //3A was 3E set(CTRL_REG2, 0x50); //50 set(CTRL_REG3, 0x00); set(FIFO_CTRL, 0x40);In my code, I wait 2 seconds and read 32 values from FIFO and average them.
Then I wait 1 second and read 16 values from FIFO and average them.
I do the above in a loop.
Pressure data looks find for about 33 seconds, and then, I get junk back.
If I restart my device (power down and back up again) it will work fine again, for about 33 seconds.
The problem is consistent. What is going wrong here?
To read a single pressure value, I just request 5 bytes from 0x28 and read them in. I use the first 3 to calculate pressure and discard the last 2 as they are temperature and not necessary for my application.
Any hints or advice would be greatly appreciated.
PS: This sensor is mounted on a custom board and I am using a TI MSP430G2553 to drive it.
Values are fine and then all of a sudden, they arent valid anymore. FifoStatus = 36 when this problem starts.
v1 = 63 v2 = 128 v3 = 54 pressure = 872.02
v1 = 44 v2 = 128 v3 = 54 pressure = 872.01 v1 = 67 v2 = 128 v3 = 54 pressure = 872.02 v1 = 157 v2 = 128 v3 = 54 pressure = 872.04 v1 = 76 v2 = 128 v3 = 54 pressure = 872.02 v1 = 113 v2 = 128 v3 = 54 pressure = 872.03 v1 = 130 v2 = 128 v3 = 54 pressure = 872.03 v1 = 114 v2 = 128 v3 = 54 pressure = 872.03 v1 = 107 v2 = 128 v3 = 54 pressure = 872.03 v1 = 128 v2 = 54 v3 = 84 pressure = 1347.41Error detected at: 32897 p1 = 128 p2 = 54 p3 = 84 Pressure = 1347.41 FifoStatus = 36#fifo #barometric-pressure-sensor #lps22hb