November 2008 Rev 1 1/37
UM0603
User manual
STEVAL-MKI005V1
demonstration kit for the LIS3LV02DL
Introduction
The STEVAL-MKI005V1 is a demonstration kit designed to provide the user with a
complete, ready-to-use platform to demonstrate the LIS3LV02DL low power 3-axis linear
accelerometer with digital output. The device includes a sensing element and an IC
interface capable of translating information from the sensing element into a measured signal
that can be used for external applications.
In addition to the MEMS sensor, the demonstration board features an ST7-USB
microcontroller that functions as a bridge between the sensor and the PC, on which it is
possible to use the graphical user interface (GUI) downloadable from the web site, or
dedicated software routines for customized applications.
This user manual describes the hardware included with the demonstration kit and provides
the information required to install and run the demonstration kit user interface.
For details regarding the features of the LIS3LV02DL sensor, please refer to the datasheet
for this device and application note AN2381.
www.st.com
Contents UM0603
2/37
Contents
1 Demonstration kit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 STEVAL-MKI005V1 GUI installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 PC system requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Graphical user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Connecting to the Virtual COM port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 “Easy Start” button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 “Options” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 “Register Setup” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5 “Bars” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.6 “Plot” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.7 “Data” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.8 “Inclinometer” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.9 “Map Browsing” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.10 “FFT” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.11 “Interrupt” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.12 “Direction detection” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 “Data acquisition” quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5 EK Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 MEMS pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.1 GUI description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.1.1 Left side: main controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.1.2 Left side: pointer application controls . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7 Supported commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.2 Supported commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
UM0603 Contents
3/37
7.2.1 Start command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2.2 Debug command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2.3 Stop command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2.4 Register read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2.5 Register write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.2.6 Single bit write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.2.7 Zon and Zoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.2.8 Device name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.2.9 Firmware version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.3 Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
8 Schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9 Bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
10 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
List of figures UM0603
4/37
List of figures
Figure 1. Demonstration board block diag ram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2. Top silk-screen of the STEVAL-MKI005V1 kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 3. Board photograph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 4. Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 5. Notify icon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 6. Driver installation using the device manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 7. USB driver installation using the hardware update wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 8. Virtual COM driver port assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 9. Graphical User Interface: main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 10. Options tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 11. Register setup tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 12. Bars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 13. Bars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 14. Plot tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 15. Plot tab - Zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 16. Data tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 17. Inclinometer tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 18. Axis inclination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 19. Map Browsing tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 20. FFT tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 21. Interrupt tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 22. Direction detection tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 23. STEVAL-MKI005V1 lite GUI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 24. MEMS pointer demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 25. Schematic diagram of the STEVAL-MKI005V1 board . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
UM0603 Demonstration kit description
5/36
1 Demonstration kit description
The STEVAL-MKI005V1 is a complete demonstration kit which allows users to evaluate the
performance of the LIS3LV02DL low power 3-axis linear accelerometer with digital output.
The block diagram of the demonstration kit is shown in Figure 1.
Figure 1. Demonstration board block diagram
The ST7-USB microcontroller included on the board allows communication between the
sensor device and the PC. The user can interact with the hardware either through the GUI
provided with the kit, or through dedicated software routines to run customized applications.
Switches and LED indicators are used to control and monitor the functionality of the board.
The top silk-screen view and photo of the full board, respectively, are shown in Figure 2 and
Figure 3.
ST72F651
SPI
Control Switches
USB USB
Power On LED
Data Ready LED
General Purpose LED
(Left, Right and Reset)
MEMS
Sensor µC Connector
Demonstration kit description UM0603
6/36
Figure 2. Top silk-screen of the STEVAL-MKI005V1 kit
Figure 3. Board photograph
Operation of the STEVAL-MKI005V1 demonstration kit requires the installation of a
dedicated driver which is included on the installation pack, together with a GUI interface
which allows simple interaction with the sensor. The steps required for driver and software
installation are described in the following section.
UM0603 STEVAL-MKI005V1 GUI installation
7/36
2 STEVAL-MKI005V1 GUI installation
The installation of the graphical user interface (GUI) for the STEVAL-MKI005V1 requires two
steps:
1. installation on the PC the software downloaded to EK web page.
2. installation of the Virtual COM driver needed to use the demonstration kit board.
2.1 PC system requirements
Both the hardware and software that compose the STEVAL-MKI005V1 demonstration kit
have been designed to operate with Microsoft® Windows XP and Microsoft® Windows Vista.
2.2 Software installation
To install the software downloaded to EK web page:
1. double-click on “Setup.exe”
2. follow the on screen instructions (Figure 4)
Figure 4. Software installation
STEVAL-MKI005V1 GUI installation UM0603
8/36
2.3 Hardware installation
To install the virtual COM driver, insert the demonstration kit board into a free USB port. The
“Notify” icon should appear as in Figure 5.
Figure 5. Notify icon
If the “Hardware Update Wizard” window appears (Figure 7), follow the instructions on the
screen. Otherwise, the installation can be performed by following the instructions indicated
in Figure 6 and Figure 7.
Figure 6. Driver installation using the device manager
2
1
Right click on My Computer Right click on “ST MEMS UNIT” and choose Update driver
UM0603 STEVAL-MKI005V1 GUI installation
9/36
Figure 7. USB driver installation using the hardware update wizard
Once the installation is complete, a COM port number is assigned to the ST Virtual COM
driver (Figure 8). This number should be retained as it is required to run the STEVAL-
MKI005V1 demonstration software GUI. For additional details, see section 3.1.
6
5
3
7
4
STEVAL-MKI005V1 GUI installation UM0603
10/36
Figure 8. Virtual COM driver port assignment
UM0603 Graphical user interface
11/36
3 Graphical user interface
To execute the STEVAL-MKI005V1 demonstration software GUI:
1. Click on Start > All Programs
2. Select ST EVAL > STEVAL-MKI005V1 > Executables
3. Launch the program “STEVAL-MKI005V1 Ver. 1.0
The GUI main window appears as shown in Figure 9.
Figure 9. Graphical User Interface: main window
ref 1
ref 2
ref 4
ref 5
ref 3
Graphical user interface UM0603
12/36
The functions of the four main sections of the window are described below:
1. “Main Control” (Figure 9, ref 1) - Connects/disconnects the board and starts acquisition
via the Start/Stop buttons
2. “Saving” box (Figure 9, ref 2) - Allows the user to save the data to a specified text file,
choosing the data type to write. Data type available are:
a) RAW: for each axes the software writes the data read directly from the sensor
output registers (OUTX_H, OUTX_L, OUTY_H, OUTY_L and OUTZ_H, OUTZ_L)
b) LSB: the data read directly from the sensor are converted from 2’s complement to
Sign and Magnitude
c) Acceleration: LSB data are multiplied by the sensitivity to obtain the acceleration
expressed in mg
d) Angle: LSB data converted to tilting angle of the board expressed in degrees
e) Interrupt: status of the interrupt
3. “Tab Selector” (Figure 9, ref 3) - Used to toggle between the different functions of the
demonstration kit
4. “Legenda” (Figure 9, ref 4) - In this box is possible to Enable/Disable the axes view
5. “Details(Figure 9, ref 5) - Shows the details of demonstration kit, the name of sensor,
the version of firmware loaded on microcontroller and the version of PC software
3.1 Connecting to the Virtual COM port
Before using the functions of the demonstration kit software it is necessary to open the
connection with the STEVAL-MKI005V1 board. This is achieved through the following
procedure:
1. connect the STEVAL-MKI005V1 to the desired USB port
2. in the “Select COM” drop-down menu (Figure 9 ref 1), choose the Virtual COM number
to which the board has been mapped. For additional information on how to obtain this
number, see section 2.3
3. open the connection by clicking on “Connect” (Figure 9 ref 1)
At this point the user can acquire, plot and save the acceleration data measured by the
sensor and access the content of the registers embedded in the device.
Clicking the "Find" button (Figure 9 ref 1), the GUI attempts to automatically find the COM
Number assigned to the demonstration kit and shows it in the list box as selected item.
The following sections provide details regarding the functions of the tabs in Figure 9, ref 1.
3.2 “Easy Start” button
When the "Easy Start" button (Figure 9, ref 1) is clicked, the GUI attempts to automatically
find the COM number assigned to the demonstration kit and starts the acquisition.
UM0603 Graphical user interface
13/36
3.3 “Options” tab
The options tab allows the user to control the following parameters:
1. Full Scale (FS) - Sets the maximum acceleration value measurable by the device. It is
possible to select either 2g or 6g (Figure 10, ref 1)
2. Operating Mode (OM) - This control allows to customer to select the operating mode:
Normal Mode or Power Down Mode (Figure 10, ref 2)
3. Block Data Update (BDU) - this function is used to inhibit output registers update until
both upper and lower register parts are read (Figure 10, ref 3)
4. High-Pass Filter (HP) - This control activates the High Pass Filter on the device and
selects the cut-off frequency (Figure 10, ref 5)
5. Data Rate (DR) - In this box the rate at which each acceleration sample is produced
can be selected. The possible values are 40, 160, 640 or 2560 Hz (Figure 10, ref 5)
6. Tri-State (TS) - Permits switching the SPI lines of the ST7-USB microcontroller
mounted on the demonstration kit between 3-state (i.e. high-impedance) and normal
mode (Figure 10, ref 6). This function makes it possible to isolate the sensor mounted
on the board from the microprocessor, in case any external control (from a different
microcontroller mounted on a separate user board) is needed. This function is inhibited
during the acquisition
7. Big/Little Endian (BLE) - is used to select Big Endian or Little Endian representation for
output registers (Figure 10, ref 7)
8. Data Alignment Selection (DAS) - permits to decide between 12 bit right justified and
16 bit left justified representation of data coming from the device (Figure 10, ref 8)
Figure 10. Options tab
ref 1
ref 2
ref 3
ref 4
ref 5
ref 6
ref 7
ref 8
Graphical user interface UM0603
14/36
3.4 “Register Setup” tab
The register setup tab shown in Figure 11 allows read/write access to the content of the
registers embedded in the LIS3LV02DL MEMS sensor mounted on the demonstration kit.
The tab is divided into five sections:
1. “General” (Figure 11, ref 1) - Provides access to the registers which control the main
settings of the device. This section contains the control registers (CTRL_REG1,
CTRL_REG2 and CTRL_REG3) and the registers that control the generation of inertial
interrupt signals. It is possible to read and write the contents of each register. To restore
the default value for a given register, press the “Default” button
2. “All Registers” (Figure 11, ref 2) - Permits the user to read, write and recall the default
content for all the registers shown in ref 1 with a single click on the read/write/default
button
3. “Registers Direct Access” (Figure 11, ref 3) - Provides access to any register in the
device. To read a generic register, insert the address in the “Register Address” text box,
then click on the “Read” button. The retrieved content of the register is displayed in the
“Register Value” field. As with writing to a register, the user must specify the address
and the data to be written inside the fields marked “Register Address” and “Register
Value”, respectively, and then press the “Write” button
4. “Load/Save Configuration” (Figure 11, ref 5) - Lets the user save/load a specific
configuration to/from a file
5. “Parameters” (Figure 11, ref 4) - Allows the user to save the register configuration to a
text file, which includes a detailed description of the resulting configuration for each
register
Note: By pressing the "Default" button, the default values for the registers are recalled in the
registers field. To write the values to the registers of the device, the user has to press the
"Write" button after the "Default" one.
Figure 11. Register setup tab
ref 1
ref 2
ref 3
ref 4
ref 5
UM0603 Graphical user interface
15/36
3.5 “Bars” tab
The bars tab (Figure 12) displays the acceleration data measured by the LIS3LV02DL
sensor in bar chart format. The accelerations along the X, Y and Z axes correspond
respectively to the RED, GREEN and BLUE bars.
The height of each bar is determined by the amplitude of the acceleration signal measured
along the related axis. The full scale of the graph depends on the FS bit in CTRL_REG2 bits
of CTRL_REG4, which may be changed through both the Options (Figure 10, ref 1) and the
Register Setup tabs (Figure 11, ref 1).
Click on the desired bar to zoom: the selected bar is shown at the center of the screen
together with the acceleration as a numerical value. To return to the default view, click on the
center of the bar (Figure 13).
Figure 12. Bars tab
Graphical user interface UM0603
16/36
Figure 13. Bars tab
3.6 “Plot” tab
The Plot tab (Figure 14) shows the sequence of acceleration samples that have been
measured by the LIS3LV02DL MEMS sensor in the demonstration kit. This tab shows:
1. “Acceleration Value” (Figure 14, ref 1) - Shows the numeric values of the acceleration
samples measured by the sensor
2. “Information” (Figure 14, ref 2) - Legend of the current status. Reported items are the
Operating Mode, Data Rate and Full scale
To zoom in on the waveform, select the desired zone with the left button of the mouse
(Figure 15). Click again with the right button to return to the default view.
UM0603 Graphical user interface
17/36
Figure 14. Plot tab
ref 1
ref 2
Graphical user interface UM0603
18/36
Figure 15. Plot tab - Zoom
1) Select one point on the screen
2) Holding the LEFT mouse button
and click the LEFT mouse button
down, move the cursor to obtain
an area on the screen
3) Release the button to terminate
the zoom procedure; a new
area is visible on the screen
4) To return to the previous view,
click on the screen with
the RIGHT mouse button
UM0603 Graphical user interface
19/36
3.7 “Data” tab
The Data tab (Figure 16) shows the acceleration values measured by the LIS3LV02DL
sensor. The tab is divided into three boxes:
1. “ADC Out” (Figure 16, ref 1) - Displays the acceleration data provided by the sensor
after its conversion from 2’s complement to magnitude and sign
2. “Acceleration Value” (Figure 16, ref 2) - Represents the acceleration data measured by
the sensor, expressed in mg
3. “Angle” (Figure 16, ref 3) - Returns the tilt angle, expressed in degrees, that is inferred
from the “ADC Out” data
Note: To increase data readability, the values shown in the boxes described above are based on
an average of 50 samples.
Figure 16. Data tab
ref 1
ref 2
ref 3
Graphical user interface UM0603
20/36
3.8 “Inclinometer” tab
The Inclinometer tab (Figure 17) represents the acceleration data measured by the sensor
in the form of an artificial horizon.
Figure 17. Inclinometer tab
Figure 18. Axis inclination
x,y,z
horizontal plane
+90°
-90°
UM0603 Graphical user interface
21/36
3.9 “Map Browsing” tab
The Map browsing tab demonstrates the capability of using the acceleration data obtained
from the sensor to scroll a map (or other type of document) on the screen.
Figure 19. Map Browsing tab
a)
b)
Graphical user interface UM0603
22/36
To move the map on the screen, tilt the evaluation kit (Figure 19, a):
1. along the X axis (PITCH) to move the map in the top/bottom direction on the screen
2. along the Y axis (ROLL) to move the map in right/left direction on the screen
As the example in Figure 19 (b) shows, when the board is tilted along the X axes (positive
ROLL), the map on the screen is moved to the right.
UM0603 Graphical user interface
23/36
3.10 “FFT” tab
The FFT tab (Figure 20) shows the FFT of the acceleration signals acquired by the sensor.
The spectral data are updated every sample and are calculated on a 64-sample moving
window.
Figure 20. FFT tab
3.11 “Interrupt” tab
The Interrupt tab (Figure 21) provides a tool for evaluating the interrupt generation features
of the LIS3LV02DL MEMS sensor. In this section of the GUI it is possible to configure the
characteristics of the inertial events that must be recognized by the device and to visualize,
in real-time, the level of the two interrupt lines together with the acceleration signals that are
measured by the device.
The GUI provides direct access to the registers (FF_WU_CFG, FF_WU_SRC,
FF_WU_THS and FF_WU_DURATION) that allow the configuration (Figure 21, ref 1) of the
interrupt sources of the device. Conversion boxes are located on the right most side of the
FF_WU_THS and FF_WU_DURATION registers (Figure 21, ref 2). These boxes are
intended to show, respectively, the threshold value expressed in mg and the duration value
converted in msec for better readability and understanding.
Finally, two buttons are provided for each interrupt line to set the suggested default values
for free-fall and wake-up detection. Those buttons are marked “Free-fall” and “Wake Up”,
respectively (Figure 21, ref 3).
Graphical user interface UM0603
24/36
Figure 21. Interrupt tab
3.12 “Direction detection” tab
The Direction detection tab (Figure 22) allows the implementation of motion-controlled
functions such as gaming and terminal control while requiring reduced computational power
of the application controller.
The device may be programmed to generate an interrupt signal when a tilt is detected and to
return the information regarding the direction in which the sensor has been tilted. With the
same feature, the LIS3LV02DL sensor is capable of returning the information about the
spatial orientation of the board without requiring the reading and the further post-processing
of the acceleration data.
The right side of the tab contains the registers used to configure the direction detection
function (Figure 22, ref 1), the threshold values expressed in mg (Figure 22, ref 2) and the
DD_SRC expressed as a bit vectors (Figure 22, ref 3).
ref 2ref 1 ref 3
UM0603 Graphical user interface
25/36
Figure 22. Direction detection tab
ref 1
ref 2
ref 3
“Data acquisition” quick start UM0603
26/36
4 “Data acquisition” quick start
This section describes the basic steps that must be performed to acquire the acceleration
data from the STEVAL-MKI005V1:
1. connect the STEVAL-MKI005V1 to the USB port
2. start the STEVAL-MKI005V1 GUI
3. select the Virtual COM port and click on the “Connect” button (Figure 9, ref 1)
4. select the destination file to which the acceleration data must be saved by clicking
“Save” (Figure 9, ref 2) in Main Control section (optional)
5. use the Tab Menu to display the desired function
6. click on the “START” (or ”STOP”) button to activate (or stop) the sensor data collection,
saving to file, and screen plotting functions
7. to close the application, click on “Disconnect” and then click on “Exit”
UM0603 EK Lite
27/36
5 EK Lite
The installation pack also includes a “lite” version of the GUI together with its source code.
The source code can be found in the directory: ($Home)\STM\STEVAL-MKI005V1\STEVAL-
MKI005V1_lite, where ($Home) is the directory in which the software that comes with the
demonstration kit is installed (C:\Program Files by default).
The purpose of the lite version is to provide the user a base for the development of a
customized application.
The lite version of the demonstration kit is started by launching the STEVAL-MKI005V1 lite
executable file located in the STEVAL-MKI005V1 > Executables folder.
An example of the GUI of the EK lite application is shown in Figure 23.
Figure 23. STEVAL-MKI005V1 lite GUI
To use the software, follow these instructions:
1. Connect the STEVAL-MKI005V1 to the USB port
2. Launch the GUI for STEVAL-MKI005V1 lite
3. Select the Virtual COM port and click on the “Connect” button
4. Select the destination file to which the acceleration data must be saved (optional)
5. Click on the “START” (or ”STOP”) button to activate (or stop) the sensor data collection,
saving to file, and screen plotting functions
6. To close the application, click on “Disconnect” and then click on “Exit”
The GUI also gives read/write access to the registers embedded in the LIS3LV02DL device
and allows a single read of the acceleration data measured by sensor.
MEMS pointer UM0603
28/36
6 MEMS pointer
This section describes how to use a simple pointer application, which utilizes acceleration
data provided by the LIS3LV02DL MEMS 3-axis linear accelerometer to control the position
of a pointer on the screen of the PC. The software provided with the kit allows the
STEVAL-
MKI005V1 demonstration kit board to be used as an inertial mouse, where the tilt of the board is
translated into movement of the pointer. The board also emulates the left and right buttons of the
mouse.
6.1 GUI description
The GUI window (see Figure 24) is divided into two sections. The top section contains the
main controls to open the connection to the demonstration kit and to start/stop the data
acquisition (ref 1). The bottom section contains the demonstration kit details (device and
firmware, ref 2).
The section on the right shows the same data and the mouse speed control.
Figure 24. MEMS pointer demo
6.1.1 Left side: main controls
The buttons on the right side of the GUI and their related functions are described below:
1. Connect/Disconnect control - selects the COM port on which the EK board is
connected
2. Acquisition control - starts and stops acquisition
3. Exit - exits the MEMS pointer demo application
ref 1
ref 2
ref 3
ref 4
ref 5
ref 6
ref 7
UM0603 MEMS pointer
29/36
6.1.2 Left side: pointer application controls
The controls on the left side of the GUI and their related functions are as follows:
1. Left button/right buttons - indicates when the left/right button on the demonstration kit is
pressed (ref 3)
2. X/Y-position - shows the current x/y coordinates of the mouse pointer on the PC screen
(ref 4)
3. X/Y-deg - shows the tilt of the demonstration kit along the X and Y axes (ref 5)
4. Tilt control (ref 6) - Allows the user to select the direction of the vertical displacement
on the screen vs. the direction in which the board is tilted. For example, by selecting
“Up”, the pointer moves upward when the demonstration kit is tilted forward.
Conversely, by selecting “Down” the pointer moves downward when the board is tilted
backward.
5. Pointer speed - sets the sensitivity of the pointer to the inclination of the board (ref 7)
Supported commands UM0603
30/36
7 Supported commands
The microcontroller mounted on the STEVAL-MKI005V1 board is equipped with dedicated
firmware which supports a set of commands that allow the control of the 3-axis digital output
MEMS sensor and permit the acquisition of the measured acceleration data. The firmware
also handles the communication between the EK board and the PC through the USB bus.
These features allow users to easily write their own applications to exploit the capabilities of
the accelerometer.
This section describes the commands that are supported by the firmware for the
microcontroller of the STEVAL-MKI005V1 demonstration kit.
7.1 Getting started
Before using the commands supported by the firmware, the following procedure must be
performed:
1. Connect the STEVAL-MKI005V1 to the USB port
2. Launch an application which allows the sending of commands through the Virtual serial
port. The remainder of this document assumes the use of the Microsoft© Hyper
Terminal program integrated in the Windows® XP® operating system
3. Create a new connection, enter a name (ex. “STEVAL-MKI005V1”), and click “OK”
4. In the “Connect Using” field, select the Virtual COM port to which the USB port has
been mapped, and click “OK”
5. In Port Settings, set Bits per second to 115200, Data bits to 8, Parity to None, Stop bits
to 1, and Flow control to None. Click “OK”
6. In the Hyper Terminal select Files > Properties > Settings and then click onto the
“ASCII Setup” button
7. Select “Send line ends with line feeds” and “Echo typed characters locally”
8. Click the “OK” button to close the “ASCII Setup” window
9. Click the “OK” button to close the “Properties” window
Once this procedure has been completed the user can utilize the commands described in
the following sections by typing them into the “Hyper Terminal” window.
7.2 Supported commands
The table below lists the commands supported by the STEVAL-MKI005V1 firmware:
Table 1. Supported commands
Command Description Returned value
*start Starts continuous data acquisition s t xh xl yh yl zh zl I1 I2 s
*debug Returns the acceleration data in readable
text format x=XX y=YY z=ZZ
*stop Stops data acquisition
*rAA Register read RAAhDDh
UM0603 Supported commands
31/36
Note: AA: register address
DD: data
S: service field
XX, YY, ZZ: Acceleration data returned for the X, Y and Z axes
I1, I2 : interrupt value on each axes.
7.2.1 Start command
The *start command initiates the continuous data acquisition. When this command is sent to
the board, it returns the acceleration data measured by the LIS3LV02DL device. The
acceleration data are packed in a string composed of eight bytes: “s t X Y Z I1 I2 s”. The first
two bytes are always “s” and “t” which correspond to the hexadecimal values {73 74}, while
X” “Y” “Z” represent, respectively, the acceleration data for the X, Y, Z axes.
“I1” and “I2” contain the values of FF_WU_SRC and DD_SRC, where each bit is a specific
interrupt.
The last byte “s” returns information about the switches mounted on the board. Specifically,
bit#1 and bit#0 of the "service data" correspond to the status of SW3 and SW2 on the
demonstration kit board, and they are set to 1 when the corresponding switch is pressed.
7.2.2 Debug command
The *debug command starts the continuous data acquisition in debug mode. When this
command is sent to the board it returns the acceleration data measured by the LIS3LV02DL
device in readable text format. The values shown on the screen correspond to the content of
the output data registers and are shown as a hexadecimal number. A TAB is employed as a
separator between the different fields.
7.2.3 Stop command
The *stop command interrupts any acquisition session that has been started with either the
*start or *debug commands.
7.2.4 Register read
The *rAA command allows the contents of the LIS3LV02DL device registers in the
demonstration kit board to be read. AA, expressed as hexadecimal value and written upper-
case, represents the address of the register to be read.
*wAADD Register write
*bwAA<0:7><0|1> Single bit write
*Zon Force 3-state
*Zoff Exit from 3-state
*dev Device name LIS3LV02DL
*ver Firmware version 3LV02DL 1.0
Table 1. Supported commands (continued)
Command Description Returned value
Supported commands UM0603
32/36
Once the read command is issued, the board returns RAAhDDh, where AA is the address
sent by the user and DD is the data present in the register.
For example, to read the CTRL_REG1 the user would issue the command *r20, which
returns R20hC7h.
7.2.5 Register write
The *wAADD command is used to write to the contents of the LIS3LV02DL device registers.
AA and DD, expressed as hexadecimal values and written in upper-case, represent
(respectively) the address of the register and the data to be written. To write 0xC7 to the
CTRL_REG1, for example, the user issues the command *w20C7.
7.2.6 Single bit write
Using this command it is possible to set/reset a single bit in a given register. The command
*bwAA<0:7><0|1> requires the user to specify the address AA of the register in which to
change the bit, with AA expressed as a hexadecimal value and written in lower-case,
followed by the position of the bit to be changed, an integer between 0 and 7, and the value,
either 0 or 1, to be associated to the specified bit.
For example, to set the FS bit to 1 within the CTRL_REG2, the user would issue the
command *bw2171.
7.2.7 Zon and Zoff
The *Zon and *Zoff commands are employed respectively to put into 3-state (i.e. high-
impedance) and to exit (i.e. normal mode) the SPI lines of the ST7-USB microcontroller
mounted on the demonstration kit. These commands allow the isolation of the sensor from
the microprocessor in the event that an external control (from a different microcontroller
mounted on a separate board) is needed.
By default, when the kit is first turned on, the SPI lines are in 3-state mode and the user is
required to send the command *Zoff to allow the communication between the sensor and
the microcontroller.
7.2.8 Device name
The *dev command retrieves the name of the device mounted on the demonstration kit
connected to the PC. For the STEVAL-MKI005V1, the returned value is “LIS3LV02DL”.
7.2.9 Firmware version
The *ver command queries the demonstration kit and returns information on the version of
the firmware loaded in the microprocessor.
UM0603 Supported commands
33/36
7.3 Quick start
This section shows the basic sequence of commands to start a data communication session
and to retrieve the acceleration data from the demonstration kit:
1. Connect the STEVAL-MKI005V1 to the USB port
2. Start “Microsoft© Hyper Terminal” and configure it as described in section 7.1
3. Inside the “Hyper Terminal” window, enter the command *Zoff to enable the control of
the SPI line from the ST7-USB microcontroller
4. Send the *debug command to get the acceleration data measured from the sensor
5. Send *stop to end the continuous acquisition and visualization
Schematic diagram UM0603
34/36
8 Schematic diagram
The schematic diagram of the STEVAL-MKI005V1 demonstration kit is shown in Figure 25.
Figure 25. Schematic diagram of the STEVAL-MKI005V1 board
33p
Cosc2
3
3p
Co
sc11
1
2
2
M
M
H
H
z
z
Y
Y
o
o
s
cm
1
o
o
scin oscout
oscin
oscout
sck
miso
mosi
data_ready
cs_pad
12
2
34
5
5
6
7
7
8
91
1
0
0
I
I
C
C
P
P
J
J
2
2
i
i
c
c
c
c
d
d
ata
icccl k
n
n
R
R
E
E
SET
iccsel
1
1
0
0
k
k
R
R
i
i
c
c
c
c
se
l1 1
00n
C7
nRESET
1
2
2
3
4
5
6
7
SPI
J3
data_ready
miso
mosi
sck
cs_pad
V+ 1
D
D
M
M
2
2
DP 3
GND4
U
U
SB_
B
J
1
1
1
k
k
5
5
R
R
6
6
PB6
17
PB7
18
PA0
19
P
P
A
A
1
1
2
2
0
0
PA2
21
PA3
22
PA4
23
PA5
24
PA6
25
PA7
26
SS
27
MISO
28
MOSI
29
SCK
30
V
V
d
d
d
d
1
1
31
Vss1
32
P
C433
P
C534
P
P
C
C
6
6
35
PC7 36
P
P
D
D
0
0
37
P
P
D
D
1
1
38
PD23
9
P
P
D
D
34
0
O
O
C
C
M
M
P
P
1
1
4
4
1
1
O
O
C
C
M
M
P
P
2
2
4
4
2
2
AIN2 4
3
AIN344
AIN4 45
AIN5 46
AIN647
P
P
W
W
M
M
0
0
4
4
8
PWM1 49
Vpp/ICCSEL 50
R
R
E
E
SET 51
SCL 52
SDA 53
AIN0 54
A
A
I
I
N
N
1
1
5
5
5
5
USBEN 56
ICCCLK 57
ICCDATA 58
Vdd2 59
Vdda60
V
V
ssa 61
V
V
ss262
O
O
SCIN 63
OSCOUT 64
UVss
1
U
U
D
D
M
M
2
2
UDP
3
UVcc
4
UVdd
5
Vdd
f
6
Vssf
7
P
P
E
E
5
5
8
PE6
9
P
E7
10
PB
0
1
1
P
B
1
1
2
P
P
B
B
2
2
1
1
3
PB
3
14
P
P
B
B
4
4
1
1
5
5
P
P
B
B
5
5
1
1
6
6
ST7265X_TQFP64
U2
sck
miso
mosi
cs_pa
d
iccsel
iccclk
iccdata
+
1
0u
C1
1
1
0
0
0
0
n
n
C
C
4
4
47n
C8
1
80R
R1
VCC
2
2
2
2
0
0
n
n
C
C
9
9
10K
R7
1
1
0
0
K
K
R
R
8
+
4u7
C3
1
00n
C6
+
4
u7
C2
1
1
0
0
0
0
n
n
C
C
5
5
Rled
G
led
100R
R5
CS2
CS1
CS1
CS2
Vddf
Vddf
100R
R3
100R
R2
V
V
C
C
C
C
R
R
l
l
e
e
d
d
G
G
l
l
e
e
d
d
GR
D4
S
W2S
W3
NRe
se
t
SW1
D
D
1
1
D3
+
10u
C10
V
V
C
C
C
C
TP1
RDY/INT
1
res15
Vdd
13
res
12
Vdd
11
res
10
GND
9
CK
8
nc
7
CS
6
SCL/SPC
5
Vdd_IO
4
SDA/SDI/SDO
3
SDO
2
GND 1
6
GND
LIS3LV02DL
U1
Vddf
Vddf
data_ready
AM00685v1
AM00685v1
4
1
UM0603 Bill of materials
35/36
9 Bill of materials
Table 2 lists the bill of materials for the STEVAL-MKI005V1 demonstration kit.
Table 2. Bill of materials
Designator Description Comment Footprint
C1 Capacitor 10 µC C1206_POL
C2 Capacitor 4 µC C1206_POL
C3 Capacitor 4 µC C1206_POL
C4 Capacitor 100 nC 0805
C5 Capacitor 100 nC 0805
C6 Capacitor 100 nC 0805
C7 Capacitor 100 nC 0805
C8 Capacitor 47 nC 0805
C9 Capacitor 220 nC 0805
C10 Capacitor 10 µC C1206_POL
Cosc1 Capacitor 33 pC 0805
Cosc2 Capacitor 33 pC 0805
D1 Led SMD_LED green SMD_LED
D2 Led SMD_LED 3C SMD_LED_3C
D3 Led SMD_LED green SMD_LED
D4 Led SMD_LED red SMD_LED
J1 USB connector USB_B_mini USB_B_mini
J2 Header, 5X2 ICP HEADER_5X2_A
J3 Header, 7-Pin SPI HDR1X7
R1 Resistor 180 0805
R2 Resistor 100 0805
R3 Resistor 100 0805
R4 Resistor 100 0805
R5 Resistor 100 0805
R6 Resistor 1 k0805
R7 Resistor 10 k0805
R8 Resistor 10 k0805
Riccsel Resistor 10 k0805
SW1 Button NReset SMT_Button
SW2 Button SMT_Button SMT_Button
SW3 Button SMT_Button SMT_Button
U1 LIS3LV02DL TLGA_7x5x1
U2 ST72F651AR6T1E TQFP64_10x10
Yoscm1 Crystal 12 MHz OSC_SMD
Revision history UM0603
36/36
10 Revision history
Table 3. Document revision history
Date Revision Changes
07-Nov-2008 1 Initial release
UM0603
37/37
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2008 STMicroelectronics - All rights reserved
STMicroelectronics group of companies
Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan -
Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America
www.st.com