AN101
© Kionix 2019 All Rights Reserved
11 July 2019
Page 6 of 27
data samples. (Note: With BRES=0 (8-bit resolution), in BUF_CNTL2, it is possible to collect
171 samples or 513 bytes of data).
3.4.2.
Watermark Interrupt (WMI)
This example configures enables the accelerometer to start outputting sensor data to the
internal buffer until a watermark is reached. When the watermark is reached, a hardware
interrupt is generated and data can then be read from the buffer. The mode of operation is
first in, first out (FIFO) below.
-
Write 0x00 to Control Register 1 (CNTL1) to set the accelerometer in stand-by mode
Register Name
Address
Value
CNTL1
0x1B
0x00
-
Write 0x06 to Output Data Control (ODCNTL) to set the Output Data Rate (ODR) of the
accelerometer to 50 Hz.
This step is optional as this is also a default setting.
Register Name
Address
Value
ODCNTL
0x21
0x06
-
Write 0x30 to Interrupt Control (INC1) to enable physical interrupt pin INT1, set the polarity of
the physical interrupt to active high and configure for latched operation.
Register Name
Address
Value
INC1
0x22
0x30
-
Write 0x20 to Interrupt Control 4 (INC4) to set the Watermark interrupt to be reported on
physical interrupt pin INT1.
Register Name
Address
Value
INC4
0x25
0x20
-
Write 0x2B (43d) to set a watermark level to exactly half of the buffer.
Register Name
Address
Value
BUF_CTNL1
0x5E
0x2B
-
Write 0xE0 to Buffer Control 2 (BUF_CNTL2) to enable the sample buffer (BUFE=1), to set
the resolution of the acceleration data samples collected to 16-bit resolution (BRES=1) and
set the operating mode of the sample buffer to FIFO (BM=0).
Register Name
Address
Value
BUF_CNTL2
0x5F
0xE0
-
Write 0xE0 to Control 1 (CNTL1) to set the accelerometer into operating mode (PC1=1), full
power mode (RES=1), data ready enabled (DRDYE=1), range to ±8g (GSEL=0).
Register Name
Address
Value
CNTL1
0x1B
0xE0