Bosch Sensortec Community

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

    bma456 no motion interrupt happens when it's not supposed to

    bma456 no motion interrupt happens when it's not supposed to

    jwhistle
    Member

    We are using a modified example of the bma456w example 'motion_hw_int.c'

    We set the no motion duration to 5 seconds but sometimes we get no motion interrupts right after a motion interrupt (less than 1 second after).

    See code attached in zip file in examples -> motion_hw_int

    We modified it to not use the coines library so we could run the bma456 on our custom board...

    The dependencies for running our code are not included but it's pretty self explanatory

    All we want to do is
    1. receive one interrupt when there is a any motion event

    2. receve one interrupt when there a no motion event after 5 seconds of no motion

    What we are seeing

    1. sometimes we receive an any motion event followed quickly (less than 1 second) by a no motion event and then it just keeps doing that over and over for a few seconds while we move the bma456 around slowly

     

    What should we do to prevent this behavior?

    3 REPLIES 3

    jwhistle
    Member

    This bug is easy to reproduce

    1. start the main application

    2. slowly rotate the bma456 about the x or y axis 

    3. notice that the no motion / any motion interrupt fires over and over even though the no motion duration is set to 5 seconds it happens instantly after the any motion interrupt fires

    4. if I just move the device in short bursts this issue does not happen and I get the no motion interrupt 5 seconds later after I stop moving

    BSTRobin
    Community Moderator
    Community Moderator

    Hi jwhistle,
    For your requirement:"All we want to do is: 1. receive one interrupt when there is a any motion event;2. receve one interrupt when there a no motion event after 5 seconds of no motion"
    I upload example code which works on STM32F4 for your reference.

    2023-08-01_11h37_44.png2023-08-01_11h38_13.png

    Hi, we found the issue.

    Looks like we needed to make a call to 'bma456w_set_no_mot_config' before disabling interrupts:

    bma456w_set_no_mot_config(no_mo_conf, &dev); // no_mo_conf has all axis disabled
     
    bma456w_map_interrupt(BMA4_INTR1_MAP, BMA456W_NO_MOT_INT, false, &dev);
     
    now we no longer get the erratic interrupt behavior
    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