How does it work?
9DOF 2 Click is based on the ICM-20948, a high performance, 9-axis MotionTracking™ IC from TDK Invensense. ICM-20948 also supports an auxiliary I2C interface to external sensors which offer a greater system flexibility. The output of each MEMS is processed and digitized by a separate sigma-delta 16-bit A/D converter (ADC). Three-axis gyroscope MEMS can be programmed to measure the rotation about each axis, in four different ranges of rotational speed (degrees per angle, DPS): ±250, ±500, ±1000, and ±2000. Three-axis accelerometer MEMS can be programmed to measure the acceleration along each axis, in four different acceleration ranges: ±2g, ±4g, ±8g, and ±16g. Three-axis magnetometer can do a full scale measurement of ±4900 µT.
Interrupt functionality is configured via the Interrupt Configuration register. Items that are configurable include the INT pin configuration, the interrupt latching and clearing method, and triggers for the interrupt. The interrupt is routed to the INT pin of the mikroBUS™.
A FIFO buffer helps to further reduce the processing load, offering temporary storage for the output data. The ICM-20948 contains a FIFO of size 512 bytes (FIFO size will vary depending on DMP feature-set) that is accessible via the Serial Interface. The FIFO configuration register determines which data is written into the FIFO. Possible choices include gyro data, accelerometer data, temperature readings, auxiliary sensor readings, and FSYNC input. Synchronization with an external digital signal is possible over the FSYNC pin. This pin is routed to the PWM pin of the mikroBUS™, labeled as SNC.
The embedded Digital Motion Processor (DMP) within the ICM-20948 offloads computation of motion processing algorithms from the host processor. The DMP acquires data from accelerometers, gyroscopes, and additional third party sensors such as magnetometers, and processes the data. The resulting data can be read from the FIFO. The DMP has access to the external pins, which can be used for generating interrupts.
ICM-20948 supports both SPI and I2C communication interfaces but only SPI interface is used on the 9DOF 2 Click. The voltage level conversion between ICM-20948 and 3.3V MCU is done by the TXB0108 bidirectional voltage level translator.
This Click Board™ uses only SPI communication interface. It is designed to be operated only with 3.3V logic levels. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V.
Specifications
Type
Gyroscope,Magnetic,Motion
Applications
Can be used for Smartphones and Tablets, wearable sensors and IoT Applications.
On-board modules
9DOF 2 Click uses the ICM-20948 IC, the world’s lowest power 9-axis MotionTracking device, from TDK Invensense.
Key Features
Mobile phones, tablet PCs, GPS systems, Smart watches, Sport and fitness devices, and many more.
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on 9DOF 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
Software Support
We provide a library for the 9DOF 2 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions that enables the usage of the 9DOF 2 Click board. It initializes and defines the SPI bus driver and drivers that offer a plethora of settings. The library also offers functions that allow reading of accelerometer,gyroscope pressure and temperature, as well as generic read and write function that offer reading( and writing ) of different lenghts of data to all available registers.
Key functions:
void c9dof2_angular_rate ( float *x_ang_rte, float *y_ang_rte, float *z_ang_rte );
– Function is used to calculate angular rate.void c9dof2_acceleration_rate ( float *x_accel_rte, float *y_accel_rte,float *z_accel_rte );
– Function is used to calculate acceleration rate.void c9dof2_def_settings ( );
– Function is used to apply the default settings to the device.
Examples description
The application is composed of three sections :
- System Initialization – Initializes SPI module, LOG and GPIO structures, sets INT pin as input and PWM as output.
- Application Initialization – Initalizes SPI and device drivers, performs safety check, applies default and writes an initial log.
- Application Task – (code snippet) Demonstrates use of 9DOF 2 click board by reading angular rate, acceleration rate and displaying data via USART terminal.
void application_task ( ) { c9dof2_angular_rate( &x_gyro, &y_gyro, &z_gyro ); mikrobus_logWrite( "Angular rate: ", _LOG_LINE ); FloatToStr( x_gyro, log_txt ); mikrobus_logWrite( "X-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); FloatToStr( y_gyro, log_txt ); mikrobus_logWrite( "Y-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); FloatToStr( z_gyro, log_txt ); mikrobus_logWrite( "Z-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); c9dof2_acceleration_rate( &x_accel, &y_accel, &z_accel ); mikrobus_logWrite( "Acceleration rate: ", _LOG_LINE ); FloatToStr( x_accel, log_txt ); mikrobus_logWrite( "X-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); FloatToStr( y_accel, log_txt ); mikrobus_logWrite( "Y-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); FloatToStr( z_accel, log_txt ); mikrobus_logWrite( "Z-axis: ", _LOG_TEXT ); Ltrim( log_txt ); mikrobus_logWrite( log_txt, _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- SPI
- UART
- Conversions
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.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.