Brief
The next content will be the basic functions of MPU9250 detailed introduction, mainly divided into modules for elaboration. Clock
MPU9250 has two internal clock sources, as well as a PLL.
Internal clock Source:
| Clock Source |
Description |
| Internal oscillator |
Low power consumption, but slightly worse clock accuracy |
| X,y or Z-direction gyro |
MEMS clock, high power consumption, but clock accuracy (as long as the gyro is enabled, it will use the clock source) |
Clock selection requires a balanced clock accuracy and power consumption of two factors, so from the MPU9250 performance parameters can be seen, once the gyro open, power is at the MA level, and the accelerometer and magnetometer are at the UA level of power consumption. I2C Interface
MPU9250 has two optional I2C interfaces, one to connect to an external Third-party sensor (I2C master), and another I2C interface that can be used to send motion data to external controllers (I2C slave method).
Of course, these two I2C interfaces are optional, and the I2C interface to the external third-party sensor is used only when the external sensor is connected (and has limited performance). The I2C interface used to send motion data is optional, because the SPI interface is reused, so only two is selected.
MPU9250 I2C Interface:
I2C interface for third-party sensors
This interface is used to connect to the external Third-party sensor, that is, if you feel that the MPU9250 9-axis sensor is not enough, you can also external third-party sensors, such as pressure sensors.
This additional I2C interface has two modes, I2C Master mode and pass-through mode.
Because of the performance limitations of the MPU9250, the I2C interface must be completed with the help of an external controller for the initialization of the external sensor. In MPU9250, there is a bypass multiplexer mechanism that can directly SDA the Bypass interface (I2C, AUX_DA) of the external sensor to the I2C interface (AUX_CL, SCL) that is attached to the external controller.
When the attached external sensor is initialized, MPU9250 will transfer it to the I2C interface of the external controller via the bypass multiplexer mechanism, and after the configuration is complete, MPU9250 will close bypass multiplexer, Take control of the external sensor and obtain data from the external sensor. I2C Slave to send motion data
Pin Physical Connection Requirements
SDA, SCL: Usual I2C These two pins are leaky, support bidirectional communication (that is, the data can be sent to the slave, or from the slave to master), but MPU9250 the two pins need to pull through the pull resistor up to the VDD, the highest speed of 400kHz.
I2C Communication Equipment Role Division
I2C communication is divided into master and slave roles, the master role can be placed on the I2C line slave address, the corresponding slave need to make an ACK to master.
MPU9250 's I2C address
MPU9250 's I2C slave address is b110100x, where x is determined by the level of the AD0 pin, which allows you to connect two I2C devices on the same MPU9250 bus. I2C Communication Protocol
start and stop conditions
data format and ACK
Communication
MPU9250 I2C Write
MPU9250 I2C Read
SPI Interface
MPU9250 has only one SPI interface (SPI Slave), four lines (CS, SDO, SCLK, SDI), two as the control line, two as the data line. MPU9250 as the SPI slave role.
CS line for film selection, for low when selected, for high when not selected.
SPI Functional Characteristics
1. Data transfer for MSB, LSB last
2. Data is locked up along the SCLK (latched)
3. Data in the SCLK descent along the sending
4. SCLK Maximum frequency of 1MHz
5. SPI read and write operations require 16 or more clock cycles (2 or 2 bytes or more). The first byte includes the SPI address, and the next bytes is SPI data. The first bit of the first byte is a read-write flag (Read-1, Write-0)
Supports multiple bytes of read and write.
SPI master and slave Connection diagram:
Self Test
The self-test is used to test the mechanical and electronic parts of the sensor, and the trigger of the self-test is activated by the corresponding self-test register.
When the self-test is activated, the sensor starts and produces an output signal, which is used to observe the self-test reply.
Self-Test back = Sensor with self-test output-sensor with self-test output
When the value of the self-test reply is within a reasonable range, the partial self-test passes. When the self-test reply is outside the reasonable range, it indicates that the partial self-test failed. Sensor Data Registers
| Data Categories |
function |
characteristic |
| Gyroscope/accelerometer/magnetometer/auxiliary-sensor/temperature |
Save the latest sensor data |
Read-only, can be read at any time via serial port (SPI or I2C) |
FIFO
| size |
Configure Registers |
Counter |
Read |
interrupted |
| 512bytes |
Select which data can be temporarily deposited in FIFO, optional gyro-data, accelerometer-data, temperature, Auxiliary-sensor-data, fsync-input |
Number of bytes in FIFO |
Serial port access (SPI or I2C) support burst read |
Can trigger interrupts |
interrupted
| Interrupt Function |
Detailed Description |
Break Status |
| Interrupt Configuration Registers |
|
Interrupt Status Register |
| int PIN Configuration |
Configure PIN break mode |
|
| Interrupt latching |
Configure the interrupt locking method |
|
| Interrupt Clearing |
Configure the Interrupt Cleanup method |
|
| Interrupt triggers |
(1) Clock Generator Locked To new reference oscillator (used when switching Clock); (2) The new data is available to being read (from the FIFO and data registers); (3) Accelerometer event interrupts; (4) The MPU-9250 did not receive a acknowledge from a auxiliary sensor on the secondary I2C |
|
int PIN Interrupt configuration
An int pin can be configured (enable/disable) with the following interrupt type:
The interrupt status flag allows you to see which type of interrupt occurred. Motion Detection (wake-on-motion) interrupted
By programming, a threshold threshold can be set beforehand so that a wake-on-motion interrupt occurs when the absolute value of the sample obtained by the action sample exceeds the threshold. The wake-on-motion configuration process is as follows:
Advanced hardware Features
Configuration and enabling hardware characteristics through hardware registers.
Advanced hardware features are turned off by default on initial power up and must be opened and configured separately.
| Hardware Features |
Description |
| Low power quaternion |
3-axis Gyro and 6-axis Gyro+accel |
| Android Orientation |
Android screen rotation algorithm low power implementation |
| Tap |
Tapping gesture Detection |
| Pedometer |
Count Step |
| Significant Motion detection |
Effective motion detection |