Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN2381 Datasheet(PDF) 43 Page - STMicroelectronics

Part # AN2381
Description  low voltage linear accelerometer
PDF  47 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2381 Datasheet(HTML) 43 Page - STMicroelectronics

Back Button AN2381 Datasheet HTML 39Page - STMicroelectronics AN2381 Datasheet HTML 40Page - STMicroelectronics AN2381 Datasheet HTML 41Page - STMicroelectronics AN2381 Datasheet HTML 42Page - STMicroelectronics AN2381 Datasheet HTML 43Page - STMicroelectronics AN2381 Datasheet HTML 44Page - STMicroelectronics AN2381 Datasheet HTML 45Page - STMicroelectronics AN2381 Datasheet HTML 46Page - STMicroelectronics AN2381 Datasheet HTML 47Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 43 / 47 page
background image
AN2381
Application information
43/47
The code sample exploits a threshold set at 350mg for free-fall recognition and the event is
notified by the hardware signal RDY/INT. At step 6, the FF_WU_DURATION register is
configured so to ignore events that are shorter than 5/DR=5/160~30msec (DR=data rate;
see Table 7.) in order to avoid false detections.
Once the free-fall event has occurred, a dummy read at FF_WU_ACK reg clears the request
and the device is ready to recognize other events.
6.7
Direction detection
The code disclosed below illustrates the ability of the LIS3LV02DL device to recognize in
which direction it has been tilted and to flag a change in its orientation/tilt with respect to the
previous state through the hardware RDY/INT signal. In the example below the device is
configured to detect tilt which exceed 260mg (set as external/outer threshold), while the
internal/inner threshold is set, as an example, to 150mg.
At step 8, a dummy read at HP_FILTER_RESET register is performed to set the current
acceleration/tilt as a reference state value for threshold comparison. This read may be
performed any time it is required to set the orientation/tilt of the device as a reference state
without waiting for the filter to settle.
1
write C7h into CTRL_REG1
// Turn on the sensor and set DF=512
2
write 08h into CTRL_REG2
// Enables interrupt generation
3
write 4Bh into CTRL_REG3
// Enable the HP filter and force HPc=4096
4
write A3h into DD_THSE_L register
// Set the lower part of outer threshold
5
write 10h into DD_THSE_H register
// Set the higher part of outer threshold
6
write 99h into DD_THSI_L register
// Set the lower part of inner threshold
7
write 09h into DD_THSI_H register
// Set the higher part of inner threshold
8
read HP_FILTER_RESET register
// Dummy read to force the HP filter to
// actual acceleration value
// (i.e. set reference acceleration/tilt value)
9
write CFh into DD_CFG register
// Configure direction detection along
// X and Y axes
10
poll RDY/INT pad; if RDY/INT=0 then
goto 10
// Poll RDY/INT pin waiting for a direction
// change event
11
(Direction/tilt has changed; insert your
code here)
// Event handling
12
read DD_SRC register
// Return the direction in which the tilt
// has occurred
13
(Insert your code here)
// Event handling
14
read DD_ACK register
// Clear interrupt request (on direction
// change)
15
goto 10



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com