04-13-2023 09:22 PM
After calling the following command from BSEC:
bsec_sensor_control(sensorTS, &sensor_settings); // Retrieve sensor settings to be used in this time instant by calling bsec_sensor_control
I get the following configuration values:
sensor_settings.heater_temperature = 320
sensor_settings.heating_duration = 197
sensor_settings.humidity_oversampling = 1
sensor_settings.pressure_oversampling = 5
sensor_settings.run_gas = 1
sensor_settings.temperature_oversampling = 2
sensor_settings.trigger_measurement = 1
My only concern with these values is the heating_duration which is set at 197 and should be in ms according to the code documentation:
typedef struct
{
int64_t next_call; /*!< @brief Time stamp of the next call of the sensor_control*/
uint32_t process_data; /*!< @brief Bit field describing which data is to be passed to bsec_do_steps() @sa BSEC_PROCESS_GAS, BSEC_PROCESS_TEMPERATURE, BSEC_PROCESS_HUMIDITY, BSEC_PROCESS_PRESSURE */
uint16_t heater_temperature; /*!< @brief Heating temperature [degrees Celsius] */
uint16_t heating_duration; /*!< @brief Heating duration [ms] */
uint8_t run_gas; /*!< @brief Enable gas measurements [0/1] */
uint8_t pressure_oversampling; /*!< @brief Pressure oversampling settings [0-5] */
uint8_t temperature_oversampling; /*!< @brief Temperature oversampling settings [0-5] */
uint8_t humidity_oversampling; /*!< @brief Humidity oversampling settings [0-5] */
uint8_t trigger_measurement; /*!< @brief Trigger a forced measurement with these settings now [0/1] */
} bsec_bme_settings_t;
This does not make sense to me because it should be impossible to set the heat duration to a value of 197, according to the BME688 documentation:
According to the above image, the only possible options are the following
1 to 63 ms @ multiplication of x1 with steps of 1
4 to 252 ms @ multiplication of x4 with steps of 4
16 to 1008 ms @ multiplication of x16 with steps of 16
64 to 4032 ms @ multiplication of x64 with steps of 64
Because of the above information and the fact that 197 is a prime number, it should be impossible to configure the device at 197ms. My hypothesis is the desired configuration is 197 in gas_wait_x register which would equal to a configuration of 320 ms:
197 ==> 0xC5 ==> 1100 0101 ==> Multiplication = 64 and value = 5 ==> 64 * 5 = 320 ms
Is this an error or am I missing something?
Solved! Go to Solution.
04-15-2023 03:41 PM
Hi MrRoboto,
Let us check and give you feedback later.
04-20-2023 04:24 PM
Hi MrRoboto,
In function 'set_conf()', which has function 'cal_gas_wait()':
So we took 197ms as an example and calculated this, more details you can refer to this picture.
In short, 197 is composed of factor4 * timer49 (196).