Table of Contents

Example Summary

Sample application to read 9 DoF(Degrees of Freedom) from (BMI160(inertial measurement unit) + BMM150(GeoMagnetic Sensor). The BMM150 in this example has been configured as slave to the BMI160. So single driver for BMI160 sensor also reads data from the BMM150 .

Peripherals Exercised

Resources & Jumper Settings

If you’re using an IDE (such as CCS or IAR), please refer to Board.html in your project directory for resources used and board-specific jumper settings. Otherwise, you can find Board.html in the directory <PLUGIN_INSTALL_DIR>/source/ti/boards/<BOARD>.

Example Usage

The connection will have the following settings:

    Baud-rate:     115200
    Data bits:          8
    Stop bits:          1
    Parity:          None
    Flow Control:    None

accelo: x = 1, y = -23,z = 8207

gyro : x = 0, y = 0,z = 0

magno : x = 138, y = 203,z = 0

accelo: x = 9, y = -28,z = 8207

gyro : x = -1, y = 0,z = 1

magno : x = 287, y = 416,z = 0

```

Application Design Details

This application uses 3 threads:

mainThread - performs the following actions:

  1. Opens and initializes an I2C Driver.

  2. Creates two threads bmiInterruptHandlerTask, displayTask

  3. reset the bmi160 interrupt engine, FIFO

  4. Initializes the BMI160 driver to operate in STANDARD_UI_9DOF_FIFO mode

  5. Sets Callback for FIFO Water Mark Interrupt.

bmiInterruptHandlerTask - performs the following actions:

  1. the bmiInterruptHandlerTask gets unblocked whenever there is a FIFO water mark interrupt.(Water mark is set for 512).

  2. Reads the FIFO and averages the values read.

  3. Unblocks the Display task.

displayTask - performs the following actions:

  1. This task prints the values of accelo, gyro, magno on serial console.