Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP280 MSB temperature is sometimes corrupted

    Jussi
    Member

    BMP280 MSB temperature is sometimes corrupted

    I am running BMP with I2C using nrf9160 as MCU and zephyr RTOS and zephyrs BME280 drivers as my SW. Using forced mode and recording pressure approximately once/10min(or every 5 seconds for testing purposes)

    My problem is that I sometimes(maybe 2% of readings) get really strange pressure values. I've tried to debug the issue and found out that pressure registers are actually probably ok, but temperature is sometimes somehow corrupted and that causes the compensated pressure to be quite off the limits too. This is the piece of code in zephyr drivers that read the result registers in one burst read: https://github.com/zephyrproject-rtos/zephyr/blob/d431b56587a9afbee091180d3511257a148a359f/drivers/s...

     

    // If I print out the register values after they are read is see this:

    // Valid registers(F7-FC):       53 00 d0 7e 8d 00
    // And when we hit the problem:  52 fd c0 3e 85 00
    //                                        ^
    // It looks like this one bit 3->7 causes temperature to be interpreted as something like
    // -50C instead of +20C and pressure to be 870hPa instead of 980hPa

    I've been eyeballing the drivers and tried to sniff the traffic with scope but my conclusion is always the same. Everything looks to be correct, sensor just sends a wrong value. Any ideas what could be causing this?

    7 REPLIES 7
    Yanchao
    Community Moderator

    Re: BMP280 MSB temperature is sometimes corrupted

    Hi,

    I find zephyr driver is BME280 but your issue is BMP280. There also some difference your zephyr driver and BMP280_driver API v3.3.4 . So please update your driver with BMP280 v3.3.4.

    Meanwhile, you could log more temperature register raw data, draw the log for analysis.

    Best regard.

    Jussi
    Member

    Re: BMP280 MSB temperature is sometimes corrupted

    Hi and thanks for suggestions.

    I've tried to read the section 5.2 from here https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280-DS002.pdf (Register compatibility with BMP) and compare it with zephyr drivers and I think it should work with both BME and BMP. But then again, I have habit of being incorrect. Did you spot any particular difference?

    By saying "log more temperature register raw data" do you mean that get the temperature register dumps from several measurements or soemthing else? I can definitely do that. I think I will also try to ditch the zephyr drivers and try the once you linked directly.

    Jussi
    Member

    Re: BMP280 MSB temperature is sometimes corrupted

    I took the drivers from bosch repository(no effect to the problem) and used them to get some logs(attached). Logs show the raw values read from the registers by the drivers and the compensated result also.

    I also managed to get scope capture from the offending byte. To me it seems like BME is really sending that 0x7D instead of 0x3D, so it is not any disturbance in the I2C line.

    Feeling kind of cluesless at the moment...

    Jussi_0-1600693661733.png

    Yanchao
    Community Moderator

    Re: BMP280 MSB temperature is sometimes corrupted

    Hi,

    Sorry, I couldn't download your file, please upload a right format. I'll feedback your issue to my colleague.

    If you confirm the raw data(0xf7-0xfc) is change, suggest solder a new sensor to check. From my experience, temp raw data shouldn't jump from 20℃ to -50℃.

    Best regards.

    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