AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction

Similar documents
AN2667 Application note

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

AN2855 Application note

AN4113 Application note

AN2672 Application note

AN626 Application note

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

AN2676 Application note

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

AN2143 Application note

EV-VNQ5E050AK VNQ5E050AK evaluation board

STTS V memory module temperature sensor. Features

AN3996 Application Note

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description

AN3279 Application Note

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

MEMS functional sensor: smart 3D orientation and click detection standalone device. FC30-40 to +85 LGA-14 Tray FC30TR -40 to +85 LGA-14 Tape and reel

SOT23-6L ESDALCL6-2SC6

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

AN2261 APPLICATION NOTE

AN3354 Application note

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

AN2474 Application note

AN2408 Application note

UM1488 User manual. STPMC1 evaluation software. Introduction

AN2240 Application note

AN2825 Application Note

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view)

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

Obsolete Product(s) - Obsolete Product(s)

AN2734 Application note S-Touch design procedure Introduction

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

AN3965 Application note

AN3250 Application note

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards

AN2592 Application note

STM8 I 2 C optimized examples

AN2673 Application note

AN3980 Application note

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards:

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter

STA bit single chip baseband controller for GPS and telematic applications. Features

Order code Temperature range ( C) Package Packing

Main components USB charging controller with integrated power switch

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

How to interpret the LPS331AP pressure and temperature readings. Main components mbar absolute barometer with digital output

LD A very low drop adjustable positive voltage regulator. Description. Features

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

AN3001 Application note

STM8L-PRIMER STM32-PRIMER STMPRIMER

L6460. SPI configurable stepper and DC multi motor driver. Features. Description

AN2361 Application note

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

AN2430 Application note

AN2557 Application note

Obsolete Product(s) - Obsolete Product(s)

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

AN2594 Application note

STMicroelectronics. STxP70-4 assembler. User manual Rev A. October

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

AN4274 Application note

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN3154 Application note

AN4321 Application note

AN2202 Application note

AN3140 Application note

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

Order code Temperature range ( C) Package Packing. LY3100ALH -40 to +85 LGA-10 (3x5x1) Tray LY3100ALHTR -40 to +85 LGA-10 (3x5x1) Tape and reel

AN4308 Application note

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

ST10F271B/E, ST10F272B/E Errata sheet

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

UM1719 User manual. The STPM3x evaluation software. Introduction

EMIF03-SIM06F3. 3-line IPAD, EMI filter including ESD protection. Description. Features. Application. Complies with the following standards:

AN3362 Application note


UM0562 User manual. SPMB250-A1EVAL demonstration kit user manual and installation guide. Introduction. Remote motion monitoring.

AN2781 Application note

AN3265 Application note

AN2936 Application note

AN4440 Application note

AN3099 Application note

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

TN0189 Technical note

EMIF M8. 4-line IPAD low capacitance EMI filter and ESD protection in micro QFN package. Features. Applications. Description

SMP30. Trisil for telecom equipment protection. Features. Applications. Description. Benefits

TN0132 Technical note

AN2792 Application note

Transcription:

Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction This document is intended to provide application information for the LIS331DL low-voltage 3-axis digital output linear MEMS accelerometer housed in an LGA package. The LIS331DL is an ultra-compact low-power 3-axis linear accelerometer that includes a sensing element and an IC interface capable taking information from the sensing element and providing the measured acceleration data to external applications via an I2C/SPI serial interface. The sensing element used to detect acceleration is manufactured using a dedicated process developed by ST to produce inertial sensors and actuators in silicon. The IC interface is instead manufactured using a CMOS process that allows a high level of integration to design a dedicated circuit which is factory trimmed to better match the sensing element characteristics. The LIS331DL has a user-selectable full scale of ±2 g and ±8 g and is capable of measuring accelerations with an output data rate of 100 Hz or 400 Hz. A self-test capability allows the user to check that the system is operating correctly. The device features two independent, highly programmable interrupt sources that can be configured either to generate an inertial wake-up interrupt signal when a programmable acceleration threshold is exceeded along one of the three axes, to detect a free-fall or to recognize single/double click events. Two independent pins can be configured to provide interrupt signals to connected devices. The LIS331DL is available in a plastic SMD package and is designed to operate over a temperature range extending from -40 C to +85 C. The ultra small size and weight of the SMD package make it an ideal choice for handheld portable applications such as cell phones and PDAs, or any other application where reduced package size and weight are required. June 2008 Rev 1 1/17 www.st.com

Contents AN2768 Contents 1 Theory of operation......................................... 4 1.1 Single click................................................. 4 1.2 Double click................................................ 5 2 Register description......................................... 7 2.1 CLICK_CFG (38h)........................................... 7 2.2 CLICK_SRC (39h)........................................... 7 2.3 CLICK_THSY_X (3Bh)........................................ 8 2.4 CLICK_THSZ (3Ch).......................................... 8 2.5 CLICK_TimeLimit (3Dh)....................................... 9 2.6 CLICK_Latency (3Eh)........................................ 9 2.7 CLICK_Window (3Fh)........................................ 9 2.8 CTRL_REG3 [Interrupt CTRL register] (22h)....................... 9 3 Examples................................................. 11 3.1 Playing with CLICK_TimeLimit................................. 11 3.2 Playing with CLICK_Latency.................................. 12 3.3 Playing with CLICK_Window.................................. 14 4 Revision history........................................... 16 2/17

List of figures List of figures Figure 1. Single click event with non latched interrupt..................................... 4 Figure 2. Single and double click recognition........................................... 5 Figure 3. Double click recognition.................................................... 6 Figure 4. Short TimeLimit.......................................................... 11 Figure 5. Long TimeLimit.......................................................... 12 Figure 6. Short Latency........................................................... 13 Figure 7. Long Latency........................................................... 13 Figure 8. Short Window........................................................... 14 Figure 9. Long Window........................................................... 15 3/17

Theory of operation AN2768 1 Theory of operation The single click and double click recognition functions featured in the LIS331DL help to create a man-machine interface with little software loading. The device can be configured to output an interrupt signal on a dedicated pin when tapped in any direction. If the sensor is exposed to a single input stimulus, it generates an interrupt request on inertial interrupt pin INT1 and/or INT2. A more advanced feature allows the generation of an interrupt request when a double input stimulus with programmable time between the two events is recognized, enabling a mouse button-like functionality. This function can be fully programmed by the user in terms of expected amplitude and timing of the stimuli by means of the dedicated set of registers described in Chapter 2: Register description. The single and double click recognition works independently on the selected output data rate. 1.1 Single click If the device is configured for single click event detection, an interrupt is generated when the input acceleration on the selected channel exceeds the programmed threshold, and returns below it within a time window defined by the TimeLimit register. If the LIR bit of the CLICK_CFG register is not set, the interrupt is kept high for the duration of the Latency window. If the LIR bit is set, the interrupt is kept high until the CLICK_SRC register is read. Figure 1. Single click event with non latched interrupt (a) (b) In Figure 1(a) the click has been recognized, while in Figure 1(b) the click has not been recognized because the acceleration goes under the threshold after the TimeLimit has expired. 4/17

Theory of operation 1.2 Double click If the device is configured for double click event detection, an interrupt is generated when, after a first click, a second click is recognized. The recognition of the second click occurs only if the event satisfies the rules defined by the Latency and Windows registers. In particular, after the first click has been recognized, the second click detection procedure is delayed for an interval defined by the Latency register. This means that after the first click has been recognized, the second click detection procedure will start only if the input acceleration exceeds the threshold after the Latency window but before the Window has expired [Figure 2 (a)] or if the acceleration is still above the threshold after the Latency has expired [Figure 3 (b)]. Once the second click detection procedure is initiated, the second click will be recognized with the same rule as the first: the acceleration must return below the threshold before the TimeLimit has expired. Appropriately defining the Latency window is important to avoid unwanted clicks due to spurious bouncing of the input signal. Figure 2. Single and double click recognition (a) (b) Figure 2 illustrates a single click event (a) and a double click event (b). The device is able to distinguish between (a) and (b) by changing the settings of the CLICK_CFG register from single to double click recognition. 5/17

Theory of operation AN2768 Figure 3. Double click recognition (a) (b) In Figure 3(a) the double click event has been correctly recognized, while in Figure 3(b) the interrupt has not been generated because the input acceleration exceeds the threshold after the Window interval has expired. 6/17

Register description 2 Register description 2.1 CLICK_CFG (38h) Table 1. Register - LIR Double_Z Single_Z Double_Y Single_Y Double_X Single_X Table 2. LIR Description Latch interrupt request to CLICK_SRC reg with the CLICK_SRC reg refreshed by reading CLICK_SRC reg. Default value: 0 (0: interrupt request not latched; 1: interrupt request latched) Double_Z Enable interrupt generation on double click event on Z axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Single_Z Enable interrupt generation on single click event on Z axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Double_Y Enable interrupt generation on double click event on Y axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Single_Y Enable interrupt generation on single click event on Y axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Double_X Enable interrupt generation on double click event on X axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Single_X Enable interrupt generation on single click event on X axis. Default value: 0 (0: disable interrupt request; 1: enable interrupt request) Table 3. Truth table Double_Z / Y / X Single_Z / Y / X Click output 0 0 0 0 1 Single 1 0 Double 1 1 Single or double 2.2 CLICK_SRC (39h) Table 4. Register X IA Double_Z Single_Z Double_Y Single_Y Double_X Single_X 7/17

Register description AN2768 Table 5. Description IA Interrupt active. Default value: 0 (0: no interrupt has been generated; 1: one or more interrupt events have been generated) Double_Z Double click on Z axis event. Default value: 0 (0: no interrupt; 1: Double Z event has occurred) Single_Z Single click on Z axis event. Default value: 0 (0: no interrupt; 1: Single Z event has occurred) Double_Y Double click on Y axis event. Default value: 0 (0: no interrupt; 1: Double Y event has occurred) Single_Y Single click on Y axis event.default value: 0 (0: no interrupt; 1: Single Y event has occurred) Double_X Double click on X axis event. Default value: 0 (0: no interrupt; 1: Double X event has occurred) Single_X Single click on X axis event. Default value: 0 (0: no interrupt; 1: Single X event has occurred) IA Interrupt active. Default value: 0 (0: no interrupt has been generated; 1: one or more interrupt events have been generated) 2.3 CLICK_THSY_X (3Bh) Table 6. Register THSy3 THSy2 THSy1 THSy0 THSx3 THSx2 THSx1 THSx0 Table 7. Description THSy3, THSy0 Click threshold on Y axis. Default value: 0000 THSx3, THSx0 Click threshold on X axis. Default value: 0000 2.4 CLICK_THSZ (3Ch) Table 8. Register X X X X THSz3 THSz2 THSz1 THSz0 Table 9. Description THSz3, THSz0 Click threshold on Z axis. Default value: 0000 From 0.5g(0001) to 7.5g(1111) with increments of 0.5g. The THSx, THSy and THSz registers define the threshold which is used by the system to start the click detection procedure. The threshold value is expressed over 4 bits as an unsigned number. 8/17

Register description 2.5 CLICK_TimeLimit (3Dh) Table 10. Register Dur7 Dur6 Dur5 Dur4 Dur3 Dur2 Dur1 Dur0 From 0 to 127.5 ms in increments of 0.5 ms. Dur7 through Dur0 define the maximum time interval that can elapse between the start of the click detection procedure (the acceleration on the selected channel exceeds the programmed threshold) and when the acceleration goes back below the threshold. 2.6 CLICK_Latency (3Eh) Table 11. Register Lat7 Lat6 Lat5 Lat4 Lat3 Lat2 Lat1 Lat0 From 0 to 255 ms in increments of 1 msec. Lat7 through Lat0 define the time interval that starts after the first click detection where the click detection procedure is disabled, in cases where the device is configured for double click detection. 2.7 CLICK_Window (3Fh) Table 12. Register Win7 Win6 Win5 Win4 Win3 Win2 Win1 Win0 From 0 to 255 ms in increments of 1 ms. Win7 through Win0 define the maximum interval of time that can elapse after the end of the latency interval in which the click detection procedure can start, in cases where the device is configured for double click detection. 2.8 CTRL_REG3 [Interrupt CTRL register] (22h) Table 13. Register IHL PP_OD I2CFG2 I2CFG1 I2CFG0 I1CFG2 I1CFG1 I1CFG0 Table 14. Description IHL Interrupt active high/low. Default value 0. (0: active high; 1: active low) PP_OD Push-pull/open drain selection on interrupt pad. Default value 0. (0: push-pull; 1: open drain) 9/17

Register description AN2768 Table 14. I2CFG2 I2CFG1 I2CFG0 I1CFG2 I1CFG1 I1CFG0 Description (continued) Data signal on Int2 pad control bits. Default value 000. (see table below) Data signal on Int1 pad control bits. Default value 000. (see table below) Table 15. Truth table I1(2)_CFG2 I1(2)_CFG1 I1(2)_CFG0 Int1(2) Pad 0 0 0 GND 0 0 1 FF_WU_1 0 1 0 FF_WU_2 0 1 1 FF_WU_1 or FF_WU_2 1 0 0 Data ready 1 1 1 Click interrupt 10/17

Examples 3 Examples The following figures show the click interrupt generation in different conditions. The illustrations have been captured on a PC running the EK302DL GUI interface. The content of the LIS331DL registers have been modified via the dedicated panel of the software interface that allows the user to evaluate all the different settings and features of the click embedded function. In the following examples, only the Y axis has been enabled for the click interrupt generation. 3.1 Playing with CLICK_TimeLimit Figure 4 shows an acquisition carried out with CLICK_TimeLimit = 02h (1 ms). With this setting, the single click recognition window is short and often the acceleration does not return below the threshold in time. In Figure 5 an acquisition done with CLICK_TimeLimit = FFh (127 ms) is shown. With this setting the single click recognition window is longer, and it is easier for the event to be recognized. Figure 4. Short TimeLimit 11/17

Examples AN2768 Figure 5. Long TimeLimit 3.2 Playing with CLICK_Latency Figure 6 illustrates an acquisition done with CLICK_Latency = 06h (6 ms). With this setting the device recognizes as a click nearly every acceleration peak. In Figure 7 an acquisition carried out with CLICK_Latency = ffh (255 ms) is displayed. With this setting the device recognizes as a click one peak in every two. 12/17

Examples Figure 6. Short Latency Figure 7. Long Latency 13/17

Examples AN2768 3.3 Playing with CLICK_Window In cases of double click recognition, the CLICK _Latency + CLICK_Window defines the maximum distance between two consecutive clicks to be recognized as a double click event. By fixing the latency to avoid spurious bouncing of the signal, one can play with the CLICK_Window as with the double-click speed settings of the mouse properties on the PC. Figure 8 shows an acquisition done with CLICK_Window = 10h (10 ms). With this setting the two consecutive peaks of acceleration are too far apart and the second one occurs outside of the Window. In Figure 9 an acquisition carried out with CLICK_Window = ffh (255 ms) is shown. With this setting the device correctly generates the double click interrupt after the second acceleration peak. Figure 8. Short Window 14/17

Examples Figure 9. Long Window 15/17

Revision history AN2768 4 Revision history Table 16. Document revision history Date Revision Changes 24-Jun-2008 1 Initial release. 16/17

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 17/17