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
Instructions
- Create a project with the "Accelerometer" sample project file
- From the File menu, select New and then select Intel® Project
- Follow the setup wizard to create your project:
- Developer board: Select the D2000 developer board
- Project type: Intel® QMSI (1.1)
- Selection Connection: USB-Onboard
- Project example: Accelerometer
- Click Finish.
- Select the "Accelerometer" project in the Project Explorer window
- Click the Build button to compile your project
- 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
- Setting up output
- 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 - Right click on the left hand side of window and select “Add Dynamic Printf…”
- 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
- 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:
- Click on the Resume [icon] button to continue running the Accelerometer application
- 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
"