2019-04-08 08:21 PM
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
Solved! Go to Solution.
2020-09-21 06:44 AM
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
2019-04-10 01:40 AM
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
2019-04-10 02:09 AM
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.
2019-04-10 03:04 AM
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
Regards
2019-04-10 03:33 AM
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.
2019-04-10 03:38 AM
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
2019-04-10 03:42 AM
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.
2019-04-10 03:47 AM
2019-04-10 11:59 PM
hi sshankar, if you followed the ds indications, everything should work...
I know it's a stupid question, but did you tried to move the accelerometer to check if the axis are moving?
2019-04-11 03:11 AM
Yes. I idid move it around 🙂