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. November 2008 Rev 1 1/37 www.st.com Contents UM0603 Contents 1 Demonstration kit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 STEVAL-MKI005V1 GUI installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 2.1 PC system requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 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 7 2/37 GUI description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.1.1 Left side: main controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.1.2 Left side: pointer application controls . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Supported commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.2 Supported commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 UM0603 Contents 7.3 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 Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 8 Schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 9 Bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 10 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3/37 List of figures UM0603 List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. Figure 21. Figure 22. Figure 23. Figure 24. Figure 25. 4/37 Demonstration board block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Top silk-screen of the STEVAL-MKI005V1 kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Board photograph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Notify icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Driver installation using the device manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 USB driver installation using the hardware update wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Virtual COM driver port assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Graphical User Interface: main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Options tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Register setup tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Bars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Bars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Plot tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Plot tab - Zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Data tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Inclinometer tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Axis inclination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Map Browsing tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 FFT tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Interrupt tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Direction detection tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 STEVAL-MKI005V1 lite GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 MEMS pointer demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Schematic diagram of the STEVAL-MKI005V1 board . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 UM0603 1 Demonstration kit description 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 Control Switches (Left, Right and Reset) MEMS Sensor SPI USB ST72F651 C USB Connector Power On LED Data Ready LED General Purpose LED 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. 5/36 Demonstration kit description Figure 2. Top silk-screen of the STEVAL-MKI005V1 kit Figure 3. Board photograph UM0603 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. 6/36 UM0603 2 STEVAL-MKI005V1 GUI installation STEVAL-MKI005V1 GUI installation The installation of the graphical user interface (GUI) for the STEVAL-MKI005V1 requires two steps: 2.1 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. PC system requirements Both the hardware and software that compose the STEVAL-MKI005V1 demonstration kit have been designed to operate with Microsoft(R) Windows XP and Microsoft(R) 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 7/36 STEVAL-MKI005V1 GUI installation 2.3 UM0603 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 Right click on My Computer Right click on "ST MEMS UNIT" and choose Update driver 1 2 8/36 UM0603 STEVAL-MKI005V1 GUI installation Figure 7. USB driver installation using the hardware update wizard 3 4 6 5 7 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 STEVALMKI005V1 demonstration software GUI. For additional details, see section 3.1. 9/36 STEVAL-MKI005V1 GUI installation Figure 8. 10/36 Virtual COM driver port assignment UM0603 UM0603 3 Graphical user interface 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 3 ref 2 ref 1 ref 5 ref 4 11/36 Graphical user interface UM0603 The functions of the four main sections of the window are described below: 3.1 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 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. 12/36 UM0603 3.3 Graphical user interface "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 5 ref 2 ref 6 ref 3 ref 7 ref 8 ref 4 13/36 Graphical user interface 3.4 UM0603 "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: Note: 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 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 14/36 UM0603 3.5 Graphical user interface "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 15/36 Graphical user interface UM0603 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. 16/36 UM0603 Graphical user interface Figure 14. Plot tab ref 1 ref 2 17/36 Graphical user interface Figure 15. Plot tab - Zoom 1) Select one point on the screen and click the LEFT mouse button 2) Holding 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 18/36 UM0603 UM0603 3.7 Graphical user interface "Data" tab The Data tab (Figure 16) shows the acceleration values measured by the LIS3LV02DL sensor. The tab is divided into three boxes: Note: 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 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 19/36 Graphical user interface 3.8 UM0603 "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 +90 0 x,y,z -90 20/36 horizontal plane UM0603 3.9 Graphical user interface "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) 21/36 Graphical user interface UM0603 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. 22/36 UM0603 3.10 Graphical user interface "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). 23/36 Graphical user interface UM0603 Figure 21. Interrupt tab ref 1 3.12 ref 2 ref 3 "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). 24/36 UM0603 Graphical user interface Figure 22. Direction detection tab ref 1 ref 2 ref 3 25/36 "Data acquisition" quick start 4 UM0603 "Data acquisition" quick start This section describes the basic steps that must be performed to acquire the acceleration data from the STEVAL-MKI005V1: 26/36 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 5 EK Lite 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\STEVALMKI005V1_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. 27/36 MEMS pointer 6 UM0603 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 STEVALMKI005V1 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 ref 1 ref 2 ref 3 ref 6 ref 4 ref 7 ref 5 6.1.1 Left side: main controls The buttons on the right side of the GUI and their related functions are described below: 28/36 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 UM0603 6.1.2 MEMS pointer 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) 29/36 Supported commands 7 UM0603 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(c) Hyper Terminal program integrated in the Windows(R) XP(R) 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 *start *debug 30/36 Description Starts continuous data acquisition Returns the acceleration data in readable text format *stop Stops data acquisition *rAA Register read Returned value s t xh xl yh yl zh zl I1 I2 s x=XX y=YY z=ZZ RAAhDDh UM0603 Supported commands Table 1. Supported commands (continued) Command Note: Description *wAADD Register write *bwAA<0:7><0|1> Single bit write Returned value *Zon Force 3-state *Zoff Exit from 3-state *dev Device name LIS3LV02DL *ver Firmware version 3LV02DL 1.0 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 uppercase, represents the address of the register to be read. 31/36 Supported commands UM0603 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. highimpedance) 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. 32/36 UM0603 7.3 Supported commands 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(c) 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 33/36 34/36 UVss UDM UDP UVcc UVdd Vddf Vssf PE5 PE6 PE7 PB0 PB1 PB2 PB3 PB4 PB5 iccdata iccclk SW2 SW3 R8 10K C3 4u7 PWM0 AIN6 AIN5 AIN4 AIN3 AIN2 OCMP2 OCMP1 PD3 PD2 PD1 PD0 PC7 PC6 PC5 PC4 + C6 100n VCC 48 47 46 45 44 43 42 41 40 39 38 37 36 CS1 35 CS2 34 33 cs_pad U2 ST7265X_TQFP64 G J3 SPI Cosc1 33p 7 6 5 4 3 2 1 R3 100R 12MHz Yoscm1 R Rled oscin Gled D4 R2 100R Vddf CS2 CS1 sck miso mosi data_ready cs_pad Cosc2 33p oscout iccdata iccclk nRESET iccsel Riccsel1 10k 10 11 12 13 14 ICP 2 4 6 8 10 SW1 NReset 15 TP1 VCC 1 3 5 7 9 J2 sck Vddf mosi miso data_ready C7 100n RDY/INT SDO GND SDA/SDI/SDO Vdd Vdd_IO res Vdd res R7 10K C5 100n GND + C10 10u + cs_pad 1 220n C9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 C4 C2 100n 4u7 CS SCL/SPC 2 Rled Gled Vddf + res GND 3 C8 47n R6 1k5 C1 10u VCC CK USB_B 1 V+ 2 DM 3 DP 4 GND J1 R1 180R nc oscout oscin 9 4 nRESET iccsel 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 8 5 OSCOUT OSCIN V ss2 V ssa Vdda Vdd2 ICCDATA ICCCLK USBEN A I N1 AIN0 SDA SCL RESET Vpp/ICCSEL PWM1 7 6 PB6 PB7 PA0 PA 1 PA2 PA3 PA4 PA5 PA6 PA7 SS MISO MOSI SCK V dd1 Vss1 R5 100R 17 18 19 20 21 22 23 data_ready 24 25 26 27 28 29 30 31 32 8 Vddf miso mosi sck D1 Schematic diagram UM0603 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 D3 U1 LIS3LV02DL 16 AM00685v1 UM0603 9 Bill of materials 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 k 0805 R7 Resistor 10 k 0805 R8 Resistor 10 k 0805 Riccsel Resistor 10 k 0805 SW1 Button NReset SMT_Button SW2 Button SMT_Button SMT_Button SW3 Button SMT_Button SMT_Button LIS3LV02DL TLGA_7x5x1 ST72F651AR6T1E TQFP64_10x10 12 MHz OSC_SMD U1 U2 Yoscm1 Crystal 35/36 Revision history 10 UM0603 Revision history Table 3. 36/36 Document revision history Date Revision 07-Nov-2008 1 Changes Initial release UM0603 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. (c) 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 37/37