Intel® Quark™ Microcontroller D2000 - Accelerometer Tutorial

By Joel Lin,

Published:07/28/2016   Last Updated:07/28/2016

Intel® System Studio for Microcontrollers includes multiple sample applications to help you get up to speed with basic functionality and become familiar with the Intel® Quark™ Microcontroller Software Interface (QMSI).  This example reads and outputs accelerometer data to the console. The example (optionally) uses the Intel® Integrated Performance Primitives (Intel IPP) to compute root mean square, variance, and mean for the last 15 Z axis readings.

Author: Richard, A.

Hardware Required

  • Intel® Quark™ Microcontroller D2000 developer board and USB cable


  1. Create a project with the "Accelerometer" sample project file
    1. From the File menu, select New and then select Intel® Project
    2. Follow the setup wizard to create your project:
      1. Developer board: Select the D2000 developer board
      2. Project type: Intel® QMSI (1.1)
      3. Selection Connection: USB-Onboard
      4. Project example: Accelerometer
    3. Click Finish.
  2. Select the "Accelerometer" project in the Project Explorer window
  3. Click the Build  button to compile your project
  4. Click the Debug   drop down and select "Accelerometer (flashing)"
    • Note: this option will prompt you to switch to the debug perspective and will write the application to the board.  It also automatically places a breakpoint in the first line of your main function
  5. Setting up output
    1. In the source window (select main.c) locate the “static void print_accel_callback (void *data)” function and copy the contents of the print function QM_PRINTF as seen below: 
      “x %d y %d z %d\n”, accel.x, accel.y, accel.z
    2. Right click on the left hand side of window and select “Add Dynamic Printf…”
    3. Replace the printf( content with the contents you copied in 5a:
    • “x %d y %d z %d\n”, accel.x, accel.y, accel.z
    • Note: This is the data that is computed by the accelerometer sensor and will be displayed in the Console once completing these steps
  6. Click on the Resume [icon] button to continue running the Accelerometer application
  7. View X, Y and Z values from the accelerometer in the Console window

Note: Move around your board to see the x, y, z data change accordingly

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804