Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME688 Gas ADC reading

    BME688 Gas ADC reading

    joaogarretto
    New Poster

    Hello, 

    I'm currently working to get the gas results from BME 688 in force mode. 

    I have followed the steps in the datasheet, by setting up the Gas_wait register to 0x59 and the res_heat register to the calculated value, in my particular case 0xEC. 

    I am able to get Temp, Pressure, and Humidity data but, so far, Gas ADC registers keep at 0x00. 

    I have tried to increase the Gas_wait register values but had no luck yet. 

    I would appreciate any input or suggestions. 

    Attached is a screenshot with part of my code. 

    Thank you very much, 

    Joao

    Gas_ADC_Set_Up.PNG

     

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hello joaogarretto,

    You could refer attachment example code that runs well.
    https://github.com/BoschSensortec/BME68x-Sensor-API

    Hi, I started working with the sensor again in SPI mode and am facing a NO NEW DATA FOUND issue. My SPI transactions are correct as I can set the sensor configurations, and read the parameters and Chip ID correctly. 

    However, when using the get_data function and reading the values, at the end it gives me the NO NEW DATA FOUND error. I visited other posts concerning the same problem but they were not useful. I've been using API for I2C and it worked, just now for SPI this issue is appearing. Attached is a file with the .c file with the code. Below are the SPI transaction results

    Thanks

    Initializing BME.

    SPI open passed.

    ----- Length: 0x1. -----

    SPI Read Address: 0xf3.

    SPI Read Data: 0x0.

    Tmp buf set regs: 0x60 0xb6

    SPI Write Address: 0x60.

    SPI Write Data: 0xb6.

    ----- Length: 0x1. -----

    SPI Read Address: 0xf3.

    SPI Read Data: 0x0.

    ----- Length: 0x1. -----

    SPI Read Address: 0xd0.

    SPI Read Data: 0x61.

    ----- Reg data 0x61-----

    Chip ID: 61

    ----- Length: 0x1. -----

    SPI Read Address: 0xf0.

    SPI Read Data: 0x1.

    ----- Reg data 0x1-----

    ----- Length: 0x17. -----

    SPI Read Address: 0x8a.

    SPI Read Data: 0x7f.

    SPI Read Data: 0x67.

    SPI Read Data: 0x3.

    SPI Read Data: 0xf0.

    SPI Read Data: 0x16.

    SPI Read Data: 0x8d.

    SPI Read Data: 0x55.

    SPI Read Data: 0xd7.

    SPI Read Data: 0x58.

    SPI Read Data: 0x0.

    SPI Read Data: 0x2e.

    SPI Read Data: 0x22.

    SPI Read Data: 0x3f.

    SPI Read Data: 0xff.

    SPI Read Data: 0x1d.

    SPI Read Data: 0x1e.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x9a.

    SPI Read Data: 0xfb.

    SPI Read Data: 0x6d.

    SPI Read Data: 0xf3.

    SPI Read Data: 0x1e.

    ----- Reg data 0x1e-----

    ----- Length: 0xe. -----

    SPI Read Address: 0xe1.

    SPI Read Data: 0x3f.

    SPI Read Data: 0xf4.

    SPI Read Data: 0x2c.

    SPI Read Data: 0x0.

    SPI Read Data: 0x2d.

    SPI Read Data: 0x14.

    SPI Read Data: 0x78.

    SPI Read Data: 0x9c.

    SPI Read Data: 0x85.

    SPI Read Data: 0x66.

    SPI Read Data: 0x44.

    SPI Read Data: 0xda.

    SPI Read Data: 0xbe.

    SPI Read Data: 0x12.

    ----- Reg data 0x12-----

    ----- Length: 0x1. -----

    SPI Read Address: 0xf3.

    SPI Read Data: 0x0.

    SPI Write Address: 0x73.

    SPI Write Data: 0x10.

    ----- Length: 0x5. -----

    SPI Read Address: 0x80.

    SPI Read Data: 0x2c.

    SPI Read Data: 0xaa.

    SPI Read Data: 0x16.

    SPI Read Data: 0x4b.

    SPI Read Data: 0xf3.

    ----- Reg data 0xf3-----

    ----- Length: 0x1. -----

    SPI Read Address: 0xf4.

    SPI Read Data: 0x0.

    ----- Reg data 0x0-----

    ----- Length: 0x1. -----

    SPI Read Address: 0xf4.

    SPI Read Data: 0x0.

    ----- Reg data 0x0-----

    ----- Length: 0x5. -----

    SPI Read Address: 0xf1.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x10.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    ----- Reg data 0x0-----

    Tmp buf set regs: 0x71 0x80

    SPI Write Address: 0x71.

    SPI Write Data: 0x80.

    SPI Write Data: 0x72.

    SPI Write Data: 0x5.

    SPI Write Data: 0x73.

    SPI Write Data: 0x0.

    SPI Write Data: 0x74.

    SPI Write Data: 0x44.

    SPI Write Data: 0x75.

    SPI Write Data: 0x0.

    ----- Length: 0x1. -----

    SPI Read Address: 0xf4.

    SPI Read Data: 0x44.

    ----- Reg data 0x44-----

    Tmp buf set regs: 0x5a 0x9e

    SPI Write Address: 0x5a.

    SPI Write Data: 0x9e.

    Tmp buf set regs: 0x64 0x59

    SPI Write Address: 0x64.

    SPI Write Data: 0x59.

    ----- Length: 0x2. -----

    SPI Read Address: 0xf0.

    SPI Read Data: 0x1.

    SPI Read Data: 0x0.

    ----- Reg data 0x0-----

    Tmp buf set regs: 0x70 0x0

    SPI Write Address: 0x70.

    SPI Write Data: 0x0.

    SPI Write Data: 0x71.

    SPI Write Data: 0x20.

    -----------------

    Inside main loop.

    -----------------

    GET DATA!!!

    --------Set Operation Mode ------

    ----- Length: 0x1. -----

    SPI Read Address: 0xf4.

    SPI Read Data: 0x44.

    ----- Reg data 0x44-----

    Tmp buf set regs: 0x74 0x45

    SPI Write Address: 0x74.

    SPI Write Data: 0x45.

    -------- Calculate Delay ------

    -------- Get Data Function ------

    ----- Into get data API function. -----

    ----- Into Read field Data API function -----

    ----- Length: 0x11. -----

    SPI Read Address: 0x9d.

    SPI Read Data: 0xfb.

    SPI Read Data: 0x6d.

    SPI Read Data: 0xf3.

    SPI Read Data: 0x1e.

    SPI Read Data: 0x85.

    SPI Read Data: 0x36.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x0.

    SPI Read Data: 0x33.

    SPI Read Data: 0x0.

     

    Hello joaogarretto,

    From your code, the SPI read and write functions(bme68x_spi_read(), bme68x_spi_write()) in your code are different from those in my previous example code(SensorAPI_SPIx_Read(), SensorAPI_SPIx_Write()). I don't know your MCU platform. You can check these two functions and run them again.

    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