小钢炮CANNON
直播中

LYZ

12年用户 75经验值
擅长:嵌入式技术 控制/MCU
私信 关注
[经验]

【CANNON试用体验】小钢炮LSM6DS3的使用

一、LSM6DS3的特性
image002.jpg
归纳起来比较重要的几点是:
1.采样速率最高可达1.6KHz;
2.有一个8kbyte的FIFO;
3.量程±2g/±4g/±8g/±16g可选;
4.检测速率范围±125/±245/±500/±1000/±2000dps可选;
5.使用SPI或I2C与MCU通讯;
6.拥有一个内部温度传感器

二、LSM6DS3对加速度和角速率检测的方向
image004.jpg
可以看到,对加速度检测的三个轴满足右手螺旋定律。

三、LSM6DS3的量程和灵敏度
image006.jpg
前两项是量程,后两项是灵敏度。比如,检测加速度在量程为±2g时的灵敏度为0.061mg/LSB
注:LSM6DS3的数据是16位,其中一位是符号位,灵敏度的计算:+2g/2^15=0.061mg/LSB

四、LSM6DS3输出数据的速率
image008.jpg
另外,温度传感器的量程是-40~+85 ℃

五、LSM6DS3的操作模式
image010.jpg
每种操作模式又有4中运行模式:powerdown, low-power, normal mode and high-performance mode.

六、LSM6DS3的FIFO
1. FIFO存储的数据:
image012.jpg
2. 向FIFO存数据的时间(应该是由硬件去操作)
image014.jpg
3. FIFO的几种运行模式
(1) Bypass mode
Bypass mode is also used to reset the FIFO when in FIFO mode.
(2) FIFO mode
In FIFO mode data from the output channels are stored in the FIFO until it is full.
(3) Continuous mode
Continuous mode provides a continuous FIFO update: as new data arrives, the older data is discarded.
(4) Continuous-to-FIFO mode
In Continuous-to-FIFO mode,  FIFO behavior changes according to the trigger event detected in one of the following interrupt registers FUNC_SRC (53h), TAP_SRC (1Ch), WAKE_UP_SRC (1Bh) and D6D_SRC
(1Dh).
When the selected trigger bit is equal to '1',  FIFO operates in FIFO mode.
When the selected trigger bit is equal to '0',  FIFO operates in Continuous mode.
(5) Bypass-to-Continuous mode
In Bypass-to-Continuous,  data measurement storage inside FIFO operates in Continuous mode when selected triggers in one of the following interrupt registers FUNC_SRC (53h), TAP_SRC (1Ch),WAKE_UP_SRC (1Bh) and D6D_SRC (1Dh) are equal to '1',  otherwise FIFO content is reset (Bypass mode).
4.读取FIFO数据
(1)有关的寄存器:
image016.jpg
(2)数据存储的方式:
Saving data in the FIFO buffer is organized in four FIFO data sets consisting of 6 bytes each:
The 1st FIFO data set is reserved for gyroscope data;
The 2nd FIFO data set is reserved for accelerometer data;
The 3rd FIFO data set is reserved for the external sensor data stored in the registers from
SENSORHUB1_REG (2Eh) to SENSORHUB6_REG (33h);
The 4th FIFO data set can be alternately associated to the external sensor data stored in the
registers from SENSORHUB7_REG (34h) to SENSORHUB12_REG(39h), to the step
counter and time stamp info, or to the temperature sensor data.

七、小钢炮CANNAN中关于LSM6DS3的函数
1.初始化:lsm6ds3_6_axis_init();
2.获取数据:read_6_Axis_data(void* args);
还有其他的一些函数,大家可以参考http://www.juma.io/doc/zh/embedded_api/imu_sensor/

回帖(1)

h1654155212.7270

2017-5-27 17:54:02
你好,正在用这个模块,可以提供一个参考的DEMO么?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分