Bosch Sensortec Community

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

    BMA253 Orientation not displaying results, acts like blocking is on

    BMA253 Orientation not displaying results, acts like blocking is on

    Herb
    New Poster

    Hello, we are using the BMA253.  I am trying to get the orientation bits to show up, but they act as if they are blocked. 

    In register ox2c I write 0x00, to set no blocking, but still get no data, is there a blocking flag to check?  The data sheets states that the data will not upate if blocking is on, but I set for no blocking?

    Reading from 0x0c I get the flat bit toggling on to 1 both +Z and -Z, but OREINT<2:0> always returns zero,  0x80 is all I ever see regardless of orientation.  

    What else could be stopping OREINT<2:0> from updating?

    3 REPLIES 3

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi, please see the attached "How to use BMA253 orientation interrupt for screen rotation.pdf" for more information. Thanks.

    Hello and thank you for your reply, I had already seen that document, it is well written and very clear, that is why I am so confused on why this is not working. I am doing polling the ORIENT<2:0> bits and the flat bit to determine orientation on start up, we do not need an interrupt.  I am polling register 0x0C during this test mode at every data ready interrupt, and displaying on a UART debug with the accel data.  The accel data was clear and cogent, the flat bit tracked perfectly, but orient<2:0> never changed from 000b.  Here is my config code, I added the defines in with comments to show you the values.  Based on what I am reading it looks like it is blocking, but I am writing to, and verified the write, to set NO BLOCK.  Is there a flag that tells if blocking is active?

     

    void AccelConfig(void){
    // issue a reset
    // #define BMA253_RESET 0xB6
    AccelWriteByte(BMA253_RST_ADDR, BMA253_RESET); CyDelay(5);
    // remove blocking and set orient mode to symetrical
    // #define No_block_Symmetrical 0x00
    AccelWriteByte(BMA253_ORIENT_PARAM_ADDR,No_block_Symmetrical);
    // remove blocking and set orient mode to symetrical
    AccelWriteByte(BMA253_THETA_BLOCK_ADDR,No_block_Symmetrical);
    //start the sampling engine
    // #define Data_rate_7_81hz 0x08
    AccelWriteByte(BMA253_BW_SELECT_ADDR, Data_rate_7_81hz); // configure the bandwidth
    // #define Data_Rdy_enable 0x01
    AccelWriteByte(BMA253_INTR1_MAP_1, Data_Rdy_enable); // Map data ready to INT1
    //AccelWriteByte(BMA253_DATA_CTRL_ADDR, Disable_Shadow); // use filtered data, set Shadow so that MSB/LSB data is locked and
    // Setup Slope interrupt
    AccelWriteByte(BMA253_INTR1_MAP_0, SLOPE_INT1); // Map slope int to INT1
    AccelWriteByte(BMA253_SLOPE_THRES_ADDR, local_settings[LC_THR]); // set the threshold
    AccelWriteByte(BMA253_SLOPE_DUR_ADDR, MOTION_DURATION); // set the duration
    AccelWriteByte(BMA253_INTR_CTRL_ADDR, BMA253_LATCH_DURN_NON_LATCH); // no latching
    AccelWriteByte(BMA253_INTR_SET_ADDR, Ints_Drive_Config); // configure INTs push pull, active low;
    // enable the interrupts
    AccelWriteByte(BMA253_INTR_ENABLE0_ADDR,XYZ_MOTION_IN_ENA|Flat_detection_enable); // Enable the slope interrupt // enable flat detection
    AccelWriteByte(BMA253_INTR_ENABLE1_ADDR, New_data_enable); // Start new data interrupt
    // Start Accel Slope interrupt
    isr_Accel_StartEx(isr_ACCEL);
    isr_Accel_ClearPending();
    Accel_ClearInterrupt();
    DBG_PRINT_TEXT("\n\r Initialized Accelerometer for High G Motion detection");
    return;
    } //Accelconfig

    polling code:

     DBG_PRINTF("\r XYZTB:%d,%d,%d ", xyztb[0], xyztb[1], xyztb[2]);
     AccelReadByte(BMA253_THETA_BLOCK_ADDR);
     temp = Accel_Byte;
     DBG_PRINTF("Max value is: %d ",valuemax);
     AccelReadByte(BMA253_STAT_ORIENT_HIGH_ADDR);
     temp = Accel_Byte;
     DBG_PRINTF("Orientation: %x ",temp);

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Your code looks OK. In order to see the change of orient<2:0> from 000b, you need to enable BMA253 orientation interrupt by writing the value of 0x40 to register 0x16. So you can add one line in your function "AccelConfig(void)" that enables the orientation interrupt.

    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