Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP384 return meaningless value.

    BMP384 return meaningless value.

    dolly
    Occasional Visitor

    Hi

    I have bmp384 sensor and I did the starting configuration. Ex: configure press and temp oversampling ,  datarate , int pinout type, int pin  enable ,data ready int ,enable pressure and tempreture reading and choose normal mode. I read the 3 bytes value for temp => xlsb , lsb , msb and I collect that byte to 1 int for ex.: xlsb= 0 lsb = 61 , msb = 130 convert to binary =>

    xlsb = 0000 0000 

    lsb  = 0011 1101

    msb  = 1000 0010

    when I collect that bytes like that (msb<<16) | (lsb<<8) | xlsb => 1000 0010 0011 1101 0000 0000 whis is 8535296(dec). this is my raw data and I compensate that value . my compensated value is around 8.5 million or something like that. my point is compensating process doesn't change value a lot. I try 2 diffirent sensor and I get around 8.5 million value for compensated temp. Do I miss something ? Can you help me ASAP?

     

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Is there documentation some where that describes the format of the pressure registers. The source code is ~2500 lines long,  it can't take that much to interpret the pressure data.  I don't need compensation, I just to read the pressure values in a known unit of pressure.  The data sheet only describes it as PRESS_MSB_23_16, PRESS_MSB_15_8 and PRESS_MSB_7_0. 

    BSTRobin
    Community Moderator
    Community Moderator

    Hello oxolotol,

    It is 24Bit pressure data, split and storeed in three consecutive registers. You could see it from data sheet.

    Reg04 pressure data.png

    In Github code, there was example code that convert register value to pressure value.
    /*!
    * @brief This internal API is used to parse the pressure or temperature or
    * both the data and store it in the bmp3_uncomp_data structure instance.
    */
    static void parse_sensor_data(const uint8_t *reg_data, struct bmp3_uncomp_data *uncomp_data)
    {
    /* Temporary variables to store the sensor data */
    uint32_t data_xlsb;
    uint32_t data_lsb;
    uint32_t data_msb;

    /* Store the parsed register values for pressure data */
    data_xlsb = (uint32_t)reg_data[0];
    data_lsb = (uint32_t)reg_data[1] << 8;
    data_msb = (uint32_t)reg_data[2] << 16;
    uncomp_data->pressure = data_msb | data_lsb | data_xlsb;

    ...
    }

    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