11-29-2022 04:23 PM
Hello,
I'm using a BMP581 Shuttle Board 3.0 and I'm having problems reading the pressure via I2C. I read six registers starting at the 0x1D address (TEMP_DATA_XLSB). The temperature data seems to be correct. Nevertheless, the pressure registers are always set to the default value 0x7F. The CS and SDO pins are connected to VDDIO and VDDIO is connected to VDD (3.3V). Moreover, the values I write in ODR_CONFIG and DRIVE_CONFIG registers are not saved and I cannot write to OSR_CONFIG register.
Which could be the problem?
12-27-2022 07:46 PM
Hi,
Thanks for your inquiry.
Here is what you can do:
Then you can repeatedly burst read data registers from 0x1D to 0x22 in one I2C transaction at any time as long as your sampling rate is lower than 10Hz.
Final temperature = (3-byte unsigned integer from 0x1D to 0x1F) / 65536 in the unit of C,
and final pressure = (3-byte unsigned integer from 0x20 to 0x22) / 64 in the unit of Pa.
Thanks.
12-28-2022 10:18 AM - edited 12-28-2022 05:18 PM
Hello,
I still cannot configure the registers with the values you suggest:
BMP581_REG_OSR_CONFIG: 0x0
BMP581_REG_OSR_CONFIG to write: 0x60
BMP581_REG_OSR_CONFIG: 0x40
BMP581_ODR_CONFIG: 0x60
BMP581_ODR_CONFIG to write: 0x5D
BMP581_ODR_CONFIG: 0x19
Is there any reason why the BMP581 won't accept the values sent by I2C and set other ones? Is there any register locking the OSR and ODR updating?
12-28-2022 07:59 PM
Hi,
BMP581 doesn't have any register to block updating OSR and ODR registers' configuration. Please check your I2C communication.
First you can try to read BMP581 register 0x01 to see if you can get the value of 0x50 back or not. If yes, then it means your I2C single-byte reading is working. Then you can try to write value of 0x60 to register 0x36. If you read register 0x36 and get the value of 0x60 back, then it means your I2C single-byte writing is working. At the end you can try to read BMP581 data registers in one single I2C transaction to see if you can get the correct pressure and temperature data back or not.
Thanks.
12-29-2022 01:43 PM - edited 12-29-2022 04:52 PM
Hello,
The chip ID I read is 0x0 and not 0x50. The sensor is connected as follows:
VDD -> 3V3
VDDIO -> Not connected
GND -> Microcontroller's GND
GPIO0-GPIO3 -> Not connected
CS -> Not connected ('i2c_csb_pup_en set' to '1' by software)
SCL -> Microcontroller's SCL
SDO -> 3V3 (I2C slave address 0x47)
SDA -> Microcontroller's SDA
GPIO4-GPIO7 -> Not connected
PROM_RW -> Not connected
(I am using a BMP581 shuttle board 3.0)
On the same I2C bus I have another sensor connected which also measures the temperature. The temperature readings are quite similar for both:
LIS2DW12 measurements:
acc_x_g: -0.0144 acc_y_g: -0.0630 acc_z_g: 0.9457
acc_x_ms2: -0.0144 acc_y_ms2: -0.0630 acc_z_ms2: -0.0543
raw_t: -2704 14.4375
BMP581 data: 0x0 0x7C 0xF 0x83 0x8C 0x41
BMP581_TEMPERATURE: 15.4844
BMP581_PRESSURE raw: 0x418C83
BMP581_PRESSURE: 671.2205 hPa
LIS2DW12 measurements:
acc_x_g: -0.0171 acc_y_g: -0.0551 acc_z_g: 0.9460
acc_x_ms2: -0.0171 acc_y_ms2: -0.0551 acc_z_ms2: -0.0540
raw_t: -2704 14.4375
BMP581 data: 0x83 0x7C 0xF 0x40 0x8F 0x41
BMP581_TEMPERATURE: 15.4864
BMP581_PRESSURE raw: 0x418F40
BMP581_PRESSURE: 671.3300 hPa
LIS2DW12 measurements:
acc_x_g: -0.0151 acc_y_g: -0.0632 acc_z_g: 0.9460
acc_x_ms2: -0.0151 acc_y_ms2: -0.0632 acc_z_ms2: -0.0540
raw_t: -2688 14.5000
BMP581 data: 0x4F 0x7F 0xF 0x4 0x8F 0x41
BMP581_TEMPERATURE: 15.4973
BMP581_PRESSURE raw: 0x418F04
BMP581_PRESSURE: 671.3206 hPa
LIS2DW12 measurements:
acc_x_g: -0.0117 acc_y_g: -0.0615 acc_z_g: 0.9448
acc_x_ms2: -0.0117 acc_y_ms2: -0.0615 acc_z_ms2: -0.0552
raw_t: -2720 14.3750
BMP581 data: 0x1 0x79 0xF 0x19 0x81 0x41
BMP581_TEMPERATURE: 15.4727
BMP581_PRESSURE raw: 0x418119
BMP581_PRESSURE: 670.7639 hPa
Nevertheless, I have problems for writing into the BMP581's registers. At the beggining of the program I reset the sensor to its default parameters by writing 0xB6 in the 0x7E register:
BMP581_REG_CMD: 0
Then, I read the 0x01 register and I get 0x00 as result:
BMP581_REG_CHIP_ID: 0x0
When I read the 0x13 register the value is 0x20:
BMP581_REG_DRIVE_CONFIG: 0x20
Then I try to set the 'i2c_csb_pup_en set' bit to '1' so the value to be written should be 0x21:
BMP581_REG_DRIVE_CONFIG to write: 0x21
Nevertheless, when I read the register after the writing the 'i2c_csb_pup_en set' bit has been updated but the former value (0x2*) has been replaced by 0:
BMP581_REG_DRIVE_CONFIG: 0x1
I have tried reading the 0x01 register once again and the value is still 0:
BMP581_REG_CHIP_ID: 0x0
When I read the other registers after a writing instruction I receive values different from what they were meant to be written:
BMP581_REG_DSP_CONFIG: 0x3
BMP581_REG_OOR_CONFIG: 0x0
BMP581_REG_OSR_CONFIG: 0x0
BMP581_REG_OSR_CONFIG to write: 0x60
BMP581_REG_OSR_CONFIG: 0x40
BMP581_REG_DSP_IIR: 0x0
BMP581_REG_DSP_IIR to write: 0x9
BMP581_REG_DSP_IIR: 0x1
BMP581_ODR_CONFIG: 0x60
BMP581_ODR_CONFIG to write: 0x5D
BMP581_ODR_CONFIG: 0x19
BMP581_REG_OSR_EFF: 0x0
BMP581_REG_DSP_CONFIG: 0x3
BMP581_REG_OOR_CONFIG: 0x0
I can write the bits related to the tempearature measurement but not the bits related to the pressure measurement. As the registers can be read I don't understand how this could be a problem with the I2C connection. Besides, there is another device I can communicate with in I2C without any problem.
Finally, I have two BMP581 shuttle board 3.0 samples and when I try to read the UID of each one the values are different among them:
Board 1:
BMP581_REG_NVM_DATA_LSB: 0x0
BMP581_REG_NVM_DATA_MSB: 0x24
BMP581_REG_NVM_DATA_LSB: 0xFF
BMP581_REG_NVM_DATA_MSB: 0x0
BMP581_REG_NVM_DATA_LSB: 0x0
BMP581_REG_NVM_DATA_MSB: 0x87
Board 2:
BMP581_REG_NVM_DATA_LSB: 0x27
BMP581_REG_NVM_DATA_MSB: 0x27
BMP581_REG_NVM_DATA_LSB: 0xFF
BMP581_REG_NVM_DATA_MSB: 0x0
BMP581_REG_NVM_DATA_LSB: 0x0
BMP581_REG_NVM_DATA_MSB: 0x87
It doesn't seem like a problem on the I2C bus.
12-29-2022 06:16 PM
Hi,
If you are using BMP581 shuttle board, then please tie VDDIO to VDD 3V3 and also tie CS to VDD 3V3 for I2C communication. BMP581 needs both VDD and VDDIO to ramp up and be stabilized at their operating voltage level so that it can start its power-on reset (POR). If you don't connect VDDIO to 3V3, then BMP581 is not powered on. Therefore, I2C communication will not work.
Thanks.