Hi I am using MMA8451Q accelerometer and its library in PE with code warrior. using MMA1_GetX(); function I am extracting accelerometer's value, so for 1g I am getting 16383 and for -1g I am getting -16383 whereas in the self calibration application note ie AN4069 I found the following information
So according to this 1g value should be 8192 and for -1g value should around -8192 and while extracting raw data from the function, I am getting values from 0 to 65,536 which I suppose it should be around 0 to 16384 . Please help me to understand how this is happening ? and also my values are fluctuating abruptly at same place i.e the reading is varying around +/-100 values when placed on a still surface. I changed the mode from 2g to 4g and 8g but the results were same, I also used inbuilt noise cancellation feature but that also didn't help.
When I went to the code of the library, I found for raw x data the following code
In this code the buffer values are being shifted and hence we are getting 14 bit data so I was wandering how it is happening? So I wanted to know how these bits are being shifted to take a form of 14 bits? May be instead of leaving 2 MSB we are filling that MSB and keeping 2 LSB as floating? Due to the huge fluctuation in the values I think this may be the reason. but I dont know actually how it is happening so I am not sure of it so please correct me where I am wrong. and how to stablise the accelerometer values?
Thanks and regards