Skip to main content
Visitor II
April 9, 2019
Solved

Self test on the LIS2DE12TR

  • April 9, 2019
  • 12 replies
  • 4967 views

Hello,

I am working on a project where I have to interface the LIS2DE12TR Accelerometer via I2C interface with TI cc2652 chip. As a start I wanted to verify the hardware functionality. In the datasheet it is mentioned of a Self-Test Mode of operation. I did not understand how the operation can be verified in the self-test. Should we just enter into self test mode and then monitor the x,y,z output values and check if they are within the specified range ? Also is there any example for this self test procedure that has been done.

Also in the datasheet there is mentioned a Slave Ack and a Master ACK. How do we know that the slave Ack has been received and how do we send a Master Ack/Nack

Regards,

SS

    This topic has been closed for replies.
    Best answer by kamion

    Hi @christian239955_stm1_st​, @Eleon BORLINI​,

    I figured it out.

    For the LIS2DE12, the BDU bit in CTRL_REG4 must be set to 0.

    The description of the BDU bit states:

    Block data update. Default value: 0
    (0: continuous update; 1: output registers not updated until MSB and LSB have been read)

    Since the LIS2DE12 do not have OUT_X_L, OUT_Y_L and OUT_Z_L registers, turning BDU on will prevent the output registers from being updated.

    Cheers,

    Kamion

    12 replies

    ST Employee
    April 10, 2019

    hi ss, is your purpose to check the hardware integrity of the system? If so, before checking the self test that is a test to check the mechanical part of the MEMS sensor, not the electrical one, I suggest you to set up the I2C communication between LIS2DE12TR and TI cc2652. If the I2C is working, you could check the WHO_AM_I (0Fh) register, that should be 33h. If it is not working, are you using some TI libraries for I2C associated to their MCU TI cc2652 or are you generating I2C in bit-banging? You could share an oscilloscope screen of your I2C communication if it is not working, to more understand the issue. regards

    SShan.11Author
    Visitor II
    April 10, 2019

    Hi eleon.

    I have verified the I2C communciation by reading the whoAMI register and have got the correct vaue 0x33. Also I am able to write to the control registers and then read the value back successfully. However when I try to read the output X,Y and Z registers it shows that X and Y always show 0x80 and Z shows value changes from 0x01 to 0xff range. Why could this be? Awiaiting repy soon.

    ST Employee
    April 10, 2019

    ​Did you already set the CTRL_REG1 (20h) Xen, Yen and Zen bits, the LPen and an ODR different from the default?

    About self test procedure, you should follow this procedure

    0690X000008ACqnQAG.png

    Regards

    Visitor II
    September 21, 2020

    If anyone is following this procedure for the LIS2DE12, the BDU bit in CTRL_REG4 must be set to 0 in order for the selftest to work, otherwise you will just be reading the same output value.

    Also for the LIS2DE12, the LPen bit in CTRL_REG1 must be set to 1, as this device only supports 8-bit output.

    See my responses further down this thread for why.

    SShan.11Author
    Visitor II
    April 10, 2019

    Hello,

    I don't need to perform the self-test. I just require to read the x,y,z values and see if they are varying. But the x and y values are always showing the same. The z value is varying. The 0x20h register has been set to 0x7f.

    ST Employee
    April 10, 2019

    If the configurations are well, it is obviously strange if only Z axis is working. Can you please share the oscilloscope pattern? Are you working in multiple bytes I2C mode? Regards

    SShan.11Author
    Visitor II
    April 10, 2019

    I have set the 0x20 register to 0x7f and no other register setting have been changed from defualt. THen I just read the x,y and z output registers one by one in a loop for about 10 times. The only change I see is in the z axis. Also I am getting z axis values in range 0x00 to 0xff.Is that z axis value proper then?

    I have used the logic analyzer to verify that the data transfer via i2c is proper.

    SShan.11Author
    Visitor II
    April 10, 2019

    The data from the logic analyzer

    ST Employee
    April 11, 2019

    ​hi sshankar, if you followed the ds indications, everything should work...0690X000008AIcDQAW.png

    I know it's a stupid question, but did you tried to move the accelerometer to check if the axis are moving?

    SShan.11Author
    Visitor II
    April 11, 2019

    Yes. I idid move it around :)

    ST Employee
    April 12, 2019

    Some more questions: which is your operating Vdd / VddIO? I suppose you tried to restart the boot but... did you tried with another sample? Regards

    Visitor II
    April 14, 2020

    Eleon

    Thank you for your support. One question to the PNG you provided for the selftest sequence.

    It states, that the 10Bit data is left aligned. The datasheet only presents OUT_X_H (29h) and no low data byte. Is there something missing in the datasheet or is the PNG not correct for LIS2DE12?

    Kind regards

    Chris

    ST Employee
    April 14, 2020

    Hi @christian239955_stm1_st​ , it's a typo ;) just need to use the OUT_X_H (29h) data in two's complement for the LIS2DE12TR. Regards

    Visitor II
    April 28, 2020
    Dear Eleon

    I follow the procedure from your picture. I read back all configurations I do (e.g. after configuring the self-test I read 0x82 from Register 0x23).

    However, I always measure exactly the same no matter if the self-test is configured or not.

    The results are plausible when I rotate the sensor. I read -64 (* 15.6mg = 998.4mg) in whatever axis is pointing up.

    Do you have any suggestion for me?

    Kind regards

    Christian