Bosch Sensortec Community

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

    BMI270 accelerometer range do NOT change

    BMI270 accelerometer range do NOT change

    Anatol
    Member

    Whatever is written to the register 0x41 ACC_RANGE I always get 1G readings around 4100 LSB so 8G range (default). 

    The register was set either by API configuration like:

    config.cfg.acc.range = BMI2_ACC_RANGE_2G;

    or directly by code:

    const uint8_t byte0x03 = 0x03; // 16G range
    bmi2_set_regs(0x41, &byte0x03, 1, &bmi2);

    - no difference. The register is read by:

    bmi2_get_regs(0x41, reg_data, 1, &bmi2);
    Serial.print("Read 0x41 ACC_RANGE HEX (0x00 = 2g) = "); Serial.print(reg_data[0], HEX); 

    after accelerometer readings and it corresponds to what I write, like 0x00, 0x03, so no way 0x41 ACC_RANGE is reset to default somewhere in code. But raw readings for accelerometer data for 1G never change. Tried two BMI270 boards - no difference.

    Any ideas how can it be possible?

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Anatol,

    The example on GitHub works well. I think you can refer to the example program to check whether each step is successful, and then check whether the acceleration data is normal.
    https://github.com/BoschSensortec/BMI270-Sensor-API

    Hi BSTRobin.

    I  use Arduino IDE, API you pointed out does not work there as I understand, so I used BMI270_COINES_SPI_Accel_Gyro 


    https://community.bosch-sensortec.com/varuj77995/attachments/varuj77995/bst_community-mems-forum/474...

    It didn't compile at first so I had to make many changes to get it working, had to adopt to I2C bus and ESP32 controller. But as I understand, COINES is essentially the same code as the library in your link, just adopted for Arduino, right?  It is what I use to communicate with BMI270.

    Oops! I just tried my previous code described above and it really shows correct acceleration, so it is after my later implementation of it into a more complicated code when problem starts. Great, now I have a starting point. Thanks very much for a clue.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Anatol,

    Our reference code sensor API was written in C language, which is different from Arduino. However, it could be migrated to different platform, and the Coins interface can be replaced with the interface of Arduino platform.

    Yes, I did it already. But I'm still puzzled how can readings from acc_range register be not in accordance with the actual LSB/g value.

    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