TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137116 times)
  2. FAT32 Library (70239 times)
  3. Network Ethernet Library (56131 times)
  4. USB Device Library (46445 times)
  5. Network WiFi Library (42094 times)
  6. FT800 Library (41408 times)
  7. GSM click (29124 times)
  8. mikroSDK (26567 times)
  9. PID Library (26507 times)
  10. microSD click (25491 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

6DOF IMU 12 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 123 times

Not followed.

License: MIT license  

6DOF IMU 12 Click carries the ultra-low-power BMI270 from Bosch Sensortec, inertial measurement unit optimized for wearables providing precise acceleration, angular rate measurement and intelligent on-chip motion-triggered interrupt features.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "6DOF IMU 12 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "6DOF IMU 12 click" changes.

Do you want to report abuse regarding "6DOF IMU 12 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


6DOF IMU 12 click

6DOF IMU 12 Click carries the ultra-low-power BMI270 from Bosch Sensortec, inertial measurement unit optimized for wearables providing precise acceleration, angular rate measurement and intelligent on-chip motion-triggered interrupt features.

6dofimu12_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Feb 2020.
  • Type : I2C/SPI type

Software Support

We provide a library for the C6DofImu12 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for C6DofImu12 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void c6dofimu12_cfg_setup ( c6dofimu12_cfg_t *cfg );

  • Initialization function.

    C6DOFIMU12_RETVAL c6dofimu12_init ( c6dofimu12_t ctx, c6dofimu12_cfg_t cfg );

  • Click Default Configuration function.

    void c6dofimu12_default_cfg ( c6dofimu12_t *ctx );

Example key functions :

  • Function check status initialization of the device of BMI270 6-axis, smart, low-power Inertial Measurement on 6DOF IMU 12 Click board.

    C6DOFIMU12_RETVAL c6dofimu12_check_id ( c6dofimu12_t *ctx );

  • Function check status initialization of the device of BMI270 6-axis, smart, low-power Inertial Measurement on 6DOF IMU 12 Click board.

    C6DOFIMU12_RETVAL c6dofimu12_check_init_status ( c6dofimu12_t *ctx );

  • Function reads Accel and Gyro 16-bit ( signed ) X-axis, Y-axis data and Z-axis data from the 12 targeted starts from C6DOFIMU12_REG_ACC_X_LSB_ADDR register address of BMI270 6-axis, smart, low-power Inertial Measurement on 6DOF IMU 12 Click board.

    void c6dofimu12_get_data ( c6dofimu12_t ctx, c6dofimu12_accel_t accel_data, c6dofimu12_gyro_t *gyro_data );

Examples Description

This example demonstrates the use of 6DOF IMU 12 click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and checks the communication then initializes the device and sets the device default configuration.


void application_init ( void )
{
    uint8_t tx_buf;

    log_cfg_t log_cfg;
    c6dofimu12_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    c6dofimu12_cfg_setup( &cfg );
    C6DOFIMU12_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    c6dofimu12_init( &c6dofimu12, &cfg );
    Delay_ms ( 100 );

    log_printf( &logger, " Driver init done \r\n" );
    log_printf( &logger, "----------------------------------\r\n");

    if ( c6dofimu12_check_id( &c6dofimu12 ) == C6DOFIMU12_SUCCESS )
    {
        log_printf( &logger, "  Communication OK\r\n" );
        log_printf( &logger, "----------------------------------\r\n");
    }
    else
    {
        log_printf( &logger, " Communication ERROR\r\n" );
        log_printf( &logger, " Reset the device\r\n" );
        log_printf( &logger, "----------------------------------\r\n");

        for ( ; ; );
    }

    tx_buf = C6DOFIMU12_PWR_CONF_ADV_PWR_SAVE_DISABLED | 
             C6DOFIMU12_FIFO_READ_DISABLED | 
             C6DOFIMU12_FAST_PWR_UP_DISABLED;
    c6dofimu12_generic_write( &c6dofimu12, C6DOFIMU12_REG_PWR_CONF_ADDR, &tx_buf, 1 );
    Delay_ms ( 100 );
    tx_buf = C6DOFIMU12_CMD_INITIALIZATION_START;
    c6dofimu12_generic_write( &c6dofimu12, C6DOFIMU12_REG_INIT_CTRL_ADDR, &tx_buf, 1 );
    Delay_ms ( 100 );
    c6dofimu12_generic_write( &c6dofimu12, C6DOFIMU12_REG_INIT_DATA_ADDR, bmi270_config_file, 8192 );
    Delay_ms ( 100 );
    tx_buf = C6DOFIMU12_CMD_INITIALIZATION_STOP;
    c6dofimu12_generic_write( &c6dofimu12, C6DOFIMU12_REG_INIT_CTRL_ADDR, &tx_buf, 1 );
    Delay_ms ( 100 );

    if ( c6dofimu12_check_init_status( &c6dofimu12 ) == C6DOFIMU12_SUCCESS )
    {
        log_printf( &logger, " Initialization completed\r\n" );
        log_printf( &logger, "----------------------------------\r\n");
    }
    else
    {
        log_printf( &logger, " Initialization ERROR\r\n" );
        log_printf( &logger, " Reset the device\r\n" );
        log_printf( &logger, "----------------------------------\r\n");

        for( ; ; );
    }
    c6dofimu12_default_cfg( &c6dofimu12 );
    Delay_ms ( 100 );
}

Application Task

Measures acceleration and gyroscope data and displays the results on USB UART each second.


void application_task ( void )
{
    c6dofimu12_get_data( &c6dofimu12, &c6dofimu12_accel, &c6dofimu12_gyro );

    log_printf( &logger, " Accel X: %d | Gyro X: %d\r\n", c6dofimu12_accel.x, c6dofimu12_gyro.x );
    log_printf( &logger, " Accel Y: %d | Gyro Y: %d\r\n", c6dofimu12_accel.y, c6dofimu12_gyro.y );
    log_printf( &logger, " Accel Z: %d | Gyro Z: %d\r\n", c6dofimu12_accel.z, c6dofimu12_gyro.z );
    log_printf( &logger, "----------------------------------\r\n");
    Delay_ms ( 1000 );
} 

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.6DofImu12

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

MCP251863 click

0

MCP251863 Click is a compact add-on board representing a complete CAN solution used as a control node in a CAN network. This board features the MCP251863, IC representing a compact solution with a controller and a transceiver in one package, the MCP2518FD and ATA6563 from Microchip. The ATA6563, a low-level physical layer IC (PHY), provides a physical connection with the CAN bus itself, while the CAN controller MCP2518FD represents an interface between the MCU and the PHY. It features three operating modes with dedicated fail-safe features, remote wake-up via CAN, and ideally passive behavior when powered off on the CAN bus. This Click board™ is suitable for developing a wide range of automotive diagnostic applications, even on MCUs that don’t support CAN interface.

[Learn More]

RS485 3.3V click

0

RS485 click 3.3V is a RS422/485 transceiver Click board, which can be used as an interface between the TTL level UART and the RS422/485 communication bus.

[Learn More]

Tilt 2 click

5

Tilt 2 click is a tilt sensor switch, which breaks the circuit when tilted to an angle of 45° or when shaken. It is a single-pole-double-throw type of switch (SPDT), which can be operated with up to 24V. The current through the switch should not exceed 25mA.

[Learn More]