Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 unable to write to gas registers

    BME680 unable to write to gas registers

    New Poster

    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

    Community Moderator
    Community Moderator

    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).

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

    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: 

    Community Moderator
    Community Moderator

    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.