Systematized information about the accelerometer to add to the header. Here's what happened:
The tablets Elf II, Aurora II installed accelerometer Bosch BMA250. Full information on this sensor can be found here:
Bosch BMA250 datasheet
The same sensor is installed in some other devices, in particular, Samsun Galaxy Nexus.
Information about the state of the sensor can be obtained through the registers using the I2C protocol. These registers can be used to control the operation of the sensor, in particular, it can be calibrated.
In order to get information from the registers, I wrote an application. This application allows you to read or change the value of registers, calibrate the sensor, try to solve some problems. Also, to analyze the state of the sensor, you can use the Accelerometer Log program, free from Google Play: Accelerometer Log
Some users are having problems with the sensor. Below I will describe the possible state of the sensor and methods for solving some problems. To demonstrate, I'll give the screenshots and register values. Screenshots do this: hold the tablet vertically, in portrait mode, run Accelerometer Log with default settings. Hold plate 5 seconds, rotated 90 degrees clockwise. Hold for 5 seconds, turn again clockwise by 90 degrees. So I do as long as the tablet does not return to its original position. I make a screenshot (press simultaneously vol- + power button). So we can analyze the X and Y axis, in most cases this is enough. For the analysis of the Z-axis - to put the plate on the table, wait 5 seconds, put the vertical, wait, put down on a table, wait, put vertically screen by himself, wait, put on the table to take a screenshot.
The sensor has a register 0x00 in which the Chip ID value is stored, according to the datasheet its value for our sensor should be 0x03, but as it turned out, not always. I will bind the states of the sensor to the value of this register.
Spoiler (+/-) (1. Register value 0x03)
The value as in datasheet is 0x03. Unfortunately, in my Aurora there is a sensor with a problem, so I will show a screenshot and registers with the Samsung Galaxy Nexus.
--- 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: 03 32 c0 3b 00 03 80 f7 07 00 00 00 00 00 00 03
10: 08 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 05 00 09 30 81 0f c0 00 14 00 04 0a 18 08 08 10
30: 00 00 70 04 00 00 10 00 00 00 00 00 00 00 00 00
Reduced by 69%
720 x 1280 (39.85 KB)
In the register 0x00, the value is 0x03 and there are no problems with the sensor.
Spoiler (+/-) (2. Register value 0xf9)
I have a tablet Aurora II. When the tablet came, it worked fine, there were no problems, but after a while the auto-rotate of the screen stopped working. Moreover, in the Camera application - the icons are rotated as needed. I read the forum slatedroid (
http://www.slatedroid.com/topic/37448-solved-accelerometer-works-fine-but-screen-doesnt-rotate/LexaR user there it is me) and found users with the same problem.
--- 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: f9 10 00 f8 c0 8c 80 07 1d 00 00 00 00 ff 81 00
10: 0c 80 00 00 00 ff 00 00 00 00 00 00 ff ff 00 ff
20: 05 00 09 30 81 0f c0 00 14 14 04 0a 18 48 08 11
30:00 ff 00 f4 00 00 00 00 00 00 00 00 00 ff 00 00
It is visible that in the register 0x00 value 0xf9, and there has to be 0x03
In Accelerometer log it looks like this:
Reduced by 61%
600 x 1024 (27.84 KB)
And then evident that, if the sensor value is normal axis varies + -g (plate when at rest), in the case of the "problematic" tablet - + -2g. After some experimentation, I found a solution. In case the sensor is 0x0f - therethrough defined measuring range. By default, there is value 0x03, which corresponds to + -2g. Value 0x00 also corresponds to the range + -2g. If in this case enter the value 0x05 (which corresponds to a range of + -4g), then on the "problem" tablet, everything comes back to normal, and starts auto-rotation. Here srinshot, when the register value is 0x05 0x0f:
Reduced by 61%
600 x 1024 (25.71 KB)
So, there is another version of the problem - when "sticks" axis. Those. on one of the axis of no change in value at all. If you look at the registers, the values ​​of the axes is shown in the registers 0x02-0x07. In the case of "sticking" axis we tablet at while rotating in one of the registers of all currently seeing value 0x00 or 0xff. You can try several times to make a soft reset of the tablet, recalibrate, reset the calibration. If this does not help - it will probably only the replacement of the sensor. You can read here: Ainol NOVO 7 Aurora II / Elf II - Talk, Ainol NOVO 7 Aurora II / Elf II - Discussion
Spoiler (+/-) (3. Register value 0xfa)
Treatment 0xfa here: Ainol NOVO 7 Aurora II / Elf II - Firmware (OS 4.0) (Post # 16866615)
There is another option in which the tablet does not see the sensor at all, but it exists and works. Here is an example of the register value:
--- 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: fa 10 31 69 21 88 01 80 00 00 00 00 00 ff 81 05
10: 0f 00 00 00 00 ff 00 00 00 00 00 00 ff ff 00 ff
20: 05 00 09 30 81 0f c0 00 14 14 04 0a 18 48 08 11
30:00 ff 00 c4 00 00 10 00 00 00 00 00 ff 00 b5
In this case, in register 0x00, the value is 0xfa. Why the system does not see the sensor? Let's look at the source. There is such a file: /common/customer/drivers/misc/bma250.c
Here is a piece of it:
Code
// line 48
#define BMA250_CHIP_ID 3
#define BMA250E_CHIP_ID 249
//...
// line 3524
if (tempvalue == BMA250_CHIP_ID || tempvalue == BMA250E_CHIP_ID) {
249 in decimal notation is 0xf9 in hexadecimal. It can be seen that for the option when ChipID == 0xf9 added a condition, if you add a condition to this line that ChipID == 250, the tablet will see the sensor. Unfortunately, I do not know how to compile the driver, so I can not fix it myself.
Spoiler (+/-) (4. About sensor calibration)
Now for the calibration problem. Some users have complained that the games "car leads to the side" and that exactly was going have to hold the tablet slightly rotated. Well, a similar situation. It comes from the fact that the sensor is not calibrated. See, for example, in my second screenshot in claim 2. There it is seen that when the plate is vertically, X and Y are offset from the axis 0, and Z also. in our sensor is built to calibrate it. Responsible for it registers 0x36, 0x37, 0x38-0x3d. Who cares - in the datasheet there is a lot of detail is painted. Who are not interested - I've done in the program to calibrate the sensor. Here is the Accelerometer Log after calibration:
Reduced by 61%
600 x 1024 (27.55 KB)
Here you can see that the X and Y axes are equal to 0 when the tablet is vertical.
To solve some problems, I wrote a program (I need root to function): BMA + Calibration.apk (199.05 KB) Downloads: 127
For solutions:
Spoiler (+/-) (1. If you have a problem with auto-rotate)
then click "Fix Auto Rotate". Mark the "Fix Startup". If after a while the auto-rotate again stops working (I have a long sleep sensor values ​​are reset and auto-rotation stops working), then mark also select "Fix every time you turn on the screen." On slatedroid was 2 cases, when after a while auto-rotation "corrected" and starts working by itself, without the program. Why is this happening - I do not know. But apparently somehow sensor goes out of its emergency operation.
Spoiler (+/-) (2. Calibration)
Click the "Sensor Calibration" button. Polhode tablet on a flat surface such as a floor or window sill and click "Calibrate the X and Y axis." Thereafter, postavte plate vertically, at 90 degrees. You can use square, book, magazine, to fine-tune the vertical and can be "by eye". After that, click the "Calibrate the axis Z". All. The sensor is calibrated. Try to see it Accelerometer Log graphics. If you want to reset the calibration to the original - for this purpose it has a button on the main screen: "Reset calibration". The program for calibrating the sensor 0 may be calibrated sensor + -g for each axis can generally define calibration parameters manually, but it is in manual mode and datasheet. If you really are interested - write me to tell.
Spoiler (+/-) (3. Soft Reset)
reset the sensor to its original state. Calibration parameters are not reset, they must be reset separately.
4. To view the change of registers, there is an item in the “Values ​​of registers” MENU.
5. If it still doesn’t work or if you want more details - write to me in a personal or email (available in the program), and at the same time attach screenshots from Accelerometer Log using the method I described, the value of registers and a detailed description of the problem. I will try to help.
6. How to check the sensor without installing programs. Only performance when auto-rotate: working or not, you can still run the “Camera” - when you rotate the tablet 90 degrees - the icons should turn. But then how lucky, because Almost everyone, initially the tablet worked fine, the problem arose after a while.
7. Well and disclaimer: you use the program at your own peril and risk, I do not bear any responsibility for the results of its work.
The variable ro.sf.gsensorposition from build.prop is responsible for comparing the sensor readings with reference to the axes. Those. the sensor has readings on the x, y and z axes. But the sensor in different tablets can be soldered as you like: the axis corresponds, rotated by 180 degrees, 90, soldered on the back side of the board - and to bind the sensor axes to the axes of the tablet this variable serves. Variable values ​​can vary from 0 to 7. In our tablets, the default value is 2. Here is a description of the possible values:
0: xn = xd, yn = yd, zn = zd
1: yn = xd, xn = -yd, zn = zd
2: xn = -xd, yn = -yd, zn = zd
3: yn = -xd, xn = yd, zn = zd
4: xn = -xd, yn = yd, zn = -zd
5: yn = -xd, xn = -yd, zn = -zd
6: xn = xd, yn = -yd, zn = -zd
7: yn = xd, xn = yd, zn = -zd
Where:
xp - tablet acceleration relative to the x axis;
xd is the sensor acceleration relative to the x axis;