Need help with low power mode MMA8452Q

Hi Everyone,

I have a problem at hand that is confusing me quite a bit. So here is a general description of my setup:
ATMega328P at 3.3v and 8mhz hooked up to a MMA8452Q breakout from sparkfun via i2c and interrupt (INT0).

The 328p sets up the 8452Q accelerometer and then goes into sleep. The 8452q will send an interrupt signal via INT0 when it detects a tap. The 328p wakes up when it detects an interrupt (rising) on a external interrupt. It will then access register 0x0C to determine that the interrupt is generated by a tap. Then, it reads register 0x22 to see which direction the tap came from (XYZ). If the direction is X, Y, or Z, it will trigger a LED to turn on for 50ms and go back to sleep.

The 328p is functioning correctly. It sleeps at around 0uA(it's probably somewhere around 1uA, but my multimeter can't measure it). However, the 8452q is not. I have set the rate at 50hz and the datasheet says that the current draw should be ~24uA. When first powered up, the total current draw of the MCU and the 8452Q is 26uA. But if I tap it once, the LED turns on, then off, and the current of the whole system no longer goes back down to 26 uA. It stays at around 351 uA. I am very confused at what is causing this.

I think that the 8452Q is still waiting for the MCU to read some register, which causes it to use so much current. The problem is that I don't know what register.

Can anyone explain what is going wrong and maybe help me figure out a solution? If you need anymore info, just ask.

What did you set the auto-sleep counter to? That determines how long the accelerometer stays awake after an interrupt.

See FreeScale Application Note AN4074.

Hi,

I tried to turn on auto sleep, but now, the 8452q no longer responds to taps and fires an interrupt. the current is at 26uA, but it doesn't respond anymore.
Here are my register settings for the sleep mode:

writeReg(0x2B, 0b00000100); //turns on auto sleep
	writeReg(0x2C, 0b00000010);  // Active high, push-pull
	writeReg(0x2D, 0b00001000);  // Pulse detection
	writeReg(0x2E, 0x08);  // Set to int1
	writeReg(0x29, 0b00000001); //1 sec inactivity to go to sleep

I will keep trying to see if I can figure something out.