Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN4650 Datasheet(PDF) 47 Page - STMicroelectronics

Part # AN4650
Description  This document is intended to provide usage information
PDF  102 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4650 Datasheet(HTML) 47 Page - STMicroelectronics

Back Button AN4650 Datasheet HTML 43Page - STMicroelectronics AN4650 Datasheet HTML 44Page - STMicroelectronics AN4650 Datasheet HTML 45Page - STMicroelectronics AN4650 Datasheet HTML 46Page - STMicroelectronics AN4650 Datasheet HTML 47Page - STMicroelectronics AN4650 Datasheet HTML 48Page - STMicroelectronics AN4650 Datasheet HTML 49Page - STMicroelectronics AN4650 Datasheet HTML 50Page - STMicroelectronics AN4650 Datasheet HTML 51Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 47 / 102 page
background image
DocID027415 Rev 1
47/102
AN4650
Interrupt generation
102
Tap interrupt signals can also be checked by reading the TAP_SRC (1Ch) register,
described in Table 32.
TAP_IA is set high when a single-tap or double-tap event has been detected.
SINGLE_TAP is set high when a single tap has been detected.
DOUBLE_TAP is set high when a double tap has been detected.
TAP_SIGN indicates the acceleration sign when the tap event is detected. It is set low
in case of positive sign and it is set high in case of negative sign.
X_TAP (Y_TAP, Z_TAP) is set high when the tap event has been detected on the X (Y,
Z) axis
Single and double-tap recognition works independently. Setting the SINGLE_DOUBLE_TAP
bit of WAKE_UP_THS to 0, only the single-tap recognition is enabled: double-tap
recognition is disabled and cannot be detected. When the SINGLE_DOUBLE_TAP is set to
1, both single and double-tap recognition are enabled.
If the latch mode is enabled and the interrupt signal is driven to the interrupt pins, the value
assigned to SINGLE_DOUBLE_TAP also affects the behavior of the interrupt signal: when it
is set to 0, the latch mode is applied to the single-tap interrupt signal; when it is set to 1, the
latch mode is applied to the double-tap interrupt signal only. The latched interrupt signal is
kept high until the TAP_SRC register is read. If the latch mode is enabled but the interrupt
signal is not driven to the interrupt pins, the latch feature does not take effect.
4.5.4
Single-tap example
Hereafter an example code which implements the SW routine for single-tap detection.
In this example the TAP_THS fied of the TAP_THS_6D register is set to 01001b, therefore
the tap threshold is 562.5 mg (= 9 * FS_XL / 25).
The SHOCK field of the INT_DUR2 register is set to 10b: an interrupt is generated when the
slope data exceeds the programmed threshold, and returns below it within 38.5 ms (= 2 * 8 /
ODR_XL) corresponding to the Shock time window.
The QUIET field of the INT_DUR2 register is set to 01b: since the latch mode is disabled,
the interrupt is kept high for the duration of the Quiet window, therefore 9.6 ms (= 1 * 8 /
ODR_XL.)
Table 32. TAP_SRC register
b7
b6
b5
b4
b3
b2
b1
b0
0
TAP_IA
SINGLE
_TAP
DOUBLE
_TAP
TAP_SIGN
X_TAP
Y_TAP
Z_TAP
1
Write 60h into CTRL1_XL
// Turn on the accelerometer
// ODR_XL = 416 Hz, FS_XL = 2g
2
Write 0Eh into TAP_CFG
// Enable tap detection on X, Y, Z axis
3
Write 09h into TAP_THS_6D
// Set tap threshold
4
Write 06h into INT_DUR2
// Set Quiet and Shock time windows
5
Write 00h into WAKE_UP_THS
// Only single tap enabled (SINGLE_DOUBLE_TAP = 0)
6
Write 40h into MD1_CFG
// Single tap interrupt driven to INT1 pin



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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


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