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

    Hello,

    I have followed your suggestion and I have connected both VDDIO and CS to VDD 3V3. Nevertheless, the result is the same:

    [2022-12-29_21:37:04:04.684438] BMP581_REG_CMD: 0
    [2022-12-29_21:37:04:04.705762] BMP581_REG_CHIP_ID: 0x0
    [2022-12-29_21:37:04:04.716451] BMP581_REG_DRIVE_CONFIG: 0x20
    [2022-12-29_21:37:04:04.719342] BMP581_REG_DRIVE_CONFIG to write: 0x21
    [2022-12-29_21:37:04:04.736170] BMP581_REG_DRIVE_CONFIG: 0x1
    [2022-12-29_21:37:04:04.744970] BMP581_REG_CHIP_ID: 0x0
    [2022-12-29_21:37:04:04.755418] BMP581_REG_DSP_CONFIG: 0x3
    [2022-12-29_21:37:04:04.765523] BMP581_REG_OOR_CONFIG: 0x0
    [2022-12-29_21:37:04:04.776625] BMP581_REG_OSR_CONFIG: 0x0
    [2022-12-29_21:37:04:04.778334] BMP581_REG_OSR_CONFIG to write: 0x60
    [2022-12-29_21:37:04:04.795422] BMP581_REG_OSR_CONFIG: 0x40
    [2022-12-29_21:37:04:04.808031] BMP581_REG_DSP_IIR: 0x0
    [2022-12-29_21:37:04:04.808107] BMP581_REG_DSP_IIR to write: 0x9
    [2022-12-29_21:37:04:04.825126] BMP581_REG_DSP_IIR: 0x1
    [2022-12-29_21:37:04:04.847961] BMP581_ODR_CONFIG: 0x60
    [2022-12-29_21:37:04:04.848042] BMP581_ODR_CONFIG to write: 0x5D
    [2022-12-29_21:37:04:04.875064] BMP581_ODR_CONFIG: 0x19
    [2022-12-29_21:37:04:04.885106] BMP581_REG_OSR_EFF: 0x0
    [2022-12-29_21:37:04:04.895825] BMP581_REG_DSP_CONFIG: 0x3
    [2022-12-29_21:37:04:04.905390] BMP581_REG_OOR_CONFIG: 0x0
    [2022-12-29_21:37:09:09.926876] LIS2DW12 measurements:
    [2022-12-29_21:37:09:09.932608] acc_x_g: -0.0227 acc_y_g: -0.0959 acc_z_g: 1.0014
    [2022-12-29_21:37:09:09.936435] acc_x_ms2: -0.0227 acc_y_ms2: -0.0959 acc_z_ms2: 0.0014
    [2022-12-29_21:37:09:09.936505] raw_t: -2688 14.5000
    [2022-12-29_21:37:09:09.947718] BMP581 data: 0x1 0x1C 0xF 0x9 0x8 0x40
    [2022-12-29_21:37:09:09.952780] BMP581_TEMPERATURE: 15.1094
    [2022-12-29_21:37:09:09.952940] BMP581_PRESSURE raw: 0x400809
    [2022-12-29_21:37:09:09.956189] BMP581_PRESSURE: 655.6814 hPa

    [2022-12-29_21:37:10:10.957219] LIS2DW12 measurements:
    [2022-12-29_21:37:10:10.963175] acc_x_g: -0.0298 acc_y_g: -0.0861 acc_z_g: 1.0033
    [2022-12-29_21:37:10:10.966600] acc_x_ms2: -0.0298 acc_y_ms2: -0.0861 acc_z_ms2: 0.0033
    [2022-12-29_21:37:10:10.966661] raw_t: -2672 14.5625
    [2022-12-29_21:37:10:10.977740] BMP581 data: 0x0 0x18 0xF 0x3 0x8 0x40
    [2022-12-29_21:37:10:10.982723] BMP581_TEMPERATURE: 15.0938
    [2022-12-29_21:37:10:10.982881] BMP581_PRESSURE raw: 0x400803
    [2022-12-29_21:37:10:10.984906] BMP581_PRESSURE: 655.6805 hPa
    [2022-12-29_21:37:11:11.987126] LIS2DW12 measurements:
    [2022-12-29_21:37:11:11.992696] acc_x_g: -0.0227 acc_y_g: -0.1003 acc_z_g: 0.9848
    [2022-12-29_21:37:11:11.996768] acc_x_ms2: -0.0227 acc_y_ms2: -0.1003 acc_z_ms2: -0.0152
    [2022-12-29_21:37:11:11.996863] raw_t: -2688 14.5000
    [2022-12-29_21:37:12:12.007728] BMP581 data: 0x20 0x11 0xF 0x0 0x8 0x40
    [2022-12-29_21:37:12:12.012810] BMP581_TEMPERATURE: 15.0669
    [2022-12-29_21:37:12:12.012962] BMP581_PRESSURE raw: 0x400800
    [2022-12-29_21:37:12:12.015015] BMP581_PRESSURE: 655.6800 hPa

    Which could be the problem? I cannot write the needed values via I2C and it seems that only temperature measure-related bits can be written. The temperature measure seems to be correct (near 15 °C).

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Let's make BMP581 I2C communication work first and then try to read BMP581 pressure and temperature data.

    I have BMP581 shuttle board as well. The shuttle board is plugged onto APP3.0 base board at https://www.bosch-sensortec.com/media/boschsensortec/downloads/software_tools/application_boards/bst.... Then I used DD2.0 GUI SW to set the APP3.0 base board to work at I2C interface with BMP581 7-bit slave address of 0x47. Then I use logic analyzer Saleae to capture the I2C transaction at https://www.saleae.com/.

    First I read BMP581 chip ID at register 0x01 and got the value of 0x50 back as shown below. This means I2C read is working.

    BMP581 I2C read chip ID.jpg

    Then I write value of 0x60 to register 0x36 as shown below.

    BMP581 I2C register write.jpg

    Then I read register 0x36 again and got the value of 0x60 back. So it means I2C write is working.

    BMP581 I2C read register back.jpg

    BMP581 I2C communication is straight forward. Please try to use a logic analyzer to debug.

    Thanks.

    Hello,

    I have tried by connecting a Beagle I2C probe between the microcontroller and the BMP581 sensor. With the I2C probe I see that all the transactions are correct:

    msu_0-1672397930096.png

    I even see that the registers are correctly written:

    msu_1-1672398149161.png

    And the measurements values are correct:

    msu_2-1672398190804.png

    So the problem might be in the microcontroller's I2C driver. I will check that.

    [UPDATE 2023-01-02]: I have changed the master's clock speed from 400 kHz to 1 MHz. At 1 MHz I receive all the values correct. I have also tried with a clock rate of 100 kHz but I get the same results I get at 400 kHz (incongruous measurements even if the I2C probe shows the correct values).

    Thanks for your help.

    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