mpu6050和6000中文 - 图文

更新时间:2023-11-08 21:41:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

MPU-6000 and MPU-6050 Register Map and Descriptions

Revision 4.0

Purpose and Scope目的和范围

This document provides preliminary information regarding the register map and descriptions for the Motion Processing Units? MPU-6000? and MPU-6050?, collectively called the MPU-60X0? or MPU?.

本文档提供了初步的信息有关的寄存器映射和描述运动处理单元?微处理器- 6000?和微处理器- 6050?,统称为MPU-60X0?或微控制器?。

The MPU devices provide the world’s first integrated 6-axis motion processor solution that eliminates the package-level gyroscope and accelerometer cross-axis misalignment associated with discrete solutions. The devices combine a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die together with an onboard Digital Motion Processor? (DMP?) capable of processing complex 9-axis sensor fusion algorithms using the field-proven and proprietary MotionFusion? engine.

微机设备提供了世界上第一个集成六轴运动处理器解决方案,消除了包访问的陀螺仪和加速度计横轴失调与离散的解决方案。设备结合使用硬件陀螺仪和使用硬件加速器在同一硅片与机载数字移动处理器?(DMP?)能够处理复杂的9-axis传感器融合算法使用会和专有MotionFusion?引擎。

The MPU-6000 and MPU-6050’s integrated 9-axis MotionFusion algorithms access

external magnetometers or other sensors through an auxiliary master I2C bus, allowing the devices to gather a full set of sensor data without intervention from the system processor. The devices are offered in the same 4x4x0.9 mm QFN footprint and pinout as the current MPU-3000? family of integrated 3-axis gyroscopes, providing a simple upgrade path and facilitating placement on already space constrained circuit boards.

微控制器- 6000和微处理器- 6000的综合9-axis MotionFusion算法访问外部磁力检测装

置或其他传感器通过一个辅助主I2C总线,允许设备收集一套完整的传感器数据系统处理器不加干预。提供的设备在同一4 x4x0.9 mm QFN足迹和引出线与当前微处理器- 3000?家庭集成硬件陀螺仪,已经提供了一个简单的升级路径,便于放置空间受限的电路板。

precision tracking of both fast and slow motions, the MPU-60X0 features a user-programmable gyroscope full-scale range of ±250, ±500, ±1000, and ±2000°/sec (dps). The parts also have a user-programmable accelerometer full-scale range of ±2g, ±4g, ±8g, and ±16g.

精密跟踪的快速和慢速运动,MPU-60X0功能可编程陀螺仪全面范围的±250±500±1000和2000°±/秒(dps)。的部分也有一个用户可编程的加速度计全面范围±2 g, ±4 g, ±8 g和±16 g.

The MPU-6000 family is comprised of two parts, the MPU-6000 and MPU-6050. These parts are identical to each other with two exceptions. The MPU-6050 supports I2C communications at up to 400kHz and has a VLOGIC pin that defines its interface voltage levels; the MPU-6000 supports SPI at up to 20MHz in addition to I2C, and has a single supply pin, VDD, which is both the device’s logic reference supply and the analog supply for the part.

控制器- 6000家庭由两部分组成,单片机- 6000和微处理器- 6050。这些部件是相同的两个例外。微控制器- 6050支持I2C通信高达400千赫VLOGIC销,它定义了接口电压水平;微机- 6000支持SPI高达20 mhz除了I2C,和有一个供应销,VDD,供应设备的逻辑引用和模拟部分供应。

For more detailed information for the MPU-60X0 devices, please refer to the

“MPU-6000 and MPU-6050 Product Specification”.

MPU-60X0设备的详细信息,请参阅“微处理器- 6000和微处理器- 6050产品规格”。

VDD 供电电压为2.5V±5%、3.0V±5%、3.3V±5%;VDDIO 为1.8V± 5%,内建振荡器在工作温度范围内仅有±1%频率变化。可选外部时钟输入32.768kHz 或19.2MHz

Register Descriptions 寄存器描述

This section describes the function and contents of each register within the MPU-60X0. Note: The device will come up in sleep mode upon power-up.

本节描述MPU-60X0中的每个寄存器的功能和内容。注意:该设备会在睡眠模式在升高。

Description: 描述: These registers are used for gyroscope and accelerometer self-tests that permit the

user to test the mechanical and electrical portions of the gyroscope and the accelerometer. The following sections describe the self-test process.

这些寄存器用于陀螺仪和加速度计self-tests允许用户测试的机械和电气部分陀螺仪和加速度计。以下部分描述自测过程。

1. Gyroscope Hardware Self-Test: Relative Method陀螺仪硬件自检:相对的方法

Gyroscope self-test permits users to test the mechanical and electrical portions of the gyroscope. Code for operating self-test is included within the MotionApps? software provided by InvenSense. Please refer to the next section (Obtaining the Gyroscope Factory Trim (FT) Value) if not using MotionApps software.

陀螺仪自测允许用户测试陀螺的机械和电气部分。内包含的代码操作自测MotionApps?InvenSense提供的软件。请参考下一节(获得陀螺仪工厂削减(英尺)值)如果不是使用MotionApps软件。

When self-test is activated, the on-board electronics will actuate the appropriate sensor.

This actuation will move the sensor’s proof masses over a distance equivalent to a pre-defined Coriolis force. This proof mass displacement results in a change in the sensor output, which is reflected in the output signal. The output signal is used to observe the self-test response.

当自测被激活时,车载电子将开动适当的传感器。这个动作将传感器的证据质量的距离相当于一个预定义的科里奥利力。兹证明质量位移导致传感器输出的变化,反映在输出信号。输出信号是用来观察自测的回应。

自测响应(STR)定义如下:

???????????????? ????????????????=

?????????????????? ???????????? ??????? ????????-???????? ????????????????????????????????? ???????????? ??????? ????????-???????? ????????????????

This self test-response is used to determine whether the part has passed or failed self-test by finding the change from factory trim of the self-test response as follows:

这个自我test-response用于确定是否已通过或失败部分自测通过寻找自测的变化从芯片削减响应如下:

This change from factory trim of the self-test response must be within the limits provided in the MPU-6000/MPU-6050 Product Specification document for the part to pass self-test. Otherwise, the part is deemed to have failed self-test.

这种变化从工厂削减的自测的响应中提供必须的范围内微处理器- 6000 /微处理器- 6050产品规范文档的一部分通过自测。否则,该部分是视为失败的自测。

Obtaining the Gyroscope Factory Trim (FT) Value获得陀螺仪工厂削减(英尺)的值

If InvenSense MotionApps software is not used, the procedure detailed below should be followed to obtain the Factory trim value of the self test response (FT) mentioned above. For the specific registers mentioned below, please refer to registers 13-15.

如果InvenSense MotionApps软件不使用,应遵循以下程序详细获取的工厂削减价值上面提到的自我测试响应(英尺)。下面提到的特殊功能寄存器,请参阅寄存器13 - 15。

The Factory trim value of the self test response (FT) is calculated as shown below. FT[Xg], FT[Yg], and FT[Zg] refer to the factory trim (FT) values for the gyroscope X, Y, and Z axes, respectively. XG_TEST is the decimal version of XG_TEST[4-0], YG_TEST is the decimal version of YG_TEST[4-0], and ZG_TEST is the decimal version of ZG_TEST[4-0].

自我测试的工厂削减价值响应(英尺)计算如下所示FT[Xg], FT[Yg], and FT[Zg] refer to the factory trim (FT) values for the gyroscope X, Y, and Z axes, respectively. XG_TEST is the decimal version of XG_TEST[4-0], YG_TEST is the decimal version of YG_TEST[4-0], and ZG_TEST is the decimal version of ZG_TEST[4-0].

2.Accelerometer Hardware Self-Test: Relative Method加速度计硬件自检:相对的方法

Accelerometer self-test permits users to test the mechanical and electrical portions of

the accelerometer. Code for operating self-test is included within the MotionApps software provided by InvenSense. Please refer to the next section (titled Obtaining the Accelerometer Factory Trim (FT) Value) if not using MotionApps software.

加速度计自测允许用户测试加速度计的机械和电气部分。内包含的代码操作自测

MotionApps InvenSense提供的软件。请参考下一节(标题为获得加速度计工厂削减(英尺)值)如果不是使用MotionApps软件。

When self-test is activated, the on-board electronics will actuate the appropriate sensor. This actuation simulates an external force. The actuated sensor, in turn, will

produce a corresponding output signal. The output signal is used to observe the self-test response.

当自测被激活时,车载电子将开动适当的传感器。这个驱动模拟外部力量。反过来,驱动传感器将产生相应的输出信号。输出信号是用来观察自测的回应。

This self test-response is used to determine whether the part has passed or failed self-test by finding the change from factory trim of the self-test response as follows:

这个自我test-response用于确定是否已通过或失败部分自测通过寻找自测的变化从工厂削减响应如下:

This change from factory trim of the self-test response must be within the limits

provided in the MPU-6000/MPU-6050 Product Specification document for the part to pass self-test. Otherwise, the part is deemed to have failed self-test.

这种变化从工厂削减的自测的响应中提供必须的范围内微处理器- 6000 /微处理器- 6050产品规范文档的一部分通过自测。否则,该部分是视为失败的自测。

Obtaining the Accelerometer Factory Trim (FT) Value

If InvenSense MotionApps software is not used, the procedure detailed below should be followed to obtain the Factory trim value of the self test response (FT) mentioned above. For the specific registers mentioned below, please refer to registers 13-16.

如果InvenSense MotionApps软件不使用,应遵循以下程序详细获取的工厂削减价值上面提到的自我测试响应(英尺)。下面提到的特殊功能寄存器,请参阅寄存器13 - 16。

The Factory trim value of the self test response (FT) is calculated as shown below. FT[Xa], FT[Ya], and FT[Za] refer to the factory trim (FT) values for the accelerometer X, Y, and Z axes, respectively. In the equations below, the factory trim values for the accel should be in decimal format, and they are determined by concatenating the upper

accelerometer self test bits (bits 4-2) with the lower accelerometer self test bits (bits 1-0).

Parameters: 参数:

XA_TEST 5-bit unsigned value. FT[Xa] is determined by using this value as explained above.

XG_TEST 5-bit unsigned value. FT[Xg] is determined by using this value as explained above.

YA_TEST 5-bit unsigned value. FT[Ya] is determined by using this value as explained above.

YG_TEST 5-bit unsigned value. FT[Yg] is determined by using this value as explained above.

ZA_TEST 5-bit unsigned value. FT[Za] is determined by using this value as explained above.

ZG_TEST 5-bit unsigned value. FT[Zg] is determined by using this value as explained above.

Register 25 – Sample Rate Divider SMPRT_DIV

This register specifies the divider from the gyroscope output rate used to generate the

Sample Rate for the MPU-60X0.

这个寄存器指定的分配器陀螺仪输出率用于生成MPU-60X0采样率。

The sensor register output, FIFO output, DMP sampling and Motion detection are all based on the Sample Rate.

传感器寄存器输出,输出FIFO、DMP抽样和运动检测都是基于采样率。

Note:The accelerometer output rate is 1kHz. This means that for a Sample Rate greater than 1kHz, the same accelerometer sample may be output to the FIFO, DMP, and sensor registers more than once.

注意:加速度计的输出率是1 khz。这意味着一个采样率大于1 khz,相同的加速度计样本可能输出FIFO,不止一次DMP和传感器寄存器。

1)SMPLRT_DIV 8位无符号值,通过该值将陀螺仪输出分频,得到采样频率

该寄存器指定陀螺仪输出率的分频,用来产生MPU-60X0的采样率。

传感器寄存器的输出、FIFO输出、DMP采样和运动检测的都是基于该采样率。 采样率的计算公式

采样率 = 陀螺仪的输出率 / (1 + SMPLRT_DIV)

当数字低通滤波器没有使能的时候,陀螺仪的输出平路等于8KHZ,反之等于1KHZ。

For a diagram of the gyroscope and accelerometer signal paths, see Section 8 of the MPU-6000/MPU-6050 Product Specification document.

图的陀螺仪和加速度计信号路径,见节8微控制器- 6000 /微处理器- 6050产品的规范文档。

Description:

This register configures the external Frame Synchronization (FSYNC) pin sampling and the Digital Low Pass Filter (DLPF) setting for both the gyroscopes and accelerometers.

这个寄存器配置外部帧同步(FSYNC)销采样和数字低通滤波器(DLPF)设置为陀螺仪和加速度计。

An external signal connected to the FSYNC pin can be sampled by configuring EXT_SYNC_SET.

一个外部信号连接到FSYNC销可以通过配置EXT_SYNC_SET取样。

Signal changes to the FSYNC pin are latched so that short strobes may be captured. The latched FSYNC signal will be sampled at the Sampling Rate, as defined in register 25. After sampling, the latch will reset to the current FSYNC signal state.

信号改变FSYNC销锁定,这样短的闪光灯可能被捕。锁定FSYNC信号采样的采样率,被定义在寄存器25。取样后,锁将重置为当前FSYNC信号状态

The sampled value will be reported in place of the least significant bit in a sensor data register determined by the value of EXT_SYNC_SET according to the following table. 采样值将被报道的最低有效位的传感器数据寄存器由EXT_SYNC_SET根据下表的价值。

Bit 7 and bit 6 are reserved.

Description: 描述:

This register is used to trigger gyroscope self-test and configure the gyroscopes’ full scale range. 这个寄存器用于触发陀螺仪自测和配置陀螺仪的满刻度范围。

Gyroscope self-test permits users to test the mechanical and electrical portions of the gyroscope. The self-test for each gyroscope axis can be activated by controlling the XG_ST, YG_ST, and ZG_ST bits of this register. Self-test for each axis may be performed independently or all at the same time.

陀螺仪自测允许用户测试陀螺的机械和电气部分。每个陀螺轴的自测可以激活通过控制XG_ST YG_ST,ZG_ST这个寄存器。自测为每个轴可能单独或同时执行。

When self-test is activated, the on-board electronics will actuate the appropriate

sensor. This actuation will move the sensor’s proof masses over a distance equivalent to a pre-defined Coriolis force. This proof mass displacement results in a change in the sensor output, which is reflected in the output signal. The output signal is used to observe the self-test response.

当自测被激活时,车载电子将开动适当的传感器。这个动作将传感器的证据质量的距离相当于一个预定义的科里奥利力。兹证明质量位移导致传感器输出的变化,反映在输出信号。输出信号是用来观察自测的回应。

The self-test limits for each gyroscope axis is provided in the electrical characteristics tables of the MPU-6000/MPU-6050 Product Specification document. When the value of the self-test response is within the min/max limits of the product specification, the part has passed self test. When the self-test response exceeds the min/max values specified in the document, the part is deemed to have failed self-test.

当自测限制提供了每个陀螺轴微控制器的电特性表- 6000 /微处理器- 6050产品规范文档。当自测的价值反应是在最小/最大范围内产品的规范,部分已通过自我测试。当自测响应超过最小/最大的值指定的文档中,该部分是视为失败的自测。

Description:

This register is used to trigger accelerometer self test and configure the accelerometer full scale range. This register also configures the Digital High Pass Filter (DHPF). 这个寄存器用于触发加速度计自检测试和配置加速度计满刻度范围。这个寄存器还配置数字高通滤波器(DHPF)。

Accelerometer self-test permits users to test the mechanical and electrical portions of the accelerometer. The self-test for each accelerometer axis can be activated by

controlling the XA_ST, YA_ST, and ZA_ST bits of this register. Self-test for each axis may be performed independently or all at the same time.

加速度计自测允许用户测试加速度计的机械和电气部分。每个加速度计轴的自测可以激活通过控制XA_ST YA_ST,ZA_ST这个寄存器。自测为每个轴可能单独或同时执行。

When self-test is activated, the on-board electronics will actuate the appropriate sensor. This actuation simulates an external force. The actuated sensor, in turn, will produce a corresponding output signal. The output signal is used to observe the self-test response

当自测被激活时,车载电子将开动适当的传感器。这个驱动模拟外部力量。反过来,驱动传感器将产生相应的输出信号。输出信号是用来观察自测的回应

The self-test limits for each accelerometer axis is provided in the electrical characteristics tables of the MPU-6000/MPU-6050 Product Specification document. When the value of the self-test response is within the min/max limits of the product specification, the part has passed self test. When the self-test response exceeds the min/max values specified in the document, the part is deemed to have failed self-test.

自测限制为每一个加速度计轴的电特性表中提供的微处理器- 6000 /微处理器- 6050产品规范文档。当自测的价值反应是在最小/最大范围内产品的规范,部分已通过自我测试。当自测响应超过最小/最大的值指定的文档中,该部分是视为失败的自测。

Description:

This register configures the detection threshold for Motion interrupt generation. The mg per LSB increment for MOT_THR can be found in the Electrical Specifications table of the MPU-6000/MPU-6050 Product Specification document.

这个寄存器配置运动中断检测阈值的一代。的mg LSB增量MOT_THR电气规格表中可以找到的微处理器- 6000 /微处理器- 6050产品规范文档。

Motion is detected when the absolute value of any of the accelerometer measurements exceeds this Motion detection threshold.

检测到运动时的加速度计测量的绝对值超过这个运动检测阈值。

The Motion interrupt will indicate the axis and polarity of detected motion in MOT_DETECT _STATUS (Register 97).

运动中断将会显示检测到运动的轴和极性MOT_DETECT _STATUS(寄存器97)

For more details on the Motion detection interrupt, see Section 8.3 of the

MPU-6000/MPU-6050 Product Specification document as well as Registers 56 and 58 of this document.

运动检测中断的更多细节,请参见第8.3节的微处理器- 6000 /微处理器- 6050产品规范文档以及寄存器56和寄存器58。

Description:

This register determines which sensor measurements are loaded into the FIFO buffer. 这个寄存器决定哪些传感器测量加载到FIFO缓冲区。

Data stored inside the sensor data registers (Registers 59 to 96) will be loaded into the FIFO buffer if a sensor’s respective FIFO_EN bit is set to 1 in this register.

数据存储在传感器数据寄存器(寄存器59 - 96)将加载到FIFO缓冲区如果传感器各自FIFO_EN咬在这个寄存器设置为1。

When a sensor’s FIFO_EN bit is enabled in this register, data from the sensor data registers will be loaded into the FIFO buffer. The sensors are sampled at the Sample Rate as defined in Register 25. For further information regarding sensor data registers, please refer to Registers 59 to 96

当一个传感器的FIFO_EN启用了一些在这个寄存器,数据从传感器数据寄存器将被加载到FIFO缓冲区。传感器在采样率采样中定义注册25。关于传感器数据寄存器的进一步信息,请参阅寄存器59 - 96

When an external Slave’s corresponding FIFO_EN bit (SLVx_FIFO_EN, where x=0, 1, or 2) is set to 1, the data stored in its corresponding data registers (EXT_SENS_DATA registers, Registers 73 to 96) will be written into the FIFO buffer at the Sample Rate. EXT_SENS_DATA register association with I2C Slaves is determined by the

I2C_SLVx_CTRL registers (where x=0, 1, or 2; Registers 39, 42, and 45). For information regarding EXT_SENS_DATA registers, please refer to Registers 73 to 96.

当外部从模式相应FIFO_EN位 (SLVx_FIFO_EN,x = 0、1或2)设置为1时,数据存储在相应的数据寄存器(EXT_SENS_DATA寄存器,寄存器73至96)将被写入到FIFO缓冲的采样率。EXT_SENS_DATA寄存器与I2C从模式是由I2C_SLVx_CTRL寄存器(x = 0、1或2;寄存器39、42和45)。关于EXT_SENS_DATA寄存器的信息,请参阅寄存器73到96

Note that the corresponding(相应的) FIFO_EN bit (SLV3_FIFO_EN) is found in I2C_MST_CTRL (Register 36). Also note that Slave 4 behaves in a different manner compared to Slaves 0-3. Please refer to Registers 49 to 53 for further information regarding Slave 4 usage.

Note: For further information regarding(关于) the association of EXT_SENS_DATA registers to particular slave devices, please refer to Registers 73 to 96.

注意:为进一步的信息关于EXT_SENS_DATA有关的特定从设备,请参阅寄存器73到96。

Description

This register configures the auxiliary I2C bus for single-master or multi-master control. In addition, the register is used to delay the Data Ready interrupt, and also enables the writing of Slave 3 data into the FIFO buffer. The register also configures the auxiliary I2C Master’s transition from one slave read to the next, as well as the MPU-60X0’s 8MHz internal clock.

这个寄存器配置辅助I2C总线single-master或多主机控制。此外,准备中断寄存器用于延迟数据,并使从设备3的写数据到FIFO缓冲区。寄存器还配置辅助I2C主模式转变从一个从模式读到下一个,以及MPU-60X0 8 Mhz的内部时钟。

Multi-master capability allows multiple I2C masters to operate on the same bus. In circuits where multi-master capability is required, set MULT_MST_EN to 1. This will increase current drawn by approximately 30μA.

多主机的性能允许I2C多主机操作在同一总线。在多主机电路功能是必需的,MULT_MST_EN设置为1。这将增加电流由大约30μa。

In circuits where multi-master capability is required, the state of the I2C bus must always be monitored by each separate I2C Master. Before an I2C Master can assume arbitration of the bus, it must first confirm that no other I2C Master has arbitration of the bus. When MULT_MST_EN is set to 1, the MPU-60X0’s bus arbitration detection logic is turned on, enabling it to detect when the bus is available.

在多主机电路功能是必需的,I2C总线的状态必须监视每一个单独的I2C的主人。之前的I2C的主人可以假定仲裁总线,它必须首先确认没有其他I2C大师的总线仲裁。当

MULT_MST_EN设置为1时,MPU-60X0的总线仲裁检测逻辑,使其检测总线时可用。

When the WAIT_FOR_ES bit is set to 1, the Data Ready interrupt will be delayed until External Sensor data from the Slave Devices are loaded into the EXT_SENS_DATA registers. This is used to ensure that both the internal sensor data (i.e. from gyro and accel) and external sensor data have been loaded to their respective data registers (i.e. the data is synced) when the Data Ready interrupt is triggered.

当WAIT_FOR_ES位设置为1时,准备好中断的数据将被推迟到外部传感器数据从奴隶设备加载到EXT_SENS_DATA寄存器。这是用来确保内部传感器数据(即从陀螺和accel)和外部传感器数据加载各自数据寄存器数据时(即数据同步)触发中断。

When the Slave 3 FIFO enable bit (SLV_3_FIFO_EN) is set to 1, Slave 3 sensor measurement data will be loaded into the FIFO buffer each time. EXT_SENS_DATA register association with I2C Slaves is determined by I2C_SLV3_CTRL (Register 48). For further information regarding EXT_SENS_DATA registers, please refer to Registers 73 to 96.

当从模式3 FIFO使能位(SLV_3_FIFO_EN)设置为1时,从模式3传感器测量数据将被加载到每次FIFO缓冲。EXT_SENS_DATA寄存器与I2C从模式是由I2C_SLV3_CTRL(寄存器48),请阅读寄存器73至96.

The corresponding FIFO_EN bits for Slave 0, Slave 1, and Slave 2 can be found in Register 35.

对应的FIFO_EN位从模式0,从模式1,从模式2可以在寄存器35

The I2C_MST_P_NSR bit configures the I2C Master’s transition from one slave read to the next slave read. If the bit equals 0, there will be a restart between reads. If the bit equals 1, there will be a stop followed by a start of the following read. When a write

transaction follows a read transaction, the stop followed by a start of the successive write will be always used.

I2C_MST_P_NSR位I2C配置从一个IIC主模式过渡到下一个从模式读。如果这位等于0,将会有一个重新启动之间读取。如果等于1,将会有以下停止之后,开始阅读。写事务之前读事务时,停止之后开始的连续写会永远使用。

1)Register 25 – Sample Rate Divider (SMPRT_DIV)

1)SMPLRT_DIV 8位无符号值,通过该值将陀螺仪输出分频,得到采样频率

该寄存器指定陀螺仪输出率的分频,用来产生MPU-60X0的采样率。

传感器寄存器的输出、FIFO(first in first out)输出、DMP采样和运动检测的都是基于该采样率。 采样率的计算公式

采样率 = 陀螺仪的输出率 / (1 + SMPLRT_DIV)

当数字低通滤波器没有使能的时候,陀螺仪的输出率等于8KHZ,反之等于1KHZ。 2)Register 26 – Configuration (CONFIG)

1)EXT_SYNC_SET 3位无符号值,配置帧同步引脚的采样 2)DLPF_CFG 3位无符号值,配置数字低通滤波器

该寄存器为陀螺仪和加速度计配置外部帧同步(FSYNC)引脚采样和数字低通滤波器(DLPF)。 通过配置EXT_SYNC_SET,可以对连接到FSYNC引脚的一个外部信号进行采样。 FSYNC引脚上的信号变化会被锁存,这样就能捕获到很短的频闪信号。 采样结束后,锁存器将复位到当前的FSYNC信号状态。

根据下面的表格定义的值,采集到的数据会替换掉数据寄存器中上次接收到的有效数据

数字低通滤波器是由DLPF_CFG来配置,根据下表中DLPF_CFG的值对加速度传感器和陀螺仪滤波

3)Register 27 – Gyroscope Configuration (GYRO_CONFIG)

1)XG_ST 设置此位1,X轴陀螺仪进行自我测试。 2)YG_ST 设置此位1,Y轴陀螺仪进行自我测试。 3)ZG_ST 设置此位1,Z轴陀螺仪进行自我测试。 4)FS_SEL 2位无符号值。选择陀螺仪的量程。

这个寄存器是用来触发陀螺仪自检和配置陀螺仪的满量程范围。

陀螺仪自检允许用户测试陀螺仪的机械和电气部分,通过设置该寄存器的 XG_ST、YG_ST和 ZG_ST bits可以激活陀螺仪对应轴的自检。每个轴的检测可以独立进行或同时进行。 自检的响应 = 打开自检功能时的传感器输出 - 未启用自检功能时传感器的输出

在MPU-6000/MPU-6050数据手册的电气特性表中已经给出了每个轴的限制范围。当自检的响应值在规定的范围内,就能够通过自检;反之,就不能通过自检。 根据下表,FS_SEL选择陀螺仪输出的量程:

4)Register 28 – Accelerometer Configuration (ACCEL_CONFIG)

1)XA_ST 设置为1时,X轴加速度感应器进行自检。 2)YA_ST 设置为1时,Y轴加速度感应器进行自检。 3)ZA_ST 设置为1时,Z轴加速度感应器进行自检。 4)AFS_SEL 2位无符号值。选择加速度计的量程。

具体细节和上面陀螺仪的相似。

根据下表,AFS_SEL选择加速度传感器输出的量程。

5)Registers 59 to 64 – Accelerometer Measurements (ACCEL_XOUT_H, ACCEL_XOUT_L, ACCEL_YOUT_H, ACCEL_YOUT_L, ACCEL_ZOUT_H, and ACCEL_ZOUT_L)

1)ACCEL_XOUT 16位2’s补码值。 存储最近的X轴加速度感应器的测量值。 2)ACCEL_YOUT 16位2’s补码值。 存储最近的Y轴加速度感应器的测量值。 3)ACCEL_ZOUT 16位2’s补码值。 存储最近的Z轴加速度感应器的测量值。

这些寄存器存储加速感应器最近的测量值。

加速度传感器寄存器,连同温度传感器寄存器、陀螺仪传感器寄存器和外部感应数据寄存器,都由两部分寄存器组成(类似于STM32F10X系列中的影子寄存器):一个内部寄存器,用户不

可见。另一个用户可读的寄存器。内部寄存器中数据在采样的时候及时的到更新,仅在串行通信接口不忙碌时,才将内部寄存器中的值复制到用户可读的寄存器中去,避免了直接对感应测量值的突发访问。

在寄存器28中定义了每个16位的加速度测量值的最大范围,对于设置的每个最大范围,都对应一个加速度的灵敏度ACCEL_xOUT,如下面的表中所示:

6)Registers 65 and 66 – Temperature Measurement (TEMP_OUT_H and TEMP_OUT_L)

1)TEMP_OUT 16位有符号值。 存储的最近温度传感器的测量值。

7)Registers 67 to 72 – Gyroscope Measurements (GYRO_XOUT_H, GYRO_XOUT_L,

GYRO_YOUT_H, GYRO_YOUT_L, GYRO_ZOUT_H, and GYRO_ZOUT_L)

这个和加速度感应器的寄存器相似 对应的灵敏度:

8)Register 107 – Power Management 1 (PWR_MGMT_1)

该寄存器允许用户配置电源模式和时钟源。它还提供了一个复位整个器件的位,和一个关闭温度传感器的位

1)DEVICE_RESET 置1后所有的寄存器复位,随后DEVICE_RESET自动置0. 2)SLEEP 置1后进入睡眠模式

3)CYCLE 当CYCLE被设置为1,且SLEEP没有设置,MPU-60X0进入循环模式,为了从速度传感器中获得采样值,在睡眠模式和正常数据采集模式之间切换,每次获得一个采样数据。在LP_WAKE_CTRL(108)寄存器中,可以设置唤醒后的采样率和被唤醒的频率。 4)TEMP_DIS 置1后关闭温度传感器 5)CLKSEL 指定设备的时钟源

时钟源的选择:

9)Register 117 – Who Am I (WHO_AM_I)

WHO_AM_I中的内容是MPU-60X0的6位I2C地址 上电复位的第6位到第1位值为:110100

为了让两个MPU-6050能够连接在一个I2C总线上,当AD0引脚逻辑低电平时,设备的地址是 b1101000 ,当AD0引脚逻辑高电平时,设备的地址是 b1101001 IIC元件地址控制为:B110 000B

MPU-6000可以使用SPI和I2C接口,而MPU-6050只能使用I2C,其中I2C的地址由AD0引脚决定;寄存器共117个,挺多的,下面的是精简常用的,根据具体的要求,适当的添加。

#define SMPLRT_DIV 0x19 //采样率分频,典型值:0x07(125Hz) */ #define CONFIG 0x1A // 低通滤波频率,典型值:0x06(5Hz) */

#define GYRO_CONFIG 0x1B // 陀螺仪自检及测量范围,典型值:0x18(不自检,2000deg/s) */ #define ACCEL_CONFIG 0x1C // 加速计自检、测量范围及高通滤波频率,典型值:0x01(不自检,2G,5Hz) */

#define ACCEL_XOUT_H 0x3B // 存储最近的X轴、Y轴、Z轴加速度感应器的测量值 */ #define ACCEL_XOUT_L 0x3C #define ACCEL_YOUT_H 0x3D #define ACCEL_YOUT_L 0x3E #define ACCEL_ZOUT_H 0x3F #define ACCEL_ZOUT_L 0x40

#define TEMP_OUT_H 0x41 // 存储的最近温度传感器的测量值 */ #define TEMP_OUT_L 0x42

#define GYRO_XOUT_H 0x43 // 存储最近的X轴、Y轴、Z轴陀螺仪角加速感应器的测量值 */ #define GYRO_XOUT_L 0x44 #define GYRO_YOUT_H 0x45 #define GYRO_YOUT_L 0x46 #define GYRO_ZOUT_H 0x47 #define GYRO_ZOUT_L 0x48

#define PWR_MGMT_1 0x6B // 电源管理,典型值:0x00(正常启用) */ #define WHO_AM_I 0x75 //IIC地址寄存器(默认数值0x68,只读) */

本文来源:https://www.bwwdw.com/article/rcyv.html

Top