MMA8452 sleep current

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

MMA8452 sleep current

1,818 Views
takuya1
Contributor I

Hello.

I am working on a development project using MMA8452, but I am facing the problem that the sleep current of MMA8452 doesn't go down.

Automatic sleep and wake up of MMA8452 functions are set, and the CPU also transitions to sleep based on the sleep interrupt signal from MMA8452.

However, the consumption current of MMA8452 doesn't fall after sleep.

I am doing the following configuration setting on the device.

1.  standby mode setting

  readRegister(0x2A, &data);
  writeRegister(0x2A, data & ~(0x01));

2.  dynamic range setting (2G)

  readRegister(0x0E, &XYZ_DATA);
  CTRL_REG3_Data &= 0xFC;
  writeRegister(0x0E, XYZ_DATA);

3.  oversampling mode setting(SleepMode : Low Power,  ActiveMode : Low Power)

  readRegister(0x2B, &CTRL_REG2_Data);
  CTRL_REG2_Data &= 0xE4;
  CTRL_REG2_Data |= 0x1B;
  writeRegister(0x2B,CTRL_REG2_Data);

4.  automatic sleep and wake up setting

  readRegister(0x2B, &CTRL_REG2_Data);
  CTRL_REG2_Data |= 0x04;
  writeRegister(0x2B, CTRL_REG2_Data);

5.  automatic sleep timer count setting (five second)

  writeRegister(0x29, 0x10); 

6.  interrupt enable setting  (motion, automatic sleep and wake up enable)

  writeRegister(0x2D, 0x84);

7.  configuration setting (set auto sleep, wake up to INT1)

  writeRegister(0x2E, 0x80);

8.  wake up control setting (motion)

  writeRegister(0x2C, 0x08);

9.  sample rate setting (sleep : 12.5Hz,  wake : 12.5Hz)

  readRegister(0x2A, &CTRL_REG1_Data);
  CTRL_REG1_Data &= 0x07;
  CTRL_REG1_Data |= 0x68;
  writeRegister(0x2A,CTRL_REG1_Data);

10.  motion detection setting

  writeRegister(0x15, 0xD8);

11.  motion detection threshold setting ( switchable)

  writeRegister(0x17, 0x01);
  writeRegister(0x17, 0x02);
  writeRegister(0x17, 0x03);

12.  device counter setting (300ms/80ms=4)

  writeRegister(0x18, 0x04);

13.  active mode setting

  readRegister(0x2A, &data);
  writeRegister(0x2A, data | 0x01);

Is there a cause for the sleep current not to fall in the above settings?

The board current at sleep is 235uA, but if you remove the MMA8452 from the board and put the CPU to sleep, the board current will drop to 5uA.

Regards,

Takuya

Labels (1)
0 Kudos
1 Reply

1,633 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Takuya-san,

I do not have enough time right now to try to reproduce your settings, but there is a good example illustrating the use of auto-wake/sleep mode available at:

https://community.nxp.com/docs/DOC-332453

Eventually you can also take a closer look at my example code at:

https://community.nxp.com/thread/318705

Hope it helps!

Best regards,

Tomas

PS: If this answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-963025%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMMA8452%20sleep%20current%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-963025%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello.%3C%2FP%3E%3CP%3EI%20am%20working%20on%20a%20development%20project%20using%20MMA8452%2C%20but%20I%20am%20facing%20the%20problem%20that%20the%20sleep%20current%20of%20MMA8452%20doesn't%20go%20down.%3C%2FP%3E%3CP%3EAutomatic%20sleep%20and%20wake%20up%20of%20MMA8452%20functions%20are%20set%2C%20and%20the%20CPU%20also%20transitions%20to%20sleep%20based%20on%20the%20sleep%20interrupt%20signal%20from%20MMA8452.%3C%2FP%3E%3CP%3EHowever%2C%20the%20consumption%20current%20of%20MMA8452%20doesn't%20fall%20after%20sleep.%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3EI%20am%20doing%20the%20following%20configuration%20setting%20on%20the%20device.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E1.%26nbsp%3B%20standby%20mode%20setting%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E%E3%80%80%E3%80%80readRegister(0x2A%2C%20%26amp%3Bdata)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x2A%2C%20data%20%26amp%3B%20~(0x01))%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E2.%26nbsp%3B%20dynamic%20range%20setting%20(2G)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E%E3%80%80%E3%80%80readRegister(0x0E%2C%20%26amp%3BXYZ_DATA)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG3_Data%20%26amp%3B%3D%200xFC%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x0E%2C%20XYZ_DATA)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E3.%26nbsp%3B%20oversampling%20mode%20setting(SleepMode%20%3A%20Low%20Power%2C%26nbsp%3B%20ActiveMode%20%3A%20Low%20Power)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E%E3%80%80%E3%80%80readRegister(0x2B%2C%20%26amp%3BCTRL_REG2_Data)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG2_Data%20%26amp%3B%3D%200xE4%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG2_Data%20%7C%3D%200x1B%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x2B%2CCTRL_REG2_Data)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E4.%26nbsp%3B%20automatic%20sleep%20and%20wake%20up%20setting%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E%E3%80%80%E3%80%80readRegister(0x2B%2C%20%26amp%3BCTRL_REG2_Data)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG2_Data%20%7C%3D%200x04%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x2B%2C%20CTRL_REG2_Data)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E5.%26nbsp%3B%20automatic%20sleep%20timer%20count%20setting%20(five%20second)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20arial%2Chelvetica%2C'helvetica%20neue'%2Cverdana%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3E%E3%80%80%E3%80%80writeRegister(0x29%2C%200x10)%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E6.%26nbsp%3B%20interrupt%20enable%20setting%26nbsp%3B%20(motion%2C%20automatic%20sleep%20and%20wake%20up%20enable)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x2D%2C%200x84)%3B%3C%2FP%3E%3CP%3E7.%26nbsp%3B%20configuration%20setting%20(set%20auto%20sleep%2C%20wake%20up%20to%20INT1)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x2E%2C%200x80)%3B%3C%2FP%3E%3CP%3E8.%26nbsp%3B%20wake%20up%20control%20setting%20(motion)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x2C%2C%200x08)%3B%3C%2FP%3E%3CP%3E9.%26nbsp%3B%20sample%20rate%20setting%20(sleep%20%3A%2012.5Hz%2C%26nbsp%3B%20wake%20%3A%2012.5Hz)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80readRegister(0x2A%2C%20%26amp%3BCTRL_REG1_Data)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG1_Data%20%26amp%3B%3D%200x07%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80CTRL_REG1_Data%20%7C%3D%200x68%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x2A%2CCTRL_REG1_Data)%3B%3C%2FP%3E%3CP%3E10.%26nbsp%3B%20motion%20detection%20setting%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x15%2C%200xD8)%3B%3C%2FP%3E%3CP%3E11.%26nbsp%3B%20motion%20detection%20threshold%20setting%20(%20switchable)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x17%2C%200x01)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x17%2C%200x02)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x17%2C%200x03)%3B%3C%2FP%3E%3CP%3E12.%26nbsp%3B%20device%20counter%20setting%20(300ms%2F80ms%3D4)%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80writeRegister(0x18%2C%200x04)%3B%3C%2FP%3E%3CP%3E13.%26nbsp%3B%20active%20mode%20setting%3C%2FP%3E%3CP%3E%E3%80%80%E3%80%80readRegister(0x2A%2C%20%26amp%3Bdata)%3B%3CBR%20%2F%3E%E3%80%80%E3%80%80writeRegister(0x2A%2C%20data%20%7C%200x01)%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIs%20there%20a%20cause%20for%20the%20sleep%20current%20not%20to%20fall%20in%20the%20above%20settings%3F%3C%2FP%3E%3CP%3EThe%20board%20current%20at%20sleep%20is%20235uA%2C%20but%20if%20you%20remove%20the%20MMA8452%20from%20the%20board%20and%20put%20the%20CPU%20to%20sleep%2C%20the%20board%20current%20will%20drop%20to%205uA.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ETakuya%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-963025%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAccelerometers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-963026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MMA8452%20sleep%20current%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-963026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Takuya-san%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20do%20not%20have%20enough%20time%20right%20now%20to%20try%20to%20reproduce%20your%20settings%2C%20but%20there%20is%20a%20good%20example%20illustrating%20the%20use%20of%26nbsp%3Bauto-wake%2Fsleep%20mode%20available%20at%3A%3C%2FP%3E%3CP%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-332453%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-332453%3C%2FA%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EEventually%20you%20can%20also%20take%20a%20closer%20look%20at%20my%20example%20code%20at%3A%3C%2FP%3E%3CP%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fthread%2F318705%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Fthread%2F318705%3C%2FA%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EHope%20it%20helps!%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CEM%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2012px%3B%22%3EPS%3A%26nbsp%3BIf%26nbsp%3Bthis%20answer%20helps%20to%20solve%20your%20question%2C%20please%20mark%20it%20as%20%22Correct%22%20or%20%E2%80%9CHelpful%E2%80%9D.%20Thank%20you.%3C%2FEM%3E%3C%2FP%3E%3CDIV%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2014px%3B%22%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2014px%3B%20margin%3A%2020px%200px%200px%3B%22%3E%3CDIV%20class%3D%22%22%20data-comment-id%3D%221182634%22%20style%3D%22color%3A%20%23646464%3B%20border%3A%20none%3B%20font-weight%3A%20inherit%3B%20font-size%3A%200.8571rem%3B%22%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E