10-21-2020 07:20 PM
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!
Solved! Go to Solution.
10-21-2020 07:31 PM
Please share your code implementation here.
From the register value you posted, the measurement of sensor is not really happen, all result is 0.
10-21-2020 07:58 PM
Hi Vincent,
well, my code is essentially the self-test code from the Bosh GitHub.
I have created read/write i2c functions as well as delay, which appear to be working (I can read and write to registers, see calibration registers).
int8_t BME680::i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint16_t len) {
uint8_t writeBuf[1] = {reg_addr};
i2cTransaction.readCount = len;
i2cTransaction.readBuf = reg_data;
i2cTransaction.writeCount = 1;
i2cTransaction.writeBuf = writeBuf;
bool status = I2C_transfer(i2c, &i2cTransaction);
return !status;
}
int8_t BME680::i2c_write(uint8_t reg_addr, uint8_t *reg_data, uint16_t len) {
i2cTransaction.readCount = 0;
i2cTransaction.writeCount = len;
i2cTransaction.writeBuf = reg_data;
bool status = I2C_transfer(i2c, &i2cTransaction);
return !status;
}
void BME680::delay(uint32_t delayMs) {
Task_sleep(delayMs*100); //fixme, must take into account actual duration of a tick (10us here)
}
10-21-2020 08:27 PM
Then in this case, can you try to read out whole register map of BME680 and provide here?
10-21-2020 09:39 PM
Hi,
here's what I see (same order as they appear in the docs):
0xd0: 97
0x72: 0
0x74: 100
0x75: 0
0x50: 0
0x51: 0
0x52: 0
0x53: 0
0x54: 114
0x55: 0
0x56: 0
0x57: 0
0x58: 0
0x59: 0
0x5a: 0
0x5b: 0
0x5c: 0
0x5d: 0
0x5e: 0
0x5f: 0
0x60: 0
0x61: 0
0x62: 0
0x63: 0
0x64: 0
0x65: 0
0x66: 0
0x67: 0
0x68: 0
0x69: 0
0x6a: 0
0x6b: 0
0x6c: 0
0x6d: 0
0x70: 0
0x71: 0
0x1f: 128
0x20: 0
0x21: 0
0x22: 128
0x23: 0
0x24: 0
0x25: 128
0x26: 0
0x2a: 0
0x2b: 4
0x1d: 0