| 数据搜索系统,热门电子元器件搜索 |
|
AN2960 数据表(PDF) 37 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2960 数据表(HTML) 37 Page - STMicroelectronics |
|
37 / 41 page ![]() AN2960 Application information Doc ID 15557 Rev 1 37/41 9.6 Free-fall detection 9.6.1 Roll function not used This paragraph provides the basics for the use of the free-fall detection feature. The SW routine that configures the device to detect free-fall events and to signal them is as follows: The code sample exploits a threshold set at 350 mg for free-fall recognition and the event is notified by the hardware signal INT2 pin. At step 5, the FF_WU_DURATION_1 register is configured to ignore events that are shorter than 9/ODR=9/100~90 ms (ODR=output data rate) in order to avoid false detections. Once the free-fall event has occurred, a dummy read at FF_WU_SRC_1 reg clears the request and the device is ready to recognize other events. 9.6.2 Roll function applied The roll function can be added to free-fall condition recognition using both interrupt sources. Interrupt signals can be sent to two different pins (INT1, INT2) or can be sent to the same pin so that the first condition verified controls the pin (logic “OR” of interrupt signals). 9.7 Output data rate selection and reading timing The output data rate is user-selectable through the DR bit stored in the CTRL_REG1 (20h) register. At power-on-reset, DR is reset to 0, thus providing a default output data rate set to 100 Hz. The selectable output data rates are given in Table 6 below: 1 write 47h into CTRL_REG1 // Turn-on the sensor and set ODR=100 Hz 2 write 00h into CTRL_REG2 // Default value: high-pass filter bypassed 3 write 08h into CTRL_REG3 // FF_WU1 interrupt sent to INT2 pin 4 write 14h into FF_WU_THS_1 reg // Set the free-fall threshold 5 write 09h into FF_WU_DURATION_1 reg // Set minimum event duration to 90 ms 6 write D5h into FF_WU_CFG_1 // Configure free-fall recognition and latch // interrupt request 7 poll INT2 pad; if INT2=0 then goto 7 // Poll INT2 pin waiting for the free-fall event 8 (Free-fall event has occurred; insert your code here) // Event handling 9 read FF_WU_SRC_1 register // Clear interrupt request 10 goto 7 Table 6. Output data rate DR Output data rate 0 100 Hz 1 400 Hz |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |