Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BME680 always results in BME680_W_NO_NEW_DATA

    BME680 always results in BME680_W_NO_NEW_DATA

    mayor
    Established Member

    Hi, I am integrating a BME680 with a TI CC1312 microcontroller. I can communicate fine with the sensor over I2C, from all appearances, but any time I am trying to take readings (even from the self-test from https://github.com/BoschSensortec/BME680_driver), I am getting no new data from the sensor. I have also tried a couple different units, getting the same results.

    Here's some calibration info:

    par_h1	unsigned short	717	
    par_h2	unsigned short	1022	
    par_h3	char	0 '\x00'	
    par_h4	char	45 '-'	
    par_h5	char	20 '\x14'	
    par_h6	unsigned char	120 'x'	
    par_h7	char	-100 '\x9c'		
    par_gh1	char	-47 '\xd1'		
    par_gh2	short	-11597	
    par_gh3	char	18 '\x12'	
    par_t1	unsigned short	26045	
    par_t2	short	26419	
    par_t3	char	3 '\x03'	
    par_p1	unsigned short	36759	
    par_p2	short	-10411		
    par_p3	char	88 'X'		
    par_p4	short	7301	
    par_p5	short	-50		
    par_p6	char	30 '\x1e'	
    par_p7	char	51 '3'		
    par_p8	short	-3768	
    par_p9	short	-2137		
    par_p10	unsigned char	30 '\x1e'	
    t_fine	int	0	
    res_heat_range	unsigned char	1 '\x01'	
    res_heat_val	char	47 '/'		
    range_sw_err	char	-1 '\xff'	

     And this is what comes out from the sensor when trying to read data:

    [0]	unsigned char	0 '\x00'	
    [1]	unsigned char	0 '\x00'	
    [2]	unsigned char	128 '\x80'
    [3]	unsigned char	0 '\x00'
    [4]	unsigned char	0 '\x00'
    [5]	unsigned char	128 '\x80'
    [6]	unsigned char	0 '\x00'	
    [7]	unsigned char	0 '\x00'
    [8]	unsigned char	128 '\x80'
    [9]	unsigned char	0 '\x00'
    [10]	unsigned char	128 '\x80'
    [11]	unsigned char	0 '\x00'
    [12]	unsigned char	0 '\x00'
    [13]	unsigned char	0 '\x00'
    [14]	unsigned char	4 '\x04'

     

    Any help appreciated!

    12 REPLIES 12

    mayor
    Established Member

    I made a simpler test case which highlighted a stupid error on my part when writing to registers. That is fixed, but now I need to see why the self-test fails here:

     

     

        if ((data[0].humidity < MIN_HUMIDITY) || (data[0].humidity > MAX_HUMIDITY))
            self_test_failed++;

     

     

    and for each entry here: 

     

     

        for (i = 0; i < n_meas; i++) /* Every gas measurement should be valid */
            if (!(data[i].status & BME680_GASM_VALID_MSK))
                self_test_failed++;

     

     

    as well as:

     

     

        if ((cent_res * 5) < 6)
            self_test_failed++;

     

     

    in 

     

     

    analyze_sensor_data()

     

     

    Screen Shot 2020-10-21 at 4.08.43 PM.png

    Any pointers appreciated...

    Vincent
    Community Moderator
    Community Moderator

    In the register map you showed here,  the humidity config  in register 0x72 is 0 means humidity measurement is skipped.   

    Please double check at your side after you fix I2C write issue.  

    In the code,  it is not set as 0. 

    also the heat profile setting for gas measurement in provided register map is also wrong.  

    So,  can you give me an update register map here for double confirm if all settings write to sensor is correct? 

     

    mayor
    Established Member

    Hi Vincent,

    so after this bit of code:

        /* Set the temperature, pressure and humidity settings */
        sensor.tph_sett.os_hum = BME680_OS_2X;
        sensor.tph_sett.os_pres = BME680_OS_4X;
        sensor.tph_sett.os_temp = BME680_OS_8X;
        sensor.tph_sett.filter = BME680_FILTER_SIZE_3;
    
        /* Set the remaining gas sensor settings and link the heating profile */
        sensor.gas_sett.run_gas = BME680_ENABLE_GAS_MEAS;
        /* Create a ramp heat waveform in 3 steps */
        sensor.gas_sett.heatr_temp = 300; /* degree Celsius */
        sensor.gas_sett.heatr_dur = 150; /* milliseconds */
    
        /* Select the power mode */
        /* Must be set before writing the sensor configuration */
        sensor.power_mode = BME680_FORCED_MODE;
    
        /* Set the required sensor settings needed */
        set_required_settings = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL | BME680_FILTER_SEL
           | BME680_GAS_SENSOR_SEL;
    
        /* Set the desired sensor configuration */
        bme680_set_sensor_settings(set_required_settings,&sensor);

     

    Reading the registers should return corresponding values, right? I'll troubleshoot that once you confirm this is correct.

    Vincent
    Community Moderator
    Community Moderator

    Yes, after bme680_set_sensor_settings,  all coresponding settings should be write into registery correctly.  

    You can check there.  

    But in the Github code,  there is also some other functions before set setting like bme680_get_profile_dur,  why i didn't see it in your code screen shot?  Did you delete them?  

    mayor
    Established Member

    No, I omitted them for brevity, but it goes like:

    sensor.intf = BME680_I2C_INTF;    
    sensor.read = (bme680_com_fptr_t)read;
    sensor.write = (bme680_com_fptr_t)write;
    sensor.delay_ms = (bme680_delay_fptr_t)user_delay_ms;
    sensor.amb_temp = 22;
    bme680_init(&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