Skip to main content
Visitor II
August 18, 2020
Solved

I am using a LSM6DS3, I need to receive a an interrupt signal on int1 or int2 pin which ever. When I try to set up the wake up interrupt signal as in the AN4650 chapter 4.3, it doesn't seem to trigger ever? Do you have any sample projects using this?

  • August 18, 2020
  • 8 replies
  • 3944 views

I search the net, and found a post with someone with a similar issue, but the link that was posted on the response is dead error 404.

I was able to set up the significant motion event to trigger on int1 but it only seems to read 1 axis of the accelerometer. And depending on its position it might never triggers the interrupt

What I would like to do is set up a "wake up" interrupt, that happens when motion is detected on any of the accelerometer axis.

Do you have any examples or sample code of this being implemented?

The one in the AN4650 never triggers no matter how i shake my board.

Thank you.

Luis.

    This topic has been closed for replies.
    Best answer by LSmit.1

    Niccolo tutti va bene.

    I am sorry to have bothered you. But after reproducing the steps you asked me too, and checking that everything was ok on my side. I went and checked in with the person who built the board for me, to check if a signal was emitted with the osciloscope like you suggested.

    And we found the issue apparently he put on a LSM6DSMtr instead of the LSM6DS3. Needless to say, it was never going to work since the wakeup interrupt although similar are programmed differently on both models.

    Once again, thank you for your help.

    And sorry to have wasted your time, although I did learn about significant motion, so it wasn't a total loss of time for me!

    Sincerely,

    Luis.

    8 replies

    ST Employee
    August 19, 2020

    Hi Luis @LSmit.1​ ,

    let me try to help you with your problem: I know some of the steps I'll ask you to verify are basic, but the most difficult bugs to track are often the basic ones, so I'll start with these.

    Please confirm that:

    • register CTRL9_XL (18h) has bot x,y, and z axis enabled (bits Z-Y-X en_XL)
    • register WAKE_UP_THS (5Bh) has not a high threshold to reach (bits WK_THS 0-5)

    On a side note, I'm not sure if your interrupt triggers only for one axis (I'd like to know which one) o does not trigger at all (as you stated in the title), this could help in finding the next step to follow.

    Let me know if this helps.

    LSmit.1Author
    Visitor II
    August 19, 2020

    I write do activate all three axis, I write 38h to the CTRL9_XL (18h)

    I send 00h to the WAKE_UP_THS to have the lowest threshold possible.

    I receive the event on int1, that i programmed on the MD1_CFG writing 20h

    int1 never receives the interrupt, I move it in x y z axis, shake it, rotate it... I never receive the event. I tried with or without latching. Same thing.

    ST Employee
    August 19, 2020

    So I understood that you want your wakeup event on INT1 but it does not show, right?

    other 2 questions:

    • what ODR are you using?
    • did you confirm with an oscilloscope if the interrupt is generated or not? (it could be the microcontroller that is not able to sense the interrupt)

    maybe if you can share the section where you initialize the sensor I can help you better.

    LSmit.1Author
    Visitor II
    August 19, 2020

    I am making due with the significant motion interrupt, but I am not quite sure what is considered a significant motion, the accelerometer looks for event greater than the threshold on any axis for sig motion?

    ST Employee
    August 19, 2020

    the significant motion interrupt is not the same as the wakeup interrupt, that should be configured using the embedded functions of the sensor

    (page 52 of this application note explains it better: https://www.st.com/resource/en/application_note/dm00402563-lsm6dsl-alwayson-3d-accelerometer-and-3d-gyroscope-stmicroelectronics.pdf )

    LSmit.1Author
    Visitor II
    August 20, 2020

    Yes I know, they are different events/interrupts, but when I use the sig motion and shake or move my board, the microcontroller receives the interrupt on pin1 like I ask.

    But what is a significant motion, any motion that is greater than the threshold accel on any active axis (x y z being active in my case) or does it need to be a grouping of readings that exceed the threshold?

    What constitute a significant motion is not very well explained.

    If you could point me in the direction of a definition of the significant motion, or explain it to me or give me an example of what constitutes a significant motion I would appreciate it. Currently my board receives the sig motion interrupt when I shake it, any which way, but I would like to know if sig motion will be apropriate for my end use. If it satisfies my use case, it could take the place of the wakeup interrupt and we could cut this discussion short.

    As to the wake up settings

    I am using the DS3 model so I am following the example from the AN4650. The significant motion work, But when I input the very same inputs described in chapter 4.3 from the AN4650 I do not get any results. Could you check that those inputs are indeed correct?

    "1 Write 60h into CTRL1_XL // Turn on the accelerometer // ODR_XL = 416 Hz, FS_XL = 2g

    2 Write 00h into TAP_CFG // Apply slope filter; latch mode disabled

    3 Write 00h into WAKE_UP_DUR // No duration

    4 Write 02h into WAKE_UP_THS // Set wake-up threshold

    5 Write 20h into MD1_CFG // Wake-up interrupt driven to INT1 pin"

    ST Employee
    August 20, 2020

    I'm sorry if I wasn't able to help you, let me try to answer to your questions in a better way:

    The significant motion recognition is embedded thanks to the step counter function of the LSM6DS3: it triggers the interrupt when the number of steps in SM_THS_[7:0] bits of register SM_THS is met (see section 6.2 of AN4650). You are right, there is not a complete definition of what a significant motion is in this Application Note, we will update it as soon as possible.

    I can't confirm with my sensor right now, I'll do it tomorrow and let you know if you found some problem in the AN.

    Meanwhile you can check whether your registers are clean or not, when you begin to write, and have the right values after you write them.

    This is to rule out that some bits are interfering with your initialization.

    LSmit.1Author
    Visitor II
    August 20, 2020

    Just check the registers, everything is as it should be I receive the right values from the read. The exact same as the one I wrote.

    LSmit.1Author
    Visitor II
    August 20, 2020

    No worries, I just boldened some stuff just to make it stand out, I am not mad or anything, thank you for trying to help.

    I am going to write to my registers and read them right away see if I get the values I put in.

    Thank you for detailing what constitute significant motion, the explanation goes hand in hand with the experimental results I was receiving where I had to bound my board up and down and linear motion didnt seem to wake it up.

    I will get to reading what I write to the register and get back to you.

    ST Employee
    August 20, 2020

    Don't worry, I didn't take it personal, just trying to be polite.

    thank you, I'll be back tomorrow with my results.

    LSmit.1AuthorAnswer
    Visitor II
    August 20, 2020

    Niccolo tutti va bene.

    I am sorry to have bothered you. But after reproducing the steps you asked me too, and checking that everything was ok on my side. I went and checked in with the person who built the board for me, to check if a signal was emitted with the osciloscope like you suggested.

    And we found the issue apparently he put on a LSM6DSMtr instead of the LSM6DS3. Needless to say, it was never going to work since the wakeup interrupt although similar are programmed differently on both models.

    Once again, thank you for your help.

    And sorry to have wasted your time, although I did learn about significant motion, so it wasn't a total loss of time for me!

    Sincerely,

    Luis.

    ST Employee
    August 21, 2020

    That's very good news, I'm happy that you could find the problem.

    I too learned something by noticing that the application note needs to explain better what the significant motion is =)

    Best regards

    ST Employee
    August 21, 2020

    Hello guys, as a side note please consider that a (very) short -and a bit general- definition of significant motion as intended by st for accelerometers can be found in the LIS2DS12 AN4748 at p.30:

    The significant motion function generates an interrupt when a ‘significant motion’, that could be due to a change in user location, is detected. To be considered significant, a motion should be at least 5 steps (of the pedometer / step counter).

    The general meaning of significant motion is broader, including sometimes all the low-power-consumption embedded features that enable you to detect a (specific) movement.

    Regards

    LSmit.1Author
    Visitor II
    August 21, 2020

    Yeah the part you highlighted as being 5 steps is really what was missing fo rme to understand it directly from the description in the AN4650. But thanks to Niccolo's explanation I understood it was steps, and why I had to bounce my board up and down to wake it up made sense. (when I was using sig motion interrupt)