mma8453 sleep issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mma8453 sleep issue

1,232 Views
bergo
Contributor III

Hello all,

I'm configuring my mma8453 accelerometer to enter sleep mode after a period of inactivity as described in the application note and data sheet.

After the period of inactivity I'm getting a sleep interrupt as expected from which I can wake up.

here is the issue,

After the first sleep interrupt, if still inactive, after the same period of time, a second sleep interrupt will take place (not a "awake" interrupt) from which I'm unable to wake (seems like the app execution stops when I try to wake the device from the "second" sleep).

I hope you guys can help me out with this.

Thanks in advance,

Labels (1)
0 Kudos
6 Replies

957 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Bergo,

It is necessary to read an event-specific register in order to clear an event-specific status bit in the INT_SOURCE register and deassert an interrupt. Then a new interrupt that will wake the device again can be asserted. 

Attached you can find my example code that demonstrates how to use the Auto-Wake/Sleep function. As I am using the Motion function to wake up the device, I read the FF_MT_SRC (0x16) register.

I hope it helps.

Regards,

Tomas

957 Views
bergo
Contributor III

Thanks Tomas,

Once I'm getting sleep interrupt, I'm reading the SYSMOD register to clear the interrupt bit,

Also I'm able to wake the accelerometer as set up int reg3,

The issue is when I'm not waking the device, after another period of time, a second sleep interrupt will occur from which I'm unable to recover.

0 Kudos

957 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Bergo,

Reading the SYSMOD register only clears the SRC_ASLP bit, to deassert the interrupt that woke up the device for the first time you need to read an appropriate interrupt source register, otherwise the interrupt keeps asserted and cannot wake the device next time.

For instance, if the Freefal/Motion function is used to wake up the device, it is necessary to read the FF_MT_SRC register to clear the SRC_FF_MT bit in the INT_SOURCE register and consequently deassert the interrupt.

I hope it is clear now.

Regards,

Tomas

0 Kudos

957 Views
bergo
Contributor III

Hi Tomas,

Just to make sure, when waking from sleep I would get two interrupt bits, one for awake and one from the source of waking up (int_source register). if this is the case, I'm reading both of them,

The issue I'm talking about is not the case,

The device is inactive, after some time I'm getting the expected sleep interrupt. I'm not waking the device as it's not needed,

after another period of time, I would get another sleep interrupt (in total, two, consecutive sleep interrupts with some time in between), from which I'm not able to recover back to wake mode,

If I'm to wake the device after the first sleep interrupt, it will work fine. (until the device will be untouched for a long period of time when I'm getting two sleep interrupts as explained before).

Thanks again,

0 Kudos

957 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Bergo,

I am not able to reproduce your issue, the device wakes up regardless of the time spent in the sleep state.

It might be useful to see your source code, I am particularly interested in configuration of the MMA8453Q and interrupts handling. 

Regards,

Tomas

0 Kudos

957 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Bergo,

I have not heard from you for the last five days, so I am going to mark this as "answered." If you have any follow-up questions, please feel free to post additional comments in this discussion.

Regards,

Tomas

0 Kudos