Bosch Sensortec Community

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

    BMA400 Generic Interrupt reference update not working (manual and one-time, vs every time)

    BMA400 Generic Interrupt reference update not working (manual and one-time, vs every time)

    dsherman
    Member

    While testing the BMA400, the reference values do not update correctly.
    I'm  using Development Desktop 2.0 with the BMA400 shuttle board to test the Generic Interupt functions.
    Both GEN1 and GEN2 are enabled. 
    They are configured the same, except for the "activity reference update": 
    - GEN1 is set for "every time by data source"
    - GEN2 is set for "one time".

    dsherman_0-1632778025780.png

    I constantly move the board around, while pressing "Read".
    - The reference values for GEN1 update as expected. 
    - The reference values for GEN2 do not update at all.  It behaves the same as "manual" mode.

    I have confirmed that GEN2INT_CONFIG0.act_refu=01.

    Updating the  reference values "every time" means that slow changes are not detected.  For this, we need "one time".  
    "Manual" updates would work, but this increases the MCU comms traffic.  Is there another solution?

    Edit:
    I have new insight, but it does not solve the problem.  

    I am now playing with the "manual update" mode.  I can write to the reference registers (0x53, 0x54).  
    However, once written, the registers cannot be changed while the interrupt is enabled.

    In the datasheet, section 4.7:
    "Any change of an interrupt configuration must be executed when the corresponding interrupt is disabled." 

    So, to change the reference values in "manual update" mode:
    1.  disable the interrupt
    2.  change the register value
    3.  enable the interrupt.  (Oddly, we need to enable the interrupt to make the change appear in the register.)

    Using this information, I tried the "one time" update mode again.
    The "one time" update mode works, but only by toggling the interrupt "enable" bit, off and on, each time the interrupt fires.

    Is this how it was designed?  This seems bizarre.  

    Additionally, toggling the "enable" bit causes the reference registers to update, even if the interrupt has not fired. 
    This is not expected behaviour.

    9 REPLIES 9

    BSTRobin
    Community Moderator
    Community Moderator

    Hello dsherman,

    First, could we know what functions do you want to implement with GEN1 and GEN2?

    I'm just trying to figure out how this interrupt works.  The application is irrelevant, but I'll give you an example.

    A self-balancing robot (like a Segway) needs to know when its inclination changes.  Options are:
    1.  Don't use interrupts, use continuous polling.
    2.  Use the "orientation changed" interrupt
    3.  Use the "generic" interrupt
     
    Let's assume we want to use interrupts, so the first option is excluded.
    The "orientation changed" interrupt is good, but it does not force a wakeup from low-power mode.
    That leaves the "generic" interrupt.
     
    To use the generic interrupt in "manual" reference update mode, I would have to manually set the reference incline:
    1.  Measure the X, Y, and Z accelerations (read 6 data registers)
    2.  Disable the interrupt.
    3.  Write these values to the 6 reference registers.
    4.  Enable the interrupt.
     
    It seems easier to use the automatic features of the BMA400.  The automatic options are "every time" or "one time".
     
    If we use the "every time" update mode, the robot responds too slowly.  As the robot starts to fall over, the angle creeps slowly at first.  In "every time" mode, the reference registers update at every tick of Filter2.  This means the change will go unnoticed until the change from one tick to the next tick exceeds the threshold.  Small changes (say, 3/4 of the threshold value) will not trigger the interrupt.  Then the reference values update, which allows another full threshold of movement.  Another small change, and then another small change, and then another... the robot is leaning quite far before the interrupt fires.   
     
    The "one time" update option seems perfect.  Instead of updating the reference at EVERY tick, the BMA400 leaves the reference values constant until the threshold is exceeded.  When the threshold is exceeded, the interrupt triggers, which alerts the MCU.  Also when the interrupt triggers, the reference values should update.  The reference values should now indicate the current inclination of the robot, so further movement of the robot can be detected and handled the same way.  This is the behaviour that is described in the datasheet -- but this is not what happens.
     
    This is what happens (for "one time" reference updates):
    - When the generic interrupt is enabled, the reference values update.
    - When the device enters normal mode, the reference values update.  
    - When the interrupt triggers, the reference values do NOT update.  This is unexpected, and contrary to the datasheet.
     
    This means that this interrupt cannot be used for this application, unless we toggle the interrupt enable, or put the device in low-power mode between each interrupt.  Maybe we could use the generic interrupt when the device is in low power mode, and switch to the "orientation changed" interrupt when the device is in normal mode.  This seems strange to use two interrupt functions for a single purpose.  We could use one, but only if the generic interrupt behaved as the datasheet describes.
     
    Again, this isn't my real application.  I don't need help with a specific application.  I am just trying to understand how the device works.  I believe there are inconsistencies between the device behaviour and the documentation.  Any insight you can offer would be appreciated.

    BSTRobin
    Community Moderator
    Community Moderator

    Hello dsherman,

    For your description "This means that this interrupt cannot be used for this application", you could see it from data sheet, GEN1 and GEN2 means generic interrupt 1 and 2, these would generate interrupt.

    BMA400 GEN1 GEN2.png
    This article will be helpful for your reference. https://community.bosch-sensortec.com/t5/Knowledge-base/BMA400-Evaluation-Guide/ta-p/6229

    @BSTRobin,

    Three months after I tell you your product does not perform as documented, you send me a beginner's guide?  Really, @BSTRobin?  

    In another thread, I documented a different problem with the logical combination of GEN1/GEN2, and you completely ignored it, asking instead, "What functions does your product need?"  Really, @BSTRobin?

    @BSTRobin, I spent many hours analyzing and documenting these problems in your chip/documentation.  Now, three months later, you write back with "you could see it from data sheet"?  YOUR DATASHEET IS WRONG.  That's what I have been telling you.

    This is the second time you have completely ignored what I am saying, @BSTRobin.  Honestly, @BSTRobin, isn't this your job?  It isn't mine, and yet here I am, troubleshooting your product for you, again.

    When an experienced developer informs you about deep flaws in your silicon, don't ever respond with "What functions does your product need?" and send a link to a beginner's guide. That response insults my intelligence as a product designer, and it damages your company's reputation.

    I have posted in three threads about the BMA400.  In each case, I identified a different function that does not work as advertised:

    1. The Orientation Changed interrupt uses AND instead of OR when evaluating the axes.  (see thread)
    2. The GEN1/GEN2 interrupt, using manual or one-time reference updates, has the logical ALL/ANY reversed.  (see thread )
    3. This thread, in which the GEN1/GEN2 interrupt in one-time mode does not update the reference value after firing.

    The other moderator, @Vincent, understood what I wrote about the Orientation Changed interrupt, and admitted that there was a problem in the silicon.  Your responses, @BSTRobin, have been insufficient, showing very little understanding of the product.  

    Okay, let's do it your way.  Here's a screnshot of the datasheet, with a function outlined in red. 

    dsherman_0-1639528081029.png

    This function does not work.  Try it.  Set up a generic interrupt with "one-time" update.  Read the reference values.  When the interrupt triggers, read the reference values.  They have not changed.  They were not "updated after triggering the interrupt". 

    Please, please, @BSTRobin, do your job.  If you can understand that these problems are real, then you will understand that Bosch should make a BMA400-B that fixes them.  

    At very least, the BMA400 product documentation should describe these issues as "known bugs". 

    Your customers are skilled engineers.  We are extremely competent at product design.  To be effective at our jobs, we must be able to TRUST THE DATASHEET.  We select products (like this one) because they perform certain functions.  When those functions don't work as described, these flaws can cause hundreds of hours of misery and lost productivity.  Circuit boards are designed and produced, parts are purchased, prototypes assembled; when your products do not perform functions as described, the costs add up to many thousands of dollars.  

    The BMA400 is a remarkable device with unique abilities, and we will continue to use it -- but with trepidation.  We do not trust the datasheet, and we are extremely disappointed that Bosch does not seem to care.  On a scale of 1 to 10, Bosch gets an "10" for design, a "7" for implementation, and a "2" for product support.  Bosch can do better than this.

    I do not expect you to reply to this post, @BSTRobin.  I have been rude, but you deserve to hear this criticism.  If other potential users of the BMA400 read this post, and if it helps them to understand the chip's abilities and shortcomings, then this thread will have achieved its purpose.

    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