Post Go back to editing

ADXL362 acceleration data stuck

Hello,

I'm using an ADXL362 accelerometer connected to an STM32L0 microcontroller to detect motion. The accelerometer is powered by a pin of the STM32L0 at 1.8V.

I'm able to configure the accelerometer in wakeup mode and 4g range and I read acceleration values for x, y, and z every second in the three 16-bit data registers. The values do change for every read however there are times (quite rare) when the accelerometer keeps returning the same (x,y,z) sample over and over as if it is stuck. I checked with a logic analyzer and verified that the ADXL362 actually sends data and that I'm not reading stale values in the MCU. When I read the POWER_CTL register I get 0xA, so the accelerometer is in measurement mode.

Has anyone seen this problem before?

I'm trying to recover from that situation by resetting the accelerometer. As specified in the datasheet I turn off the power to the ADXL and discharge the supplies completely before reapplying power. I then check I can communicate with the accelerometer by reading the DEVID_AD register and reconfigure the accelerometer with the same initial parameters.

I'm then able to read acceleration samples, the values change every second but they are wrong. With 4g range and the ADXL static on the table I'm normally reading -500 on the z axis, but I now read -950. I read back the registers to check the configuration, and I get POWER_CTL = 0xA and FILTER_CTL= 0x40, which is what I configured.

Am I missing something in the reset sequence? What else could I try to recover?

  • It sounds like the register settings are not correctly happening.  Can you try multiple read/write cycles to confirm this is working correctly 100% of the time.  After that, I would recommend configuring the device while it is in standby and after completing configuration, enable measure mode.  Finally, you mentioned configuring FILTER_CTL to 0x40, this would set 2g range, not 4g as you suggested in your first paragraph.  That could explain your difference in readings.

  • Hi Anthony,

    Thanks for your reply.

    I tried multiple read/writes and it is working fine. The problem I see is hard to reproduce so I'll keep monitoring the read/writes.

    Regarding the range selection, the datasheet for the ADXL362 specifies that bit 7 and 6 have to be 01 for 4g range in the FILTER_CTL register. So 0x40 looks correct in that case.

  • Anthony or Gubidata,

    I too have seen issues with stuck data and non responsive register writes. After power-up, I get one set of XYZ data and no change after that.What is the latest status of the problem you are experiencing?