cancel
Showing results for 
Search instead for 
Did you mean: 

AIS2IH Register issue

icachr
Associate

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.

2 REPLIES 2
Federica Bossi
ST Employee

Hi @icachr ,

Can you send me a reg dump? Just to check all the settings.

Thanks

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
icachr
Associate

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.

13D(0x60)OUT_T_L
14E(0x09)OUT_T_H
15F(0x44)WHO_AM_I
1610(0xA2)RESERVED
1711(0xA1)RESERVED
1812(0x83)RESERVED
1913(0x41)RESERVED
2014(0xA1)RESERVED
2115(0x12)RESERVED
2216(0x28)RESERVED
2317(0xAB)RESERVED
2418(0x03)RESERVED
2519(0xA1)RESERVED
261A(0x20)RESERVED
271B(0x20)RESERVED
281C(0x81)RESERVED
291D(0x61)RESERVED
301E(0x20)RESERVED
311F(0x72)RESERVED
3220(0x94)CTRL1
3321(0x04)CTRL2
3422(0x00)CTRL3
3523(0x00)CTRL4_INT1_PAD_CTRL
3624(0x00)CTRL5_INT2_PAD_CTRL
3725(0x30)CTRL6
3826(0x09)OUT_T
3927(0x01)STATUS
4028(0x18)OUT_X_L
4129(0xD7)OUT_X_H
422A(0x08)OUT_Y_L
432B(0x00)OUT_Y_H
442C(0x38)OUT_Z_L
452D(0xF8)OUT_Z_H
462E(0x18)FIFO_CTRL
472F(0xD7)FIFO_SAMPLES
4830(0x04)TAP_THS_X
4931(0x00)TAP_THS_Y
5032(0x3C)TAP_THS_Z
5133(0xF8)INT_DUR
5234(0x1C)WAKE_UP_THS
5335(0xD7)WAKE_UP_DUR
5436(0x08)FREE_FALL
5537(0x00)STATUS_DUP
5638(0x3C)WAKE_UP_SRC
5739(0xF8)TAP_SRC
583A(0x0C)SIXD_SRC
593B(0xD7)ALL_INT_SRC
603C(0x0C)X_OFS_USR
613D(0x00)Y_OFS_USR
623E(0x44)Z_OFS_USR
633F(0xF8)CTRL7

D718 = -11912 / 4 (>> 2) = -2978 @ 1.952 mg/bit = -5813.056 / 1000 mg/g = -5.813g