AnsweredAssumed Answered

Help setting up Auto-Wake/Sleep Using the MMA8452Q

Question asked by Flavio Ortolano on Jan 28, 2014
Latest reply on Jan 29, 2014 by Flavio Ortolano

Hello there,

I am trying to configure the MMA8452Q to auto-sleep-wake but I am having no success at all.  The accelerometer works fine since I was able to configure it to output simple XYZ data.

 

I've downloaded the document AN4074 (Auto-Wake/Sleep Using the MMA8451, 2, 3Q) that seems to explain how to setup the wake/sleep fucntion, but again, it didn't work. I followed the pseudo-code on page 8 at the end of the document and I've noticed that although the example says it configures the device to sleep time-out period to 20 seconds, I could not identify in the pseudo-code the changes/updates related to the ASLP_COUNT Register (0x29) values.

 

Could someone give me some help on how to configure register 0x29? I have no idea (even after reading the documentation) how to set the bits D7-D0 for this register. What values should be written to this register when setting up the wake-sleep function?

 

At the stage of my prototype development, all I am trying to do right now is to get the accelerometer to sleep and be awaken after the device gets shaken - so any code/pseudo-code/explanation would be welcomed!!!

 

There are some code samples and libraries that I was able to find through Google, but not one single example nor code demonstrates how to setup the autp-wake-sleep. Any direction is much appreciated!

 

Thank you in advance.

Flavio

 

flavio@ortolanos.com

Outcomes