2019-10-30 05:19 PM
Hey guys,
I am working on communicating to an ISM330DLC sensor using I2C and a TI processor as the master. We only have the accelerometer enabled (no gyro) and are using the FIFO to read the data. When the FIFO gets four pieces of data (2 x, 2 y, and 2 z) we receive an interrupt and then read all of the data out of it. This seems to be working, but every now and then the accelerometer stops responding. The issue seems to be completely random and can happen any time, including in the middle of a read. I have seen it happen after only about 10 seconds of collecting data or after about a minute of taking data. The state of the I2C bus seems to vary as well after the error.
I've attached a picture of an example of this happening below. In the picture we were trying to read the FIFO status bits and the FIFO data in one read. It looks like we properly read the status bits and the first half of the data, but then the I2C lines get stuck low in the middle of the read. Everything leading up to this looked perfect.
Does anyone have any idea what could be causing this issue? The bus voltages look pretty good and it seems to be functioning completely normally, until the sensor just stops responding.
Thanks for the help,
Charles
Solved! Go to Solution.
2019-11-01 09:27 AM
We figured it out. We had a timer running that was sometimes interfering with the I2C interrupts.
Thanks!
Charles
2019-10-31 01:12 PM
Update: So we have run a few more tests and it looks like it may be related to using the interrupts. We started off just reading the device ID indefinitely and never saw it crash, then we tried turning on the accelerometer and just reading the device ID and it still worked just fine. We also tried just polling the accelerometer and that worked as well. As soon as we tried to use an interrupt, though, we started to see issues. Using an interrupt to read the accelerometer values or using the FIFO and the FIFO interrupt to read the accelerometer values both caused us to see this issue. We also tried using the gyro instead of the accelerometer and saw the exact some issue.
Thanks again,
Charles
2019-11-01 09:27 AM
We figured it out. We had a timer running that was sometimes interfering with the I2C interrupts.
Thanks!
Charles