Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BMA280 no-motion & LPM1

    ibefra
    New Poster

    Re: BMA280 no-motion & LPM1

    Thanks for detailed explanation.

    To summarize my issue:
    If I want BMA280 in LPM1 with no-motion functionality, I have to
    1. set no-motion interrupt as non-latched (INT_RST_LATCH)
    2. use filtered data (not default max ODR in PMU_BW)
    3. use software timer to measure pulse width, because BMA280 generates interrupt always (even when in motion)


    Real application:

    slo_no_mot_dur = 14 (Delay time 15s)
    software timer counts up to 285 (seconds), when BMA280 interrupt pulse is high, and resets with every high-to-low pulse transition

    osc.png

    This ensures max time 300s (5 minutes) for no-motion detection (with max 15s uncertainty, no-motion state can happen sooner than in 300. second, i.e. in 285. second, but must happen in 300. second at the latest)


    Right?

    FAE_CA1
    Community Moderator

    Re: BMA280 no-motion & LPM1

    Hi,

    When BMA280 is working in low power mode 1 (LPM1), it switches between suspend mode and normal mode automatically based on the preselected sleep time. This is so called duty cycling to save current consumption. However, when an interrupt is enabled, every time when BMA280 wakes up from suspend mode and enters normal mode, it will take one measurement and then spend the amount of duration time of the interrupt to take more measurements to see if the interrupt condition is met or not. If yes, BMA280 will generate an interrupt signal. If the interrupt condition is always met, then BMA280 will not go to suspend mode. Instead, it will remain in normal mode to keep checking if the interrupt condition is still valid or not. If not, then it will enter suspend mode and wake up again once the sleep time expires.

    This means that if you only use BMA280 no-motion interrupt in LPM1, when BMA280 is stationary, then BMA280 will always stay in normal mode that consumes 130uA all the time.

    So my suggestion to you is that whenever you see no-motion interrupt, you disable it and enable Slope (also called any-motion) interrupt. Whenever you see any-motion interrupt, you disable it and then enable no-motion interrupt. Therefore, you will save current consumption in all situation.

    Thanks.

    ibefra
    New Poster

    Re: BMA280 no-motion & LPM1

    This means that if you only use BMA280 no-motion interrupt in LPM1, when BMA280 is stationary, then BMA280 will always stay in normal mode that consumes 130uA all the time.

    I can confirm that.

    I rewrote the code to use NO_MOTION + ANY_MOTION interrupt swapping (both use pin INT2) and current consumption is good.

    But: do I then need NO_MOTION interrupt at all?

    My observation shows (Fluke amperemeter), that ANY_MOTION + LPM1 with 1 second sleep_dur + 300 seconds software timer (any motion causes its reset, by motionlessness is timer incremented) proves the same consumption and BMA doesn't stay in NORMAL mode whether in motion or at rest (PMU_BW = 500Hz, INT_RST_LATCH = 0).


    Whenever you see any-motion interrupt, you disable it and then enable no-motion interrupt.


    Why should I do that? Am I forgetting something?

    FAE_CA1
    Community Moderator

    Re: BMA280 no-motion & LPM1

    Hi,

    You are right. You don't need to use no_motion interrupt. You can just use any_motion interrupt.

    No_motion interrupt uses both internal timer and any_motion detection. But it consumes a lot of current. If there is no any_motion, then the timer starts counting for example 5 seconds or 10 seconds based on your configuration. If there is any_motion happening during the timer counting, then the timer will get reset and start counting again whenever there is no any_motion again. If it is true that there is no any_motion for the timer duration, then no_motion interrupt will be generated. This can save your MCU's effort to determine if your device is stationary or not.

    It is true that you can use your MCU's own internal timer to replace no_motion interrupt and only use any_motion interrupt.

    Thanks.

    ibefra
    New Poster

    Re: BMA280 no-motion & LPM1

    Thank You for confirmation.

     

    One last question:

    If there are no changes in acceleration (theoretically constant velocity) for 300s, software timer will reach 300 and system will detect rest state.
    Neither ANY_, nor NO_ motion solves that case.
    Right?

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist