cancel
Showing results for 
Search instead for 
Did you mean: 

How does LIS3DH configure automatic sleep and arousal?

? ?_3
Associate II
Posted on March 16, 2018 at 11:40

I want to be able to when the device has detected movement, LIS3DH to wake up from sleep mode, and at a higher rate to detect more than I get a set of threshold, then the interrupt, to remind me of the MCU.

I tried many times to combine two functions, but failed.

Is there anyone who can help me with this?

How should the relevant registers of LIS3DH be configured?

Note: this post was migrated and contained many threaded conversations, some content may be missing.
9 REPLIES 9
Miroslav BATEK
ST Employee
Posted on March 16, 2018 at 12:14

I'm sorry, but I don't understand what exactly you want to achieve. Can you please explain it better?

Posted on March 16, 2018 at 13:40

Hi Miroslav,

   Thank you very much for your reply. What I hope is, when my equipment is forbidden, LIS3DH can work in the mode of low power consumption, the chip can work in normal mode when the apparatus moves, make the movement detection of the chip more sensitive, react faster. I found two new registers, ACT_THS and ACT_DUR, in the latest version of the datasheet. It allows the LIS3DH to automatically wake up and automatically sleep. An interrupt will also be generated when the acceleration exceeds the value I set in the ACT_THS register. If it can generate an interrupt, which related registers? I really need you to help me out.

Posted on March 19, 2018 at 16:26

Please read chapter 10 in application note

http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf

which describes the Activity / Inactivity recognition and proper register settings for this functionality.
Posted on March 23, 2018 at 09:57

Hi Miroslav,

   I have a new question to ask you about. For the interrupt 1 pin, the default is high when there is an interrupt, and low when there is no interrupt. What I need now is that the output is high when there is no interruption and low when there is an interruption. According to the datasheet's instructions, I tried to write a value of 0x02 to the CTRL_REG6 register, but it did not succeed. How can I reverse the polarity of the interrupt 1 pin?

Thank you!

Posted on March 23, 2018 at 14:58

You have something wrong with the interrupt configuration, because the default is active-high, which means low state if there is not interrupt and high state when the interrupt is active.

0690X0000060AERQA2.png
Posted on March 23, 2018 at 15:41

Maybe I didn't describe it clearly. I'm very sorry. What I want to do is, is there any way to output a low level on the pin of interrupt 1 when the device detects an interrupt; if the device does not detect an interrupt, the interrupt 1 pin continues to output a high level.

Posted on March 25, 2018 at 18:23

OK, I see, you want active low interrupt

In this case your approach is correct, you should write 0x02 into register CTRL_REG6. Is must work.

Posted on April 03, 2018 at 03:03

Hi Miroslav,

Thank you very much for your previous reply. The problem was solved well before。I am now doing a crash test. You need to use interrupts to wake up the master and read the three axis accelerations. I would like to ask if I can get the value of the acceleration that occurred at the moment of impact.

Posted on April 03, 2018 at 12:18

I saw this description in the manual of AN3308:

0690X00000604Y1QAI.jpg

What I need now is the triaxial acceleration sample data when the interrupt is triggered. I configured the lis3dh chip into Stream-to-FIFO mode. After the interrupt was generated, 32 acceleration samples were read continuously. Although the data was different, the acceleration of that axis was not higher than the threshold I set. . It is unclear where the problem has arisen, and I hope to get your advice. Here is my configuration:

void init()

{

WriteReg(CTRL_REG0, 0x90);

WriteReg(CTRL_REG5, 0x40);

WriteReg( FIFO_CTRL_REG, 0x00);

WriteReg(CTRL_REG1, 0x0F);

WriteReg(CTRL_REG2, 0x00);

WriteReg(CTRL_REG3, 0x40);

WriteReg(CTRL_REG3, 0x00);

WriteReg(CTRL_REG4, 0x00);

WriteReg(CTRL_REG5, 0x48);

WriteReg( INT1_THS, 0x44);

WriteReg( INT1_DURATION, 0x00);

WriteReg( INT1_CFG, 0x2a);

WriteReg( FIFO_CTRL_REG, 0xC0);

}

voidmain()

{

while(1)

{

1�?If an interrupt occurs

2�?Read the values of x, y, and z axes 32 times in succession and obtain 32 old acceleration samples

3�?Set LIS3DH into FIFO Bypassmode

4�?Set LIS3DH into

Stream-to-FIFO

mode

}

}

Send a cordial greeting!