Skip to content

Changes to stand by time and filter could be ignored #40

Open
@pbolduc

Description

@pbolduc

The the Bosch BME280 data sheet state,

5.4.6 Register 0xF5 "config"
The "config" register sets the rate, filter and interface options of the device. Writes to the "config" register in normal mode may be ignored. In sleep mode writes are not ignored.

Since at the end of the begin call, the mode is set to normal. Calls to setStandbyTime or setFilter may be ignored. It should also be noted about the sensor mode transitions,

3.3.1 Sensor mode transitions
If the device is currently performing a measurement, the execution of mode switching commands is delayed until the end of the currently running measurement period.

These two functions should check the current mode, if it is not in sleep mode, change to sleep mode, make the change and return to the original mode. If the device is currently measuring, it should wait until the measurement is complete before setting the values.

It is unclear in the data sheet, if in forced mode if the writes would be ignored or not. In forced mode, once the measurement is complete, the mode transitions back to sleep automatically.

The error is easy for someone to come across, for example Issue 27, the person calls begin and subsequently calls setStandbyTime andsetFilter.

I can also see setTempOverSample, setPressureOverSample and setHumidityOverSample use this get mode, set mode to sleep, change setting and set mode to original pattern. I was not able to find anything in the data sheet about requiring sleep mode for the over sample settings to take effect. The temperature and pressure settings use the same ctrl_meas register which is shared with the mode. The humidity oversampling does not take effect util a write to ctrl_meas, but it does not state the device needs to be in sleep mode.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions