I have recently purchased a BME680 for evaluation and noticed that there are some errors in the description of pressure measurement (section 3.3.2) on the datasheet. In the floating point part there are undefined variables var1_p, var2_p and var3_p which comparing with the actual api code should be simply var1, var2 and var3. There are also some worrying mathematical errors:- (1) In initialising var1, the constant 64000.0 is used in the floating calc and the same effective value 64000 used in the integer calc. This cannot be correct because the integer calc is scaled by a factor of 100. Surely, one of these constants is incorrectly scaled? (2) Again comparing the update to var1 (line 5 in each case), the floating point and the integer versions are not mathematically equivalent. (3) Both the above issues are replicated in the driver library. It looks like the compensation formulae in the data sheet have been reverse engineered from the code. It would be helpful and much clearer if the formula were expressed mathematically for all the compensation calculations and leave the programmer to implement them appropriately. For example the temperature compensation appears to be a simple hyperbolic function: t_comp = (x - a)(b + (x-a)c)/d . Some of the manipulations documented are obscure and I suspect have been programmed to avoid register overflow. This makes it tricky to implement the formula in other languages such as java.
... View more