Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    [BMP581]: Problem reading the pressure via I2C

    [BMP581]: Problem reading the pressure via I2C

    msu
    New Poster

    Hello,

    I'm using a BMP581 Shuttle Board 3.0 and I'm having problems reading the pressure via I2C. I read six registers starting at the 0x1D address (TEMP_DATA_XLSB). The temperature data seems to be correct. Nevertheless, the pressure registers are always set to the default value 0x7F. The CS and SDO pins are connected to VDDIO and VDDIO is connected to VDD (3.3V). Moreover, the values I write in ODR_CONFIG and DRIVE_CONFIG registers are not saved and I cannot write to OSR_CONFIG register.

    Which could be the problem?

    12 REPLIES 12

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    Here is what you can do:

    1. Power on BMP581
    2. Enable pressure measurement:
      Write value of 0x60 to OSR_CONFIG Register 0x36.  // enable pressure measurement, osr_p = x16 and osr_t = x1
    3. Switch from deep standby to normal mode
      Write value of 0x5D to ODR_CONFIG Register 0x37.  // normal mode, ODR = 10Hz

    Then you can repeatedly burst read data registers from 0x1D to 0x22 in one I2C transaction at any time as long as your sampling rate is lower than 10Hz.

    Final temperature = (3-byte unsigned integer from 0x1D to 0x1F) / 65536 in the unit of C,

    and final pressure = (3-byte unsigned integer from 0x20 to 0x22) / 64 in the unit of Pa.

    Thanks.

    Hello,

    I still cannot configure the registers with the values you suggest:

    BMP581_REG_OSR_CONFIG: 0x0
    BMP581_REG_OSR_CONFIG to write: 0x60
    BMP581_REG_OSR_CONFIG: 0x40
    BMP581_ODR_CONFIG: 0x60
    BMP581_ODR_CONFIG to write: 0x5D
    BMP581_ODR_CONFIG: 0x19

    Is there any reason why the BMP581 won't accept the values sent by I2C and set other ones? Is there any register locking the OSR and ODR updating?

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    BMP581 doesn't have any register to block updating OSR and ODR registers' configuration. Please check your I2C communication.

    First you can try to read BMP581 register 0x01 to see if you can get the value of 0x50 back or not. If yes, then it means your I2C single-byte reading is working. Then you can try to write value of 0x60 to register 0x36. If you read register 0x36 and get the value of 0x60 back, then it means your I2C single-byte writing is working. At the end you can try to read BMP581 data registers in one single I2C transaction to see if you can get the correct pressure and temperature data back or not.

    Thanks.

    Hello,
    The chip ID I read is 0x0 and not 0x50. The sensor is connected as follows:

    VDD -> 3V3
    VDDIO -> Not connected
    GND -> Microcontroller's GND
    GPIO0-GPIO3 -> Not connected
    CS -> Not connected ('i2c_csb_pup_en set' to '1' by software)
    SCL -> Microcontroller's SCL
    SDO -> 3V3 (I2C slave address 0x47)
    SDA -> Microcontroller's SDA
    GPIO4-GPIO7 -> Not connected
    PROM_RW -> Not connected
    (I am using a BMP581 shuttle board 3.0)

    On the same I2C bus I have another sensor connected which also measures the temperature. The temperature readings are quite similar for both:

    LIS2DW12 measurements:
    acc_x_g: -0.0144 acc_y_g: -0.0630 acc_z_g: 0.9457
    acc_x_ms2: -0.0144 acc_y_ms2: -0.0630 acc_z_ms2: -0.0543
    raw_t: -2704 14.4375
    BMP581 data: 0x0 0x7C 0xF 0x83 0x8C 0x41
    BMP581_TEMPERATURE: 15.4844
    BMP581_PRESSURE raw: 0x418C83
    BMP581_PRESSURE: 671.2205 hPa

    LIS2DW12 measurements:
    acc_x_g: -0.0171 acc_y_g: -0.0551 acc_z_g: 0.9460
    acc_x_ms2: -0.0171 acc_y_ms2: -0.0551 acc_z_ms2: -0.0540
    raw_t: -2704 14.4375
    BMP581 data: 0x83 0x7C 0xF 0x40 0x8F 0x41
    BMP581_TEMPERATURE: 15.4864
    BMP581_PRESSURE raw: 0x418F40
    BMP581_PRESSURE: 671.3300 hPa

    LIS2DW12 measurements:
    acc_x_g: -0.0151 acc_y_g: -0.0632 acc_z_g: 0.9460
    acc_x_ms2: -0.0151 acc_y_ms2: -0.0632 acc_z_ms2: -0.0540
    raw_t: -2688 14.5000
    BMP581 data: 0x4F 0x7F 0xF 0x4 0x8F 0x41
    BMP581_TEMPERATURE: 15.4973
    BMP581_PRESSURE raw: 0x418F04
    BMP581_PRESSURE: 671.3206 hPa

    LIS2DW12 measurements:
    acc_x_g: -0.0117 acc_y_g: -0.0615 acc_z_g: 0.9448
    acc_x_ms2: -0.0117 acc_y_ms2: -0.0615 acc_z_ms2: -0.0552
    raw_t: -2720 14.3750
    BMP581 data: 0x1 0x79 0xF 0x19 0x81 0x41
    BMP581_TEMPERATURE: 15.4727
    BMP581_PRESSURE raw: 0x418119
    BMP581_PRESSURE: 670.7639 hPa

    Nevertheless, I have problems for writing into the BMP581's registers. At the beggining of the program I reset the sensor to its default parameters by writing 0xB6 in the 0x7E register:

    BMP581_REG_CMD: 0

    Then, I read the 0x01 register and I get 0x00 as result:
    BMP581_REG_CHIP_ID: 0x0

    When I read the 0x13 register the value is 0x20:
    BMP581_REG_DRIVE_CONFIG: 0x20

    Then I try to set the 'i2c_csb_pup_en set' bit to '1' so the value to be written should be 0x21:
    BMP581_REG_DRIVE_CONFIG to write: 0x21

    Nevertheless, when I read the register after the writing the 'i2c_csb_pup_en set' bit has been updated but the former value (0x2*) has been replaced by 0:
    BMP581_REG_DRIVE_CONFIG: 0x1

    I have tried reading the 0x01 register once again and the value is still 0:
    BMP581_REG_CHIP_ID: 0x0

    When I read the other registers after a writing instruction I receive values different from what they were meant to be written:
    BMP581_REG_DSP_CONFIG: 0x3
    BMP581_REG_OOR_CONFIG: 0x0
    BMP581_REG_OSR_CONFIG: 0x0
    BMP581_REG_OSR_CONFIG to write: 0x60
    BMP581_REG_OSR_CONFIG: 0x40
    BMP581_REG_DSP_IIR: 0x0
    BMP581_REG_DSP_IIR to write: 0x9
    BMP581_REG_DSP_IIR: 0x1
    BMP581_ODR_CONFIG: 0x60
    BMP581_ODR_CONFIG to write: 0x5D
    BMP581_ODR_CONFIG: 0x19
    BMP581_REG_OSR_EFF: 0x0
    BMP581_REG_DSP_CONFIG: 0x3
    BMP581_REG_OOR_CONFIG: 0x0

    I can write the bits related to the tempearature measurement but not the bits related to the pressure measurement. As the registers can be read I don't understand how this could be a problem with the I2C connection. Besides, there is another device I can communicate with in I2C without any problem.

    Finally, I have two BMP581 shuttle board 3.0 samples and when I try to read the UID of each one the values are different among them:

    Board 1:

    BMP581_REG_NVM_DATA_LSB: 0x0
    BMP581_REG_NVM_DATA_MSB: 0x24
    BMP581_REG_NVM_DATA_LSB: 0xFF
    BMP581_REG_NVM_DATA_MSB: 0x0
    BMP581_REG_NVM_DATA_LSB: 0x0
    BMP581_REG_NVM_DATA_MSB: 0x87

    Board 2:

    BMP581_REG_NVM_DATA_LSB: 0x27
    BMP581_REG_NVM_DATA_MSB: 0x27
    BMP581_REG_NVM_DATA_LSB: 0xFF
    BMP581_REG_NVM_DATA_MSB: 0x0
    BMP581_REG_NVM_DATA_LSB: 0x0
    BMP581_REG_NVM_DATA_MSB: 0x87

    It doesn't seem like a problem on the I2C bus.

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    If you are using BMP581 shuttle board, then please tie VDDIO to VDD 3V3 and also tie CS to VDD 3V3 for I2C communication. BMP581 needs both VDD and VDDIO to ramp up and be stabilized at their operating voltage level so that it can start its power-on reset (POR). If you don't connect VDDIO to 3V3, then BMP581 is not powered on. Therefore, I2C communication will not work.

    Thanks.

    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