AN101
© Kionix 2019 All Rights Reserved
11 July 2019
Page 5 of 27
3.4.
Sample Buffer Operation
3.4.1.
Buffer Full Interrupt (BFI)
This example configures enables the accelerometer to start outputting sensor data to the
internal buffer until full. When the buffer is full, 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 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 0x40 to Interrupt Control 4 (INC4) to set the Buffer Full interrupt to be reported on
physical interrupt pin INT1.
Register Name
Address
Value
INC4
0x25
0x40
-
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), to
enable the buffer full interrupt (BFIE=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
-
Once a Buffer-Full Interrupt is issued on INT1 pin, acceleration data can then be read from
the Buffer Read (BUF_READ) register at address 0x63
in 2’s complement format. Since the
resolution of the samples data was set to 16-bit, the data is recorded in the following order:
X_L, X_H, Y_L, Y_H, Z_L and Z_H with the oldest data point read first as the buffer is in FIFO
mode. The full buffer contains 516 bytes of data, which corresponds to 86 unique acceleration