Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 unable to write to gas registers

    Highlighted
    New Poster

    BME680 unable to write to gas registers

    Hi i have some trouble with configuring BME680. I am able to read all data and write to all registers except most important registers, gas registers. I communicate with bme680 using SPI from hal library on STM32. Data i get from gas registers except from config registers(par_g) are just zeros. Here is my code. I was looking to working arduino library and i did the same things like in this library. I tried changing modes to force mode before writing, but it seems it doesnt work. I also followed datasheet and i wrote to registers in same order like in sensor configuration flow, but it still wasnt working. 

    4 REPLIES 4
    Highlighted
    Community Moderator

    Re: BME680 unable to write to gas registers

    If you would have an oscilloscope or logic analyzer available, it would be helpful to share the capture when reading these registers. In general, it is strongly advised to try our official sensor API (available here for the BME680), then eventually base your own implementation from these.

    A few comments from a very brief comparison with our sensor API:

    • You are using u16 datatype to store par_g constants, while the sensor API uses s8/s16,
    • You are trying to read res_heat_range from 0xEE, while the sensor API reads in from 0x00,
    • (I haven't checked the remaining against the sensor API).
    Highlighted
    New Poster

    Re: BME680 unable to write to gas registers

    I dont have osciloscope :<. I think the easiest way for me now is to rewrite Bosch api. 😛  

    New Poster

    Re: BME680 unable to write to gas registers

    I rewrote bme680 api. Still cant get data from gas. I followed step by step arduino library and Bosch api which works for reading gas data. Am i doing something wrong? I cant figure out whats wrong with my code. Working code: https://github.com/adafruit/Adafruit_BME680. 

    Highlighted
    Community Moderator

    Re: BME680 unable to write to gas registers

    It is quite difficult to compare what your main code is doing since you are editing our official sensor API.

    If you managed to get gas data read-outs with third-party software, my suggestion would be to compare for both projects which data is written to the BME680, and not only that similar data is written, but also in the same order and timings.

    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