Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP384 returns to sleep mode after setting to normal mode. (SPI)

    BMP384 returns to sleep mode after setting to normal mode. (SPI)

    gasisk
    New Poster

    I am trying to build a bmp3xx driver for my stm32 projects and am having an issue reading data. (or more precisely getting the bmp to stay out of sleep). I follow the application note instructions (https://www.bosch-sensortec.com/media/boschsensortec/downloads/application_notes_1/bst-mps-an006.pdf) by softreseting, reading the ID, and Reading the trimming data. I then attempt to change the PWR_CTRL register (0x1B) to 0x33 (00110011) or Normal mode with the temp and press sensor active. When I immediately read back the PWR_CTRL register the value is correct (0x33) however when I attempt to read it again the chip has returned to sleep mode (0x03 or 00000011) according to the data sheet (https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp384-ds003.pdf) on page 29 bits 4 and 5 of the PWR_CTRL are the "Mode Bits". I have NOT tested the timing of this read/write cycle. ie. I am not sure if it is me reading the register that wipes the MODE selection or if after some number of ms the register wipes. I can also comment out the read section of code with no change. In all of these cases the STATUS register returns data not ready (0's in the 5th and 6th bit).  When I check for errors (0x02) there are none. And when i check the EVENT register (0x10) a successful soft-reset is shown.

    I am using 4 wire SPI,  MODE 0, and tested at 21Mbit/s down to 656 Kbit/s.

    Additionally I am fairly new to this (this is my second driver ever - and my first bosch sensor) so I may be missing something obvious.

    Thanks In Advance. 

    1 REPLY 1

    BSTRobin
    Community Moderator
    Community Moderator

    Hello gasisk,

    You could refer github example code read_sensor_data.c that demonstrated how to configure BMP3 under normal mode and read sensor data.
    https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/examples/read_sensor_data/read_sensor_...

    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