2018-03-16 03:40 AM
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.2018-03-16 04:14 AM
I'm sorry, but I don't understand what exactly you want to achieve. Can you please explain it better?
2018-03-16 06:40 AM
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.
2018-03-19 09:26 AM
Please read chapter 10 in application note
which describes the Activity / Inactivity recognition and proper register settings for this functionality.2018-03-23 02:57 AM
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!
2018-03-23 07:58 AM
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.
2018-03-23 08:41 AM
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.
2018-03-25 11:23 AM
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.
2018-04-02 08:03 PM
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.
2018-04-03 05:18 AM
I saw this description in the manual of AN3308:
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!