I'm wondering if anyone has gotten the ADXL345 to work with the link, auto sleep and have the device sleep with low power consumption (say lower than 20uA) and then to wake up when moved? Maybe I'm expecting too much out of it?
I have read the datasheet, followed the instructions to set link and auto sleep bits in power register, set a low BW rate, activity and inactivity along with time, interrupts for both. Once an interrupt is detected, the MCU reads 0x32 to 0x37 and 0x30.
The problem is the device never wakes up from sleep. Only if I also turn on the measure bit in the power register it all works as normal, but current consumption is 45uA. Trying to change BW rate doesn't affect current consumption and as far as I know it shouldn't when link/auto sleep is on, only when it wakes up, so link/auto sleep might be working to some degree.
If I disable link/auto sleep, I still get the 45uA current consumption and changing the BW rate changes current consumption.
Could someone check that what I'm doing is right or if you have examples that you know work that would be great.
Here is the setup I'm using:
adxl_spi_write(ADXL345_POWER_CTL, 0); // Wakeup
adxl_spi_write(ADXL345_DATA_FORMAT, 0); // 2g and 4-wire SPI
adxl_spi_write(ADXL345_BW_RATE, 0x17); // Low power bandwidth
// Set activity/inactivity on x, y
// Enable interrupt activity on activity and inactivity
// Set link and auto link