01-14-2022 12:55 PM
Hi
I have bmp384 sensor and I did the starting configuration. Ex: configure press and temp oversampling , datarate , int pinout type, int pin enable ,data ready int ,enable pressure and tempreture reading and choose normal mode. I read the 3 bytes value for temp => xlsb , lsb , msb and I collect that byte to 1 int for ex.: xlsb= 0 lsb = 61 , msb = 130 convert to binary =>
xlsb = 0000 0000
lsb = 0011 1101
msb = 1000 0010
when I collect that bytes like that (msb<<16) | (lsb<<8) | xlsb => 1000 0010 0011 1101 0000 0000 whis is 8535296(dec). this is my raw data and I compensate that value . my compensated value is around 8.5 million or something like that. my point is compensating process doesn't change value a lot. I try 2 diffirent sensor and I get around 8.5 million value for compensated temp. Do I miss something ? Can you help me ASAP?
01-14-2022 01:18 PM
Hello dolly,
You could run github example code: https://github.com/BoschSensortec/BMP3-Sensor-API
Or refer example code in another topic: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/How-to-adapt-Bosch-Sensor-API-s-to-use-w...
01-14-2022 10:18 PM
Is there documentation some where that describes the format of the pressure registers. The source code is ~2500 lines long, it can't take that much to interpret the pressure data. I don't need compensation, I just to read the pressure values in a known unit of pressure. The data sheet only describes it as PRESS_MSB_23_16, PRESS_MSB_15_8 and PRESS_MSB_7_0.
01-17-2022 07:17 AM
Hello oxolotol,
It is 24Bit pressure data, split and storeed in three consecutive registers. You could see it from data sheet.
In Github code, there was example code that convert register value to pressure value.
/*!
* @brief This internal API is used to parse the pressure or temperature or
* both the data and store it in the bmp3_uncomp_data structure instance.
*/
static void parse_sensor_data(const uint8_t *reg_data, struct bmp3_uncomp_data *uncomp_data)
{
/* Temporary variables to store the sensor data */
uint32_t data_xlsb;
uint32_t data_lsb;
uint32_t data_msb;
/* Store the parsed register values for pressure data */
data_xlsb = (uint32_t)reg_data[0];
data_lsb = (uint32_t)reg_data[1] << 8;
data_msb = (uint32_t)reg_data[2] << 16;
uncomp_data->pressure = data_msb | data_lsb | data_xlsb;
...
}