I. Introduction to Functional Parameters
Bosch Sensortec's latest BMI160 inertial measurement unit integrates the most advanced 16-bit 3-axis ultra-low-G and ultra-low-power 3-axis gyroscopes into a single package. The MI160 is available in a 14-pin LGA package with a size of 2.5x3.0x0.8mm3. When the accelerometer and gyroscope operate in full-speed mode, the power consumption is typically as low as 950µa, which is only 50% or less of the power consumption of similar products on the market.
The BMI160 sensor's i²c device address is 0x68 (when the sd0 foot is grounded)/0x69 (when the SDO foot is pulled high).
Two. Important Registers
1. Chip ID----r0:chipid Register with a value of 0xd1
2. R0x03:pmu_status---BMI160 current operating mode/status register
3. Acceleration Accelerometer field data
X-axis 16bit acceleration data
R0X12:ACCD_X_LSB acc_x_lsb[7:0] Bit0--bit7
R0X13:ACCD_X_MSB Acc_x_msb[15:8] Bit0--bit7
Y-Axis 16bit acceleration data
R0X14:ACCD_Y_LSB acc_y_lsb[7:0] Bit0--bit7
R0X15:ACCD_Y_MSB Acc_y_msb[15:8] Bit0--bit7
Z-axis 16bit acceleration data
R0X16:ACCD_Z_LSB acc_z_lsb[7:0] Bit0--bit7
R0X17:ACCD_Z_MSB Acc_z_msb[15:8] Bit0--bit7
4. Gyroscope angular velocity data gyroscope field
X-axis angular velocity data (lsb/°/s)
R0X0C:GYR_X_LSB[7:0] Bit0--bit7
R0x0d:gyr_x_msb[15:8] Bit0--bit7
Y-axis angular velocity data (lsb/°/s)
R0X0E:GYR_Y_LSB[7:0] Bit0--bit7
R0x0f:gyr_y_msb[15:8] Bit0--bit7
Z-axis angular velocity data (lsb/°/s)
R0X10:GYR_Z_LSB[7:0] Bit0--bit7
R0x11:gyr_z_msb[15:8] Bit0--bit7
5. Acceleration Metric Configuration Register R0x41:acc_range
0B0011:+-2G range;0b0101+-4g;0b1000:+-8g;0b1100:+-16g
6. Control Register r0x7e
0x11:set PMU mode of accelerometer to normal
0x15:set PMU mode of gyroscope to normal
7. Recommended acceleration and Gyroscope modules use the system default reference configuration
0x41----0x03 Acceleration Measurement range ±2g
0x40----0x28
0x42----0x28
0x43----0x00 angular velocity ±2000°/s
Three. Reference code
1.3-axis Acceleration Data read the Reference code:
I2c_write_byte (0x7e,0x11);
delayms (100);
x = (I2c_read_byte (0x12) &0xff);
x = x| ((I2c_read_byte (0x13) &0xff) <<8);
if (X>0X7FFF)
{
x =-(0xffff-x);
}
x = (x*9.8)/(0X8000/2);//the acceleration conversion formula converted to G/S when the equivalent path is ±2g
y = (I2c_read_byte (0x14) &0xff);
y = y| ((I2c_read_byte (0x15) &0xff) <<8);
if (Y>0X7FFF)
{
y =-(0xffff-y);
}
y = (y*9.8)/(0X8000/2);//the acceleration conversion formula converted to G/S when the equivalent path is ±2g
z = (i2c_read_byte (0x16) &0xff);
z = z| ((I2c_read_byte (0x17) &0xff) <<8);
if (Z>0X7FFF)
{
z =-(0xffff-z);
}
z = (z*9.8)/(0X8000/2);//the acceleration conversion formula converted to G/S when the equivalent path is ±2g
2.3-axis Gyroscope data reading reference code:
I2c_write_byte (0x7e,0x15);
delayms (100);
x = (I2c_read_byte (0x0c) &0xff);
x = x| ((I2c_read_byte (0x0d) &0xff) <<8);
if (X>0X7FFF)
{
x =-(0xffff-x);
}
Formula to convert to angular velocity °/s when x = (x*2000)/0x7fff;//range is 2000dps
y = (I2c_read_byte (0x0e) &0xff);
y = y| ((I2c_read_byte (0x0f) &0xff) <<8);
if (Y>0X7FFF)
{
y =-(0xffff-y);
}
y = (y*2000)/0x7fff;//range is 2000dps, the formula converted to angular velocity °/s
z = (i2c_read_byte (0x10) &0xff);
z = z| ((I2c_read_byte (0x11) &0xff) <<8);
if (Z>0X7FFF)
{
z =-(0xffff-z);
}
z = (z*2000)/0x7fff; Formula converted to angular velocity °/s when range is 2000dps
Four. Commissioning Precautions
1. By default, the bmi160 enters suspend mode, at which time the bmi160 acceleration and gyroscope functions are in the non-working state. The r0x7e register is required to allow acceleration and gyroscope functions to enter normal operation (data sampling) mode.
By default bmi160 Accel and gyro be in suspend mode after powering up the device.the device was powering up in less than 1 0ms.
2. Perform the I2c_write_byte (0x7e,0x11) before each acceleration data test, so that the acceleration module enters normal mode of operation;
3. Perform i2c_write_byte (0x7e,0x15) to make the Gyroscope module enter normal mode before each gyroscope data detection.