datasheetbank_Logo
数据手册搜索引擎和 Datasheet免费下载 PDF

AN4506 查看數據表(PDF) - STMicroelectronics

零件编号
产品描述 (功能)
比赛名单
AN4506 Datasheet PDF : 47 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
AN4506
Interrupt generation
5.5.3
1 Write 0Fh into CTRL1
2 Write 00h into CTRL2
3 Write 80h into CTRL3
4 Write 00h into CTRL4
5 Write 34h into IG_THS_XH
6 Write 3Eh into IG_THS_XL
7 Write 00h into IG_DURATION
8 Write 02h into IG_CFG
9 Poll INT1 pad; if INT1=0 then go to 8
10 Read IG_SRC
11
(Wake-up event has occurred; insert
your code here)
12 Go to 8
// Turn on the sensor and enable X, Y, and Z
// ODR = 100 Hz
// High-pass filter disabled
// Interrupt driven to INT1 pad
// FS = 245 dps
// Threshold = 100 dps
// Threshold = 100 dps
// Duration = 0
// Enable XH interrupt generation
// Poll INT1 pin waiting for the
// wake-up event
// Return the event that has triggered the
// interrupt
// Event handling
Using the HP filter
The code provided below gives a basic routine which shows the practical use of the wake-
up feature performed on high-pass filtered data. In particular, the device is configured to
recognize when the high-frequency component of the angular rate applied along either the
X, Y, or Z-axis exceeds a preset threshold (100 dps is used in the example).
The event which triggers the interrupt is latched inside the device and its occurrence is
signaled through the use of the INT1 pin.
1 Write 0Fh into CTRL1
2 Write 00h into CTRL2
3 Write 80h into CTRL3
4 Write 00h into CTRL4
5 Write 05h into CTRL5
6 Write 34h into IG_THS_XH
7 Write 3Eh into IG_THS_XL
8 Write 34h into IG_THS_YH
9 Write 3Eh into IG_THS_YL
10 Write 34h into IG_THS_ZH
11 Write 3Eh into IG_THS_ZL
12 Write 00h into IG_DURATION
// Turn on the sensor and enable X, Y, and Z
// ODR = 100 Hz
// High-pass filter in Normal mode
// Interrupt driven to INT1 pad
// FS = 245 dps
// Data in DataReg and FIFO are high-pass filtered.
// High-pass-filtered data are used for interrupt
// generation
// Threshold = 100 dps
// Threshold = 100 dps
// Threshold = 100 dps
// Threshold = 100 dps
// Threshold = 100 dps
// Threshold = 100 dps
// Duration = 0
DocID026442 Rev 2
29/47

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]