You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BMI085 is a system-in-package inertial measurement unit which offers accurate acceleration and angular rate measurements. Due to system-in-package approach (two sensors in single package), the gyroscope and acceleration data is acquired in a non-synchronized manner. However, the synchronization between accelerometer and gyroscope can be easily achieved. This document describes how synchronization between accelerometer and gyroscope can be achieved in a typical application such as augmented or virtual reality.
5
+
6
+
To achieve data synchronization on BMI085, the data ready interrupt signal from the gyroscope of the BMI085 needs to be connected to one of the interrupt pins of the BMI085 accelerometer (which can be configured as input pins). The internal signal processing unit of the accelerometer uses the data ready signal from the gyroscope to synchronize and interpolate the data of the accelerometer, considering the group delay of the sensors. The accelerometer part can then notify the host of available data. With this technique, it is possible to achieve synchronized data and provide accelerometer data at an ODR of 2 kHz.
7
+
8
+
_Note: data synchronization is designed for applications requiring high bandwidth, for which BMI085 is intended, but it works also with BMI088. However, for some applications it is desirable to have a very low bandwidth, and partly having different bandwidth settings for accelerometer and gyroscope. Here the synchronization feature does not make sense._
9
+
10
+
## Concept
11
+
Synchronized data means that the acquisition of the gyroscope and accelerometer data is happening at the same time and the signals have same propagation time. The time between motion to register read-out depends on the physical propagation time mainly caused by signal filtering path. The synchronization between accelerometer and gyroscope data to a common point of time and a common group delay can be realized with the approach described in the following sections.
12
+
13
+
The hardware interrupts pins (INT1 / INT3) of the BMI085 are used for data synchronization purposes and must be connected. The interrupt pin INT2 can be used for data ready notification to the host by BMI085.
14
+
15
+
## Technical realization
16
+
The data synchronization feature requires physical interrupt pin’s connection of the sensors on the pcb and a special configuration of the BMI085. Requirements and the steps are described below.
17
+
18
+
### Connection diagram
19
+
20
+
```
21
+
MCU BMI085
22
+
+-----------+ +---------------+
23
+
| | 8 | | 16
24
+
| SCK +------------>| SCK INT1 |<-----+
25
+
| | 9 | | 12 |
26
+
| MOSI +------------>| SDO INT3 |>-----+
27
+
| | 15 | |
28
+
| MISO +<------+-----| SDO1 |
29
+
| | | 10 | |
30
+
| | +-----| SDO2 |
31
+
| | 14 | |
32
+
| ACC_CSB +------------>| CSB1 |
33
+
| | 5 | |
34
+
| GYRO_CSB +------------>| CSB2 |
35
+
| | 1 | |
36
+
| DATA_RDY +<------------| INT2 PS +------+
37
+
| | | | |
38
+
+-----------+ +---------------+ |
39
+
|
40
+
---
41
+
```
42
+
43
+
For latency-critical multisensory applications, it is recommended to use SPI interface for fastest sensor data read (recommended SPI clock speed is >2MHz).
44
+
45
+
### Configuring BMI085 for data synchronization
2
46
3
47
Include the bmi08x header
48
+
4
49
```c
5
50
#include"bmi08x.h"
6
51
```
7
52
Include the bmi085 variant header
53
+
8
54
```c
9
55
#include"bmi085.h"
10
56
```
57
+
11
58
Enable the below macro in bmi08x_defs.h to use the BMI085 sensor feature
12
59
13
60
```c
14
-
/** Enable bmi085 sensor */
61
+
/** \name enable bmi085 sensor */
15
62
#ifndef BMI08X_ENABLE_BMI085
16
63
#define BMI08X_ENABLE_BMI085 1
17
64
#endif
18
65
```
19
66
20
-
To initialize BMI085 for data synchronization, an instance of the bmi08x structure
21
-
should be created. The following parameters are required to be updated in the
22
-
structure by the user:
67
+
To initialize BMI085 for data synchronization, an instance of the bmi08x structure should be created. The following parameters are required to be updated in the structure by the user:
23
68
24
69
25
70
Parameters | Details
@@ -33,6 +78,9 @@ _delay_ms_ | delay
33
78
34
79
35
80
##### _Initialize through SPI interface_
81
+
82
+
The following code is simplified code, for example no checking of return values is added, to make it easier to read the code.
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,22 +76,39 @@ _Note: By default, the interface is I2C._
76
76
To initialize BMI085 sensors, an instance of the bmi08x structure should be created. The following parameters are required to be updated in the structure, by the user, to initialize bmi085 sensors.
_accel_id_ | Accel device address of I2C interface (can be used to identify CSB1 pin in SPI mode)
81
+
_gyro_id_ | Gyro device address of I2C interface (can be used to identify CSB2 pin in SPI mode)
82
82
_intf_ | I2C or SPI
83
83
_read_ | read through I2C/SPI interface
84
84
_write_ | write through I2C/SPI interface
85
85
_delay_ms_ | delay
86
86
87
+
As defined in _bmi08x_defs.h_, the _read_/_write_ functions must be implemented in such a way that they comply with the following template of a function declaration:
Since the BMI08x sensor family has dedicated communication interfaces for gyro and accelerometer, two different chip select lines are required to retrieve all data from the sensor (see datasheet for details). The user can use the fields _accel_id_ and _gyro_id_ to provide an information to the generic SPI read/write function, which chip select to use.
99
+
100
+
When the sensorAPI functions call the _int8_t user_spi_write_ and _int8_t user_spi_read_ functions, they will pass the fields _accel_id_ or _gyro_id_ to the _cs_pin_ parameter.
101
+
102
+
In the example below it is assumed that on the MCU platform of the user, the pin for CSB1 (chip select for accelerometer and temperature sensor data) is defined as MCU_GPIO_BMI08X_CSB1 and the pin for CSB2 (gyro chip select) is defined as MCU_GPIO_BMI08X_CSB2.
103
+
Thus the user need to provide the following values to the _bmi08x_dev_ structure and initialize SPI as follows.
0 commit comments