UM0382 User guide
EK3LV02DQ Evaluation Kit
Introduction
The EK3LV02DQ is an Evaluation Kit designed to provide to the user a complete, ready-touse platform for the evaluation of the LIS3LV02DQ, a low-power 3-Axis linear accelerometer with digital output that includes a sensing element and an IC interface able to take information from the sensing element and to provide the measured signal to the external world. Besides the MEMS sensor, the evaluation board mounts an ST7-USB microcontroller which acts like a bridge between the sensor and the personal computer on which it is possible to run either a Graphical User Interface delivered with the kit itself or dedicated SW routines that implements customized applications. This user manual describes the HW composing the evaluation kit and gives the informations required to install and to run the evaluation kit user interface. For any detail about the features implemented by the LIS3LV02DQ sensor refer to LIS3LV02DQ datasheet and to the Application Note AN2041
January 2007
Rev 2
1/32
www.st.com
Contents
UM0382
Contents
1 2 Evaluation kit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 EK3LV02DQ GUI installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 2.2 2.3 PC system requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3
Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1 3.2 3.3 3.4 Connecting to Virtual the COM port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Registers Read/Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Direction detection demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4.1 3.4.2 Single Acquisition mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Continuos Acquisition mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5
About_EK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 5 6
Data acquisition quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 EK lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 MEMS pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.1 GUI description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.1.1 6.1.2 Right Side: Main Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Left Side: Pointer Application Controls . . . . . . . . . . . . . . . . . . . . . . . . . 24
7
Supported commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.1 7.2 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Commands Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.2.1 7.2.2 7.2.3 Suppor ted Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Acquisition Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Configuration Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.3
Main communication command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8
2/32
Schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
UM0382
Contents
9 10
Bill Of Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3/32
List of tables
UM0382
List of tables
Table 1. Table 2. Table 3. Table 4. Table 5. Acquisition command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Configuration Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Data Field 1 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Bill Of Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4/32
UM0382
List of figures
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. Evaluation board block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Top silk-screen for EK3LV02DQ kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Board photograph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Notify icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Driver installation through the device manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 USB driver installation with the Hardware Update Wizard . . . . . . . . . . . . . . . . . . . . . . . . . 10 Virtual COM driver port assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Graphical User Interface: main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Registers Read/Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 EK Demo Mode window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Threshold definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Single Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Continuos Data "Acquisition Control" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Plot Data and Show Data windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Board Axis Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Bar Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Inclinometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Axis Inclination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Map Browsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Evaluation Kit Info and About window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 EK3LV02DQ Lite GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 MEMS Pointer Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Axis Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Schematic diagram for EK3LV02DQ board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5/32
Evaluation kit description
UM0382
1
Evaluation kit description
The EK3LV02DQ is an Evaluation Kit designed to provide the user with a complete, readyto-use platform for the evaluation of the LIS3LV02DQ, a low-power 3-Axis linear accelerometer with digital output. The block diagram of the evaluation kit is given in Figure 1. Figure 1. Evaluation board block diagram
Control Switches (Left, Right and Reset)
MEMS Sensor
SPI ST72F651 C
USB
USB Connector
Power On LED Data Ready LED General Purpose LED
Besides the MEMS sensor, the evaluation board mounts an ST7-USB microcontroller which acts like a bridge between the sensor and the personal computer on which it is possible to run either a Graphical User Interface delivered with the kit itself or dedicated SW routines that implements customized applications. Few switches and LED indicators are also present to control and to monitor the functionality of the board itself. The top silk-screen of the board and the photo of the full board are shown respectively in Figure 2 and in Figure 3.
6/32
UM0382 Figure 2. Top silk-screen for EK3LV02DQ kit
Evaluation kit description
Figure 3.
Board photograph
In order to operate the EK3LV02DQ evaluation kit it is required the installation of a dedicated driver which is delivered onto the CD accompanying the kit itself together with a GUI interface which allows a simple interaction with the sensor itself. The steps that must be followed to install the driver and the SW are described in the following section 2.2.
7/32
EK3LV02DQ GUI installation
UM0382
2
EK3LV02DQ GUI installation
The installation of Graphical User Interface (GUI) for the EK3LV02DQ implies two steps: the installation onto the PC of the Software delivered with the evaluation kit; the installation of the Virtual COM driver needed to use the Evaluation Kit board.
2.1
PC system requirements
Both the hardware and software that compose the EK3LV02DQ Evaluation Software Kit have been designed to operate with: Microsoft Windows XP; Microsoft.NET Framework 1.1 (or higher); this software can be downloaded for free from the Microsoft web site (a). The installation of the "Microsoft.NET Framework" is not required when running on windows XP SP2 or higher.
2.2
Software installation
To install the SW distributed along with the EK3LV02DQ evaluation kit: 1. 2. 3. 4. inser t the MiniCD delivered with the Kit inside the CD-ROM drive; if the Autorun screen does not appear, click on Start > Run, enter "D:\Autorun.exe" and click OK. "D" represents the letter of your CD-ROM drive; click onto "Evaluation Kit SW Installation" from the "EK3LV02DQ Evaluation Kit" page which appears; follow the instructions given by the Installer (Figure 4). Software installation
Figure 4.
a. http://www.microsoft.com/downloads and search for.Net framework Redistributable Package.
8/32
UM0382
EK3LV02DQ GUI installation
2.3
Hardware installation
To install the virtual COM driver insert the Evaluation Kit board into a free USB port, look at the "Notify" icon (Figure 5) and than wait for "Hardware Update Wizard". Figure 5. Notify icon
If the "Hardware Update Wizard" appears as shown in Figure 7 then follow the instructions given in Figure 7; otherwise follow the instructions indicated in Figure 6 and Figure 7. Figure 6. Driver installation through the device manager
Right click on "ST MEMS UNIT" and choose for Update driver
Right click on My Computer 1
2
9/32
EK3LV02DQ GUI installation Figure 7. USB driver installation with the Hardware Update Wizard
UM0382
3 4
5
6
7
Once the installation has finished, a COM port number will be assigned to the ST Virtual Com driver (Figure 8). The knowledge of this number is required to run the EK3LV02DQ Evaluation Software GUI. For additional details, check section 3.1.
10/32
UM0382 Figure 8. Virtual COM driver port assignment
EK3LV02DQ GUI installation
11/32
Graphical User Interface
UM0382
3
Graphical User Interface
To execute the EK3LV02DQ Evaluation Software Graphical User Interface: 1. 2. 3. click on Start > All Programs; select the folder EK3LV02DQ > Executables; launch the program "EK3LV02DQ Ver.1.0".
With these operations the GUI main window will appear (Figure 9); the window is composed of four main sections as detailed below: 1. 2. 3. 4. the graphical panel (ref1), where the data coming from the sensor are graphically represented; the upper-right corner of the window (ref2), which allows to open and to close the communication port of the PC connected to the Evaluation Kit; the right side, which contains the "Register Read/Write" and "Direction Detection Demo" (ref3), "Single Acquisition" (ref4) and "About EK" (ref5) blocks; the bottom of the window, which handles the continuous acquisition of the acceleration data and displays them inside the graphical panel (ref6). Graphical User Interface: main window
Figure 9.
ref1 ref2 ref3
ref4
ref5
ref6
12/32
UM0382
Graphical User Interface
3.1
Connecting to Virtual the COM port
Before using the functions of the Evaluation Kit Software it is necessary to open the connection with the EK3LV02DQ board. This is achieved through the following procedure: 1. 2. connect the EK3LV02DQ to desired USB port; in the pop-menu "USB ---> Virtual COM" choose the Virtual COM number on which the board has been mapped. For additional information on how to get this value check section 2.3; open the connection by clicking on "Connect" (Figure 9 ref2). Once this procedure is completed, the General Purpose LED of the board will switch from red to green.
3.
Once the procedure has been completed, the user can acquire, plot and save the acceleration data measured by the sensor and he/she can access the content of the registers embedded in the device. Further details about each single function are provided in the sections hereafter. Note: Due to Virtual COM driver communication speed limits, the maximum Output Data Rate allowed for the device is 640 Hz. Higher Output Data Rate could result in a possible data loss.
3.2
Registers Read/Write
Through the "Register Read/Write" panel (Figure 9, ref3), the user can either directly write or read the registers value inside the LIS3LV02DQ device. In particular, by clicking on the "Read/Write" button a new window appears (Figure 10). To perform a register read out, the user must select the desired register name into "Reg Name" pop up menu (ref4) and then he/she must click on the "Read" button (ref2). The result of the reading will appear in the text box "Reg Value" (ref3). To write a data into a register, the user must select the desired register name (ref4), choose the desired value in the text box "Reg Value" (ref3) and then click on the "Write" button (ref1). In case of read-only registers, the write button is not enabled. Figure 10. Registers Read/Write
ref4 ref3
ref1 ref2
13/32
Graphical User Interface
UM0382
3.3
Direction detection demo
The LIS3LV02DQ allows the implementation of motion-controlled functions such as gaming and terminal control while requiring reduced computational power to the application controller. The device, in fact, may be programmed to generate an interrupt signal when a tilt is detected and to return the information of the direction in which the sensor has been tilted. With the same feature the LIS3LV02DQ sensor is able to return the information about the spatial orientation of the board without requiring the reading and the further post-processing of the acceleration data. This feature is demonstrated through the Direction Detection demo mode panel (Figure 11) which is activated by clicking on the "Dir Detect" button present in the main GUI window. Figure 11. EK Demo Mode window
ref2
ref1
ref4
ref 3
ref5
In order to configure the event which will trigger the interrupt event, the user must select the desired inner/internal and outer/external threshold (ref1), defining in this way an hysteresis region that allows to avoid false detections and/or bouncing produced for example by either spurious vibration or tremor. Whenever the inner thresholds is greater than the outer one, the hysteresis region will be null and the threshold employed to detect the tilt direction will be the outer one. A graphical representation of the internal and external thresholds is given in Figure 12. Whenever the absolute value of the acceleration signal measured by the sensor either exceeds the outer threshold or returns below the inner threshold an interrupt signal will be generated and the General Purpose green LED will blink. If the user wants to detect the orientation changes removing the DC level of the acceleration signal applied to the device (i.e. removing the gravity vector), it is possible to enable the High Pass Filter embedded inside the device by acting on the "High Pass Filter" pop-up menu (Figure 11, ref2). The cut-off frequency of the filter, which is shown inside the Cutoff Frequency text box (ref5), is user selectable acting on the High Pass coefficients (ref3) and on the Output Data Rate (ODR). For further details, please refer to AN2041. To start the Direction Detection demo mode click on "Start Direction Detection" (ref4).
14/32
UM0382 Figure 12. Threshold definition
Graphical User Interface
3.4
Data Acquisition
The Data Acquisition panel is split in two sections: 1. 2. "Single Acquisition" mode (Figure 9, ref4); "Continuos Acquisition" mode (Figure 9, ref6).
3.4.1
Single Acquisition mode
The "Single Acquisition" mode panel allows the user to perform the measurement of the acceleration acting on all the three axes. A single read of the acceleration data measured by the device is done by clicking on the "Acquisition" button (Figure 13, ref1). This panel allows also to activate and to disable the Self-Test function of the device using the two radio buttons "Self Test ON" and "Self Test OFF" (Figure 13, ref2). Whenever the self-test is activated, the proof mass of the sensor is electrostatically deflected and the acceleration data measured by the sensor will exhibit a change in their DC level as specified on the datasheet of the part. This function allows to check whether the sensor is working properly without requiring any mechanical movement of the board mounting the sensor itself. Figure 13. Single Data Acquisition
ref2 ref1
15/32
Graphical User Interface
UM0382
3.4.2
Continuos Acquisition mode
The section related to "Continuos Acquisition" allows the user to perform a sequence of acquisitions, to plot and to save the acquired acceleration data under different formats. In order to start and to stop the data acquisition (and to activate the plotting of data in the afore said panels) it is necessary to push onto the "START/STOP" button (Figure 14, ref2). Figure 14. Continuos Data "Acquisition Control"
ref3 ref4 ref2 ref5
ref1
ref6
ref7
ref8
During a Continuous Acquisition Mode, the user can watch the data coming from the EK3LV02DQ in different graphical windows(b). The windows corresponding to "Plot Data" and "Show Data" are shown in Figure 15. Figure 15. Plot Data and Show Data windows
The sign of the acceleration measured by the sensor is related to the axis definition given in Figure 16.
b. The computational power of the PC on which the GUI is running may affect the maximum number of windows that can be opened at the same time.
16/32
UM0382 Figure 16. Board Axis Definition
Z
Graphical User Interface
USB CONNECTOR
Y
X
Clicking on the "Setup" button (Figure 14, ref1) the "Acquisition Setup" window will open. This window allows to program the output data rate of the LIS3LV02DQ device. By default it is set to 40Hz (corresponding to a signal bandwidth @ -3dB of 10Hz); to modify this parameter the user has to select the desired value from the related pop up menu (Figure 14, ref3). The "Acquisition Setup" window allows to change also the device Full Scale (Figure 14, ref4) and to put in tri-state mode the SPI (serial interface) lines of the microcontroller (Figure 14, ref5). The latter feature has been implemented to guarantee to advanced users the fullcontrol of the MEMS lines through a different source (i.e. from a separate controller). The section related to "Graphics Amplification" (Figure 14, ref6) allows to zoom the data plotted on the screen. Please notice that the horizontal and vertical gains do not change the resolution of the device; they only impact the way in which data are shown on the screen. Last but not least, the "Acquisition Setup" window allows the user to select the file where the acquired data values have to be stored (Figure 14, ref7). In particular, the file in which the data are saved reports the informations about each acquisition session and contains the acquired samples in three different fields. In order to apply the settings defined with the "Acquisition Setup" window it is necessary to push on the "OK" button (Figure 14, ref8). These settings will be used for any subsequent acquisition (until their next modification) and can not be changed while the acquisition is running. The main panel of the GUI allows also to plot the acceleration data in three ways (Figure 9, ref6):
17/32
Graphical User Interface 1. as a Bar Chart (Figure 17);
UM0382
Figure 17. Bar Chart
2.
as Inclinometers (Figure 18), where the inclination is related to the axes definition given in Figure 19;
Figure 18. Inclinometer
Figure 19. Axis Inclination
+90
0 x,y,z
horizontal plane
-90
18/32
UM0382
Graphical User Interface
3.
to navigate through a map (Map Browsing) (Figure 20). The image to be shown is selected through the "Load Image" button. A map stored inside the file "mapamundi.jpg" is provided as an example.
Figure 20. Map Browsing
3.5
About_EK
Clicking on the "About_EK" button located into the "About EK" section (Figure 9, ref5) it is possible to obtain informations about the version of the GUI, about the firmware running on the Evaluation Kit and about the version MEMS accelerometer mounted onto the board. These information are retrieved by using the buttons "Mounted Device" and "Software Version" which are shown in "Evaluation Kit Info" window (Figure 21). Once the information about the device are displayed on the screen it is possible to get an explanation of their meaning by moving the mouse over the different parts of the device name (LIS 3LV 02 DQ). Please notice that if the connection is not working properly an error message will be shown. This feature allows to test the connection between the board and the host computer.
19/32
Graphical User Interface Figure 21. Evaluation Kit Info and About window
UM0382
The second button ("About") of the "About EK" section (Figure 9, ref5) opens the "MBU_info" window which shows general informations about the software and provides the user with a direct link to the ST MEMS page.
20/32
UM0382
Data acquisition quick start
4
Data acquisition quick start
This section describes the basic steps that have to be performed to acquire the acceleration data from the EK3LV02DQ: 1. 2. 3. 4. 5. 6. 7. 8. 9. connect the EK3L02DL to the USB port; start the EK3LV02DQ GUI; select the Virtual COM port and then click on the "Connect" button (Figure 9, ref2); select the destination file in which the acceleration data must be saved by clicking onto "Setup" (Figure 14, ref1) and "Destination File" (Figure 14, ref7) buttons; optionally select the desired decimation factor, Horizontal and Vertical gain and then click on the "OK" button (Figure 14, ref8); click on "Plot Data" or "Show Data" (Figure 9, ref6) to activate the corresponding Data Display window (Figure 15); click on "Browsing" button to activate the function of map browsing (Figure 9, ref6) and then load the desired image by clicking on "Load Image" button; click on "START" ("STOP") button to activate (stop) the collection of data from the sensor, their saving onto file and plotting on the screen; to close the application click on Disconnect and then click on Exit.
21/32
EK lite
UM0382
5
EK lite
The mini-CD delivered with the EK3LV02DQ contains also a lite version of the previous GUI together with its source code. The source code can be found in the directory: ($Home)\STM\EK3LV02DQ\EK3LVDQ_lite where ($Home) represents the directory in which the SW delivered with the evaluation kit has been installed (C:\Program Files by default). The intention is to provide to the user a guidance to the development of his/her own customized application. The evaluation kit is started by launching the executable EK3LV02DQ Lite which is contained in the EK3LV02DQ > Executables folder. The graphical aspect of the GUI associated to the application is shown in Figure 22. Figure 22. EK3LV02DQ Lite GUI
In order to operate the SW it is suggested to follow these instructions: 1. 2. 3. 4. 5. 6. 7. connect the EK3LV02DQ to the USB port start the GUI for EK3LV02DQ Lite; select the Virtual COM port and then click on the "Connect" button; optionally select the destination file in which the acceleration data must be saved by clicking onto "Setup" and "Destination File" buttons; click on "Plot Data" to activate the corresponding Data Display window; click on "START" ("STOP") button to activate (stop) the collection of data from the sensor, their saving onto file and plotting on the screen; to close the application click on Disconnect and then click on Exit.
The GUI allows also the Read/Write the registers embedded in the LIS3LV02DQ device mounted on the board and to perform a single read of the acceleration data measured by sensor.
22/32
UM0382
MEMS pointer
6
MEMS pointer
This section describes the usage of a simple pointer application which employes the acceleration data provided by the LIS3LV02DQ MEMS 3-axis linear accelerometer to control the position of a pointer on the screen of the PC. More in details, the SW provided with the kit itself allows to employ the board provided with the EK3LV02DQ Evaluation Kit as an inertial mouse where the tilt of the board is transformed into a movement of the pointer. The board emulates also the left and right buttons of the mouse.
6.1
GUI description
The GUI window (see Figure 23) may be split up into two sections: the right side contains the main controls to open the connection to the Evaluation Kit and to start/stop the data acquisition whereas the left side is dedicated to the pointer application controls. Figure 23. MEMS Pointer Demo
23/32
MEMS pointer
UM0382
6.1.1
Right Side: Main Controls
The buttons present on the right side of the GUI and their related function are described hereafter: Connection control: selects the COM port on which the EK board is connected to. Acquisition control: starts and stops the acquisition. Exit: exits from the MEMS Pointer Demo application.
6.1.2
Left Side: Pointer Application Controls
The controls present on the left side of the GUI and their related function are the followings: Left Button/Right Buttons: inform on whether the left/right button present on the Evaluation Kit is pressed. X/Y-Position: shows the actual x/y coordinates of the mouse pointer on the PC screen. X/Y-Deg: shows the tilt of the Evaluation Kit along the X and Y directions which are defined as depicted in Figure 24. Tilt Control: allows to select the direction of the vertical displacement on the screen Vs. the direction in which the board is tilted. In particular, by selecting UP the pointer will move upward by forward tilting the Evaluation Kit. Vice versa, by selecting DOWN the pointer will move downwards whenever the board is tilted backward. Pointer Speed: sets the sensitivity of the pointer to the inclination of the board.
Figure 24. Axis Orientation
Y
X
24/32
UM0382
Supported commands
7
Supported commands
The EK3LV02DQ board is equipped with a dedicated firmware which supports a set of commands that allow to control the 3-axis digital output MEMS sensor mounted on the board and to acquire the measured acceleration data. The firmware handles also the communication between the EK board and the PC through the USB bus. Through the usage of these commands it is possible to control the 3-axis digital output MEMS sensor mounted on the board and to acquire the measured acceleration data, thus allowing the user to easy write his/her own applications which exploit the mounted accelerometer. This section describes the commands that are supported by the firmware loaded onto the microcontroller of the EK3LV02DQ Evaluation Kit.
7.1
Getting Started
Before using the commands described in the next paragraphs, the following procedure must be performed: 1. 2. connect the EK3LV02DQ to the USB port; start an appropriate software which allows to send the command through the Virtual serial port. The remaining part of this document will suppose the usage of the "Hyper Terminal"; create a new connection; for example name it "EK3LV02DQ" and click OK; in the "Connect Using" field select the right Virtual COM port onto which the USB port has been mapped; set the port to 11500 Bit per second, 8 Data bits, Parity None, 1 Stop bit, Flow control None and then click OK.
3. 4. 5.
Once this procedure has been completed the user can send to the EK3LV02DQ the commands described in the following sections by typing the commands themselves in the "Hyper Terminal" window.
7.2
Commands Description
The EK3LV02DQ board is equipped with "eklvdq-ver1.0.0" firmware. This firmware supports a set of commands which allow to control the 3-axis digital output MEMS sensor mounted on the board and to acquire the measured acceleration data. The firmware handles also the communication between the EK board and the PC. In particular the communication of the EK3LV02DQ evaluation kit is implemented upon USB ver 2.0.
7.2.1
Supported Commands
The commands supported by the EK3LV02DQ FW are divided into two different classes: Acquisition commands; Configuration commands.
25/32
Supported commands
UM0382
Each command sent to the Evaluation Kit is composed of four fields. Before and between the different field it is located a fixed code "ek" ASCII "65hex 6Bhex", the whole string is reported below:
65h 6Bh OpCode 65h 6Bh DF 1 65h 6Bh DF2 65h 6Bh DF3
The "OpCode" (Operative code) field defines the command given to the evaluation kit, while DF1, DF2 and DF3 defines the commands attribute, the fixed field is used as a trigger for the communication. In the next paragraphs will be explained only the OpCode and DF.
7.2.2
Acquisition Commands
The commands belonging to the Acquisition class commands are described in the following table: Table 1. Acquisition command
Cmd Code Cmd name ASCII Star t Stop SD SV DI Oonn Ooff Ooua Oovs Oodi Hex 4F 6F 6E 6E 4F 6F 66 66 4F 6F 75 61 4F 6F 76 73 4F 6F 64 69 star t data acquisition stop data acquisition single data acquisition retrieve EK software version retrieve device information Description
Start: the start command is used to start data acquisition. When the start command is sent the board returns the acceleration data measured by the LIS3LV02DQ device. In particular the output string is composed of eight bytes: "s t Xh Xl Yh Yl Zh Zl SD". The first two bytes "s" and "t" are always the hexadecimal values {73 74}, while "Xh" "Yh" "Zh" represent the upper part of the acceleration data on the X, Y, Z axes and "Xl" "Yl" "Zl" describe the lower part of the acceleration data on the X, Y, Z axes, the "SD" "Service Data" gives to the user further information about the switches mounted on the board: in detail bit#1 and bit#0 of the "service data" correspond to switches SW3 and SW2 on the Evaluation Kit board (see EK3LV02DQ_User_Guide_ver.1.0.pdf). Stop: the stop command is used to interrupt the acquisition session. SD: the SD command activate a single data coming from LIS device. The output string is the same of the start and F start command but the output string is sent just one time. SV: the SV command is used to retrieve the version of the firmware loaded onto the Evaluation Kit. The output is an ASCII string looking like this: "eklvdq-vx.x.x". DI: the DI command is used to retrieve informations about the MEMS device mounted on the Evaluation Kit Board. The output is an ASCII string looking like this: "LIS3LV02DQ QFN 28".
26/32
UM0382
Supported commands
7.2.3
Configuration Commands
The Configuration class commands are described in the following table. Table 2.
Cmd ASCII Write WriteBit Read ReadBit Set w (adr) (data) (xxx) W (adr) (bit #) (t/f) r (adr) (xxx) (xxx) R (adr) (bit #) (t/f) S(DF1)(DF2)(DF3) Hex 77 (adr) (data) (xxx) 57 (adr) (bit #) (t/f) 72 (adr) (xxx) (xxx) 52 (adr) (bit #) (t/f) 53 (DF1) (DF2) (DF3) write data byte into register adr write bit # into the reg adr read data byte from register adr read bit # from reg adr special mode setting
Configuration Command
Command Code Description
Write: this command is used to write a byte inside an accelerometer register. The address is identified by the byte (adr) while the data to be written is represented by the third field (data).
WriteBit: this command is used to write a single bit inside an accelerometer register at position bit #. The address is identified by the byte (adr) while the data to be written is represented by the third field (t/f) true (to set the bit high) and false (reset the bit) where the two data are t {74} and f {66}.
Read: read command allows to read the data present inside the LIS device register. The (adr) value is the EK3LV02DQ register address that the customer desires to read. The output string is composed by nine fields "RV reg_data reg_adr", with R and V is the string with value {52 56}, the reg_data is the register content and reg_adr is its address. The other five fields can be considered as don't care.
ReadBit: read command allows to read the data present inside the EK3LV02DQ device register. The (adr) value is the LIS register address of the register that the customer desires to read. The output string is composed by "bit#7 bit#6 bit#5 bit#4 bit#3 bit#2 bit#1 bit#0 reg_data ", where bit#0....bit#7 are the eight bit contained in the register with address given by reg_adr.
Set: this command allows the user able to change some settings of the firmware of the Evaluation Kit. DF1, Data Field1, is used to identify which feature the user wants to change; DF2, Data Field 2 and DF3, Data Field 3 contains the new data value to associate to the function specified by DF1. In particular DF1 is composed by the following configuration command:. Table 3.
Cfg Cmd ASCII 3-state A Hex 41 SPI three state function
Data Field 1 configuration
Cfg Code Description
27/32
Supported commands
UM0382
7.3
Main communication commands
This section shows the basic sequence of commands to start a data communication session and to retrieve the acceleration data from Evaluation kit:
The first step is to connect the board and to bring the microcontroller out from 3-state mode: ek S ek A ek 0 ek 0 (ASCII) --> 65 68 53 65 68 41 65 68 30 65 68 30 (Hex)
with these two command user can start the single data acquire session:
ek O ek o ek u ek a (ASCII) --> 65 68 4F 65 68 6F 65 68 75 65 68 61 (Hex)
or continue data acquisition:
ek O ek o ek n ek n (ASCII) --> 65 68 4F 65 68 6F 65 68 6E 65 68 6E (Hex)
the command to stop the acquire session is:
ek O ek o ek f ek f (ASCII) --> 65 68 4F 65 68 6F 65 68 66 65 68 66 (Hex)
In the same way the user can retrieve informations from the Evaluation Kit such as the version of the Firmware loaded onto the microcontroller.
Note:
The commands supported by the Evaluation Kit are intended for the usage with a dedicated SW written by the user and running on PC. The method described above involving the usage of the hyper terminal is only intended to help the user to understand how to handle the communication with the board and not to acquire, to set and to manipulate data.
28/32
8
UM0382
MPD
A ppl icati on Lab. EK 3LV 02DQ
D1
R1 180R
USB_B Vd df D3 D4 c 6 4o s out 6 3o s i n c 62 61 60 59 5 8ic cdata 5 7ic cclk 56 55 54 53 52 5 1n RESET 5 0ic cs l e 49 R G R5 100R dat a_ready
Schematic diagram
R2 100R 1 2 3 4 5 6 7
R3 100R
NC NC NC NC NC NC NC
V+ DM DP GND Vd df C5 100nF NC GND Vd d Reserved GND RDY/ INT NC
28 27 26 25 24 23 22
J1
VCC
1 2 3 4
C1 10uF
U1 LI S3LV0 2DQ
+
C4 C2 100nF 4u7F +
U2 ST7 26 5X_TQFP6 4 Gl ed Rled
R6 1K 5 oscin Yo scm1 Cosc1 33pF 12M Hz Cosc2 33pF oscout
Vd df
Rled Gl ed
Figure 25. Schematic diagram for EK3LV02DQ board
21 20 19 18 17 16 15 NC SDO SDA/ S I/ SDO D V dd_I O SCL/SPC CS NC NC Reserved Vd d Reserved GND CK NC Vd df
C8 47nF
C9 220nF
C10 + 10uF
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
PB6 PB7 PA 0 PA 1 PA 2 PA 3 PA 4 PA 5 PA 6 PA 7 SS MI SO MO SI SCK Vd d 1 V s s1 UV ss UD M UD P UV cc UV dd Vd d f Vs sf PE 5 PE 6 PE 7 PB0 PB1 PB2 PB3 PB4 PB5 PW M 0 AI N 6 AI N 5 AI N 4 AI N 3 AI N 2 OC M P 2 OC M P 1 PD 3 PD 2 PD 1 PD 0 PC 7 PC 6 PC 5 PC 4
OS C OU T OS C I N V ss2 V ssa Vd d a Vd d 2 I CCD A T A ICC C L K U S B EN AI N 1 AI N 0 SD A SCL RE SE T V pp /I CCSE L PW M1
48 47 46 45 44 43 42 41 40 39 38 37 36 CS1 35 CS2 34 33
VCC
17 18 19 20 cs_ p a 2 1 d 22 23 d ata_ rea d 2 4 25 26 27 28 29 30 31 32
V ddf mi so mosi sck
+ C3 4u7F C6 100nF CS2 CS1 sck mi so mosi d ata_ ready cs_ p a d VCC
J2 iccdata iccclk nRESET iccsel 1 3 5 7 9 ICP TP1 2 4 6 8 10 Riccsel 10K SW1 NRese t C7 100nF
R7 10K
R8 10K
SW2
SW3 7 6 5 4 3 2 1
mi so mosi V ddf sck cs_ p a d
8 9 10 11 12 13 14
The schematic diagram of the EK3LV02DQ evaluation kit is shown in Figure 25.
Schematic diagram
J3 SPI
29/32
Bill Of Material
UM0382
9
Bill Of Material
The Bill of Material for the EK3LV02DQ evaluation kit is given in Table 4. Table 4. Bill Of Material
Description Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor LED_SMD LED_SMD LED_SMD USB connector Header, 5x2 Header, 7-Pin Resistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Button Button Button Accelerometer ST7 microcontroller Crystal Comment 10u 4u7 4u7 100n 100n 100n 100n 47n 220n 10u 33p 33p SMD_LED red SMD_LED green SMD_LED red/green USB_B ICP SPI 180R 100R 100R 100R 1k5 10K 10K 10k NReset SMT_Button SMT_ButtonQ LIS3LV02DQ ST72F651AR6T1E 12MHz Footprint C1206_POL C1206_POL C1206_POL 0805 0805 0805 0805 0805 0805 C1206_POL 0805 0805 SMD_LED SMD_LED SMD_LED_3C USB_B HEADER_5X2_A HDR1X7 0805 0805 0805 0805 0805 0805 0805 0805 SMT_Button SMT_Button SMT_Button QFN28LD_NODIE5x5 TQFP64_10x10 OSC_SMD
Designator C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 Cosc1 Cosc2 D1 D3 D4 J1 J2 J3 R1 R2 R3 R5 R6 R7 R8 Riccsel1 SW1 SW2 SW3 U1 U2 Yoscm1
30/32
UM0382
Revision history
10
Revision history
Table 5.
Date 2-Jan-2007 26-Jan-2007
Document revision history
Revision 1 2 Initial release. The document now contains the User Manual, the Command Description, the Schematic and the BOM. Changes
31/32
UM0382
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.
2007 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
32/32
|