sairfan1
Full Member level 1
- Joined
- Jun 12, 2010
- Messages
- 97
- Helped
- 4
- Reputation
- 8
- Reaction score
- 7
- Trophy points
- 1,288
- Location
- Regina, Canada
- Activity points
- 2,384
I'm writing code for PIC mcu to read sonsor BME280 through SPI (for some reason I can't use I2C) I read the datasheet and here is what I understand to read sensor.
To start onversion through Forced mode I send 0x74 which is ctrl_meas register address I send values 0x25 that means x1 oversample for temp and x1 oversampling for pressure and bit [0] 1 to set force mode
Then I delay for 20ms to let conversion completed and data registers are loaded
I send 0xF7 to read first data register and keep reading until 0xFE
In response I alway get same the values for temp, hum, pres
I want to know am I doing right to initialize the sensor? I'm sorry I do not have code with me at this time I will post later,
To start onversion through Forced mode I send 0x74 which is ctrl_meas register address I send values 0x25 that means x1 oversample for temp and x1 oversampling for pressure and bit [0] 1 to set force mode
Then I delay for 20ms to let conversion completed and data registers are loaded
I send 0xF7 to read first data register and keep reading until 0xFE
In response I alway get same the values for temp, hum, pres
I want to know am I doing right to initialize the sensor? I'm sorry I do not have code with me at this time I will post later,