0

Errors in BMP280 Library
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Errors in BMP280 Library

by PhilCFG on Tue Jan 08, 2019 11:37 am

I have found two errors in the Adafruit library for the BMP280 on GitHub, Latest commit d20a271 on 8 Nov 2018
In BM280.h at line 256
Code: Select all | TOGGLE FULL SIZE
return (t_sb << 5) | (filter << 3) | spi3w_en;

should be
Code: Select all | TOGGLE FULL SIZE
return (t_sb << 5) | (filter << 2) | spi3w_en;


In BM280.h at line 272
Code: Select all | TOGGLE FULL SIZE
return (osrs_t << 5) | (osrs_p << 3) | mode;

should be
Code: Select all | TOGGLE FULL SIZE
return (osrs_t << 5) | (osrs_p << 2) | mode;


These errors caused incorrect configuration of the pressure oversampling and IIR filtering in the config and ctrl_meas registers. E.g. when setting pressure oversampling or IIR filter to x16 you get x2. I confirmed the wrong setting by viewing the I2C on a logic analyser and by noting that the raw pressure value returned was in increments of 8.

PhilCFG
 
Posts: 1
Joined: Tue Jan 08, 2019 11:22 am

Please be positive and constructive with your questions and comments.