2025-06-02 8:53 AM
I'm working with the AIS2IH accelerometer. I've established communication via SPI, and am able to read the WHOAMI correctly, along with requesting and receiving data as expected. However, some of the data I'm reading doesn't make a lot of sense, so I've been investigating our chip setup. It appears that we're having issues getting some of the control registers to set correctly.
Specifically I seem to be having issues with CTRL1 & CTRL6. There may be others that I haven't discovered at this point in time, so don't assume this is a complete list.
I first noticed this issue when trying to set CTRL6. Specifically, I'm trying to set the Full-Scale Selection to +/- 16g. According to the data sheet, I do this by setting bits 4&5 of the register to 0x3. I'm able to send this command properly, however, when I read back the settings on CTRL6, I'm only reading 0x2 in those bits. If I send 0x1 in place of 0x3, I receive 0x0 from those bits. It appears that bit 4 is not getting/staying set. I've seen this behavior over at least three separate hardware implementations.
CTRL1 exhibits a very similar issue - when setting the Data Rate Configuration, if I attempt to set bits 1 & 2 in that field (register bits 5 & 6), they always are returned as 0. So setting High-Performance / Low-Power mode 1600/200 Hz is fine, as we can set 0x9 with out issue. However, if I try and set High-Performance / Low-Power mode 200 Hz, which should be 0x6, the register reads back as 0x0.
I can't find any information in the data sheet that would explain this behavior. I've tried multiple configurations to see if other register fields were somehow impacting the fields I'm interested in, but the behavior appears to stay consistent regardless of how other fields are set.
I'm confident in my communication setup - as mentioned, I can read the WHOAMI just fine, and the STATUS register seems to respond as expected. Additionally, I see data when I request the data from the X, Y and Z axis registers, which I can see changing with noise on a regular basis.
I've attached the version of the data sheet we are using.
2025-06-04 8:16 AM
Hi @icachr ,
Can you send me a reg dump? Just to check all the settings.
Thanks
2025-06-04 12:37 PM
Federica-
Thanks for getting back to me. It appears that my initial problem has been solved - we were having communication issues due to another SPI device on the bus that requires the opposite CPOL from the AIS2IH.
However, I'm still having some issues - my data readings don't appear to be correct, and I'm not sure why/what we're doing wrong in setup. If I'm decoding our readings correctly, we're supposedly seeing over 5G's in our X-axis, which would be amazing for a device that's sitting on our benchtop. Below is my register dump - you should be able to see the data, as well as all of our other register settings.
13 | D | (0x60) | OUT_T_L |
14 | E | (0x09) | OUT_T_H |
15 | F | (0x44) | WHO_AM_I |
16 | 10 | (0xA2) | RESERVED |
17 | 11 | (0xA1) | RESERVED |
18 | 12 | (0x83) | RESERVED |
19 | 13 | (0x41) | RESERVED |
20 | 14 | (0xA1) | RESERVED |
21 | 15 | (0x12) | RESERVED |
22 | 16 | (0x28) | RESERVED |
23 | 17 | (0xAB) | RESERVED |
24 | 18 | (0x03) | RESERVED |
25 | 19 | (0xA1) | RESERVED |
26 | 1A | (0x20) | RESERVED |
27 | 1B | (0x20) | RESERVED |
28 | 1C | (0x81) | RESERVED |
29 | 1D | (0x61) | RESERVED |
30 | 1E | (0x20) | RESERVED |
31 | 1F | (0x72) | RESERVED |
32 | 20 | (0x94) | CTRL1 |
33 | 21 | (0x04) | CTRL2 |
34 | 22 | (0x00) | CTRL3 |
35 | 23 | (0x00) | CTRL4_INT1_PAD_CTRL |
36 | 24 | (0x00) | CTRL5_INT2_PAD_CTRL |
37 | 25 | (0x30) | CTRL6 |
38 | 26 | (0x09) | OUT_T |
39 | 27 | (0x01) | STATUS |
40 | 28 | (0x18) | OUT_X_L |
41 | 29 | (0xD7) | OUT_X_H |
42 | 2A | (0x08) | OUT_Y_L |
43 | 2B | (0x00) | OUT_Y_H |
44 | 2C | (0x38) | OUT_Z_L |
45 | 2D | (0xF8) | OUT_Z_H |
46 | 2E | (0x18) | FIFO_CTRL |
47 | 2F | (0xD7) | FIFO_SAMPLES |
48 | 30 | (0x04) | TAP_THS_X |
49 | 31 | (0x00) | TAP_THS_Y |
50 | 32 | (0x3C) | TAP_THS_Z |
51 | 33 | (0xF8) | INT_DUR |
52 | 34 | (0x1C) | WAKE_UP_THS |
53 | 35 | (0xD7) | WAKE_UP_DUR |
54 | 36 | (0x08) | FREE_FALL |
55 | 37 | (0x00) | STATUS_DUP |
56 | 38 | (0x3C) | WAKE_UP_SRC |
57 | 39 | (0xF8) | TAP_SRC |
58 | 3A | (0x0C) | SIXD_SRC |
59 | 3B | (0xD7) | ALL_INT_SRC |
60 | 3C | (0x0C) | X_OFS_USR |
61 | 3D | (0x00) | Y_OFS_USR |
62 | 3E | (0x44) | Z_OFS_USR |
63 | 3F | (0xF8) | CTRL7 |
D718 = -11912 / 4 (>> 2) = -2978 @ 1.952 mg/bit = -5813.056 / 1000 mg/g = -5.813g