2017-06-01 06:39 AM
I've got my LIS2DH12 configured as follows:
TEMP_CFG_REG
TEMP_EN0x11
CTRL_REG1
ODR1
LPEN0
ZEN1
YEN1
XEN1
CTRL_REG2
HPM0
HPCF0
FDS0
HPCLICK0
HP_IA10
HP_IA20
CTRL_REG3
I1_CLICK0
I1_IA10
I1_IA20
I1_ZYXDA0
I1_WTM1
I1_OVERRUN0
CTRL_REG4
BDU1
BLE0
FS0
HR1
ST0
CTRL_REG5
BOOT0
FIFO_EN1
LIR_INT10
D4D_INT10
LIR_INT20
D4D_INT20
CTRL_REG6
I2_CLICK0
I2_IA10
I2_IA20
I2_BOOT0
I2_ACT0
INT_POLARITY1
REFERENCE
REF0
FIFO_CTRL_REG
FM1
TR0
FTH1
INT1_CFG
AOI1
6D0
ZHIE0
ZLIE0
YHIE0
YLIE0
XHIE0
XLIE0
INT1_THS
THS1
INT1_DURATION
D0
INT2_CFG
AOI1
6D0
ZHIE0
ZLIE0
YHIE0
YLIE0
XHIE0
XLIE0
INT2_THS
THS0
INT2_DURATION
D0
CLICK_CFG
ZD0
ZS0
YD0
YS0
XD0
XS0
CLICK_THS
LIR_CLICK0
THS0
TIME_LIMIT
TLI0
TIME_LATENCY
TLA0
TIME_WINDOW
TW0
ACT_DUR
ACTD0
After configuration, the registers look like this:
whoAmI 33
tor 1tda 1sdoPuDisc 0tempEn 1odr 1lpen 0zEn 1yEn 1xEn 1hpm 0hpcf 0fds 0hpclick 0hpIa1 0hpIa2 0i1Click 0iaIa1 0iaIa2 0i1Zyxda 0i1wtm 1i1Overrun 0bdu 1ble 0fs 0hr 1st 0sim 0boot 0fifoEn 1lirInt1 0d4dInt1 0lirInt2 0d4dInt2 0i2Click 0i2Ia1 0i2Ia2 0i2Boot 0i2Act 0intPolarity 1reference 0fm 1tr 0fth 1wtm 0ovrnFifo 1empty 0fifoFss 1aoiInt1 1sixdInt1 0zhieInt1 0zlieInt1 0yhieInt1 0ylieInt1 0xhieInt1 0xlieInt1 0int1Ths 1int1Duration 0aoiInt2 1sixdInt2 0zhieInt2 0zlieInt2 0yhieInt2 0ylieInt2 0xhieInt2 0xlieInt2 0int2Ths 0int2Duration 0x: -32640, y: 0, z: -32640Every second, I get and service an interrupt (INT 1). Here's what I find (lowercase = not set (0) , UPPERCASE = set (1), bitnames followed by: value indicate values read):
outTemp: 0
INT1_SRC: ia zh zl yh yl xh xlINT2_SRC: ia zh zl yh yl xh xlCLICK_SRC: ia dclick sclick sign z y xSTATUS_REG_AUX: TOR TDASTATUS_REG: ZYXOR ZOR YOR XOR ZYXDA ZDA YDA XDAFIFO_SRC_REG: WTM ovrn_fifo emptyFSS: 2x: -32640, y: 0, z: -32640x: -32640, y: 0, z: -32640outTemp: 0As you can see, I read and output the x-, y-, and z-axis values, along with the temperature. Unfortunately, they never change, no matter how I orient the board the device is mounted on. Has you seen this before or have an idea of what I might be doing wrong? I know I'm communicating properly with the device, because WHO_AMI_I comes back as 33.
2017-07-06 02:52 AM
Solved this myself. I didn't bring the device out of power down mode properly first.