| Electronic Components Datasheet Search |
|
AN4650 Datasheet(PDF) 48 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4650 Datasheet(HTML) 48 Page - STMicroelectronics |
|
48 / 102 page ![]() Interrupt generation AN4650 48/102 DocID027415 Rev 1 4.5.5 Double-tap example The example code which implements the SW routine for single-tap detection is given below. In this example the TAP_THS field of the TAP_THS_6D register is set to 01100b, therefore the tap threshold is 750 mg (= 12 * FS_XL / 25). For interrupt generation, during the first and the second tap the slope data must return below the threshold before the Shock window has expired. THe SHOCK field of the INT_DUR2 register is set to 11b, therefore the Shock time is 57.7 ms (= 3 * 8 / ODR_XL). For interrupt generation, after the first tap recognition there must not be any slope data overthreshold during the Quiet time window. Furthermore, since the latch mode is disabled, the interrupt is kept high for the duration of the Quiet window. The QUIET field of the INT_DUR2 register is set to 11b, therefore the Quiet time is 28.8 ms (= 3 * 4/ ODR_XL). For the maximum time between two consecutive detected taps, the DUR field of the INT_DUR2 register is set to 0111b, therefore the Duration time is 538.5 ms (= 7 * 32 / ODR_XL). 4.6 Activity/Inactivity recognition The Activity/Inactivity recognition function allows reducing system power consumption and developing new smart applications. When the Activity/Inactivity recognition function is activated, the LSM6DS3 device is able to automatically decrease the accelerometer sampling rate to 13 Hz, increasing the accelerometer ODR and bandwidth as soon as the wake-up interrupt event has been detected. This feature is applied to the accelerometer sensor only, regardless of the selected gyroscope power mode and ODR. With this feature the system may be efficiently switched from low-power consumption to full performance and vice-versa depending on user-selectable acceleration events, thus ensuring power saving and flexibility. The Activity/Inactivity recognition function is enabled by setting to 1 the INACTIVITY bit of the WAKE_UP_THS register. The Activity/Inactivity recognition function uses the slope between two consecutive acceleration samples to detect the Activity/Inactivity event; the slope data is computed using the following formula: slope(tn) = [ acc(tn) - acc(tn-1) ] / 2 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 0Ch into TAP_THS_6D // Set tap threshold 4 Write 7Fh into INT_DUR2 // Set Duration, Quiet and Shock time windows 5 Write 80h into WAKE_UP_THS // Single & Double tap enabled (SINGLE_DOUBLE_TAP = 1) 6 Write 08h into MD1_CFG // Double tap interrupt driven to INT1 pin |
|
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 |
| 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 |