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.