12-12-2023 11:56 PM - edited 12-13-2023 06:58 PM
I have multiple boards with the BMP585 and they all functionally do the same thing. I am using it to poll pressure data and send an ISR when it gets a sample. It all works but each board consumes different amounts of current. I found out after graphing the current usage that the BMP585 is taking a lot more measurements than at the rate I tell it, but it is random per board.
Some boards measure at the frequency that I told it and others are seemingly doing a bunch of measurements in the background.
I am unsure if I am missing a register, but I am using the API supplied. The configuration of the device is below. I want it to send an ISR at 5Hz with a new data point I can grab. I don't need the FIFO.
Edit: I have done some more testing and even when I put the sensor in standby mode, I can see from the current measurement plot that it is still taking measurements. Reading back the mode is correct. It says it is in standby.
Second Edit: During more testing the inconsistency is still happening even between modes. On some boards the sensor when put into stanby I can see it stop measuring with the current plot. While others seem to keep taking measurements.
// Set it up to alert us when FIFO is above a certain level
struct bmp5_int_source_select intSources;
intSources.drdy_en = BMP5_ENABLE; // Get alerted for each sample
intSources.fifo_full_en = BMP5_DISABLE;
intSources.fifo_thres_en = BMP5_DISABLE;
intSources.oor_press_en = BMP5_DISABLE;
errCheck(bmp5_int_source_select(&intSources, &m_bmp585Dev), "");
// Set up the OverSampling and Output Data Rate
struct bmp5_osr_odr_press_config odrCfg;
odrCfg.odr = BMP5_ODR_05_HZ; // See ODR settings.
odrCfg.osr_p = BMP5_OVERSAMPLING_4X; // It says that 4x oversample gets standard resolution
odrCfg.osr_t = BMP5_OVERSAMPLING_1X; // 1x temp and 4x pressure get standard resolution
odrCfg.press_en = BMP5_ENABLE; // Enable pressure sensing, else it's just temperature
errCheck(bmp5_set_osr_odr_press_config(&odrCfg, &m_bmp585Dev), "Fault setting odr settings slow");
// Disable the FIFO, have it alert us with every sample
m_bmp5FifoCfg.frame_sel = BMP5_FIFO_NOT_ENABLED;
m_bmp5FifoCfg.dec_sel = BMP5_FIFO_NO_DOWNSAMPLING;
m_bmp5FifoCfg.mode = BMP5_FIFO_MODE_STREAMING; // Why not get the latest data if we are late?
m_bmp5FifoCfg.threshold = 0;
m_bmp5FifoCfg.set_fifo_iir_p = BMP5_DISABLE;
m_bmp5FifoCfg.set_fifo_iir_t = BMP5_DISABLE;
// Set up pointers for later, not needed for the chip init
m_bmp5FifoCfg.data = m_pFifoBytes;
m_bmp5FifoCfg.length = sizeof(m_pFifoBytes); // FIFO_count field could be up to 63, but datasheet says max of 16 PT or 32 T frames
// *data, length, fifo_count not used here
errCheck(bmp5_set_fifo_configuration(&m_bmp5FifoCfg, &m_bmp585Dev), "Setting fifo config slow");
/* set power mode */
errCheck(bmp5_set_power_mode(BMP5_POWERMODE_NORMAL, &m_bmp585Dev), "setting power normal");
12-18-2023 08:39 AM
Hi drew_f,
You can strictly refer to this example code https://github.com/boschsensortec/BMP5-Sensor-API/blob/master/examples/read_sensor_data_normal_mode/... which demonstrate data ready interrupt example.