rv701 / SPL06-007

Ardino SPL06-007 Library
12 stars 7 forks source link

Changing the pressure over sampling rate from 0x03 (8) to 0x04 (16) causes wrong readings #2

Closed wadoadi closed 3 years ago

wadoadi commented 3 years ago

Hi, sorry if this is me but hopefully you can help? ` void SPL_init() { i2c_eeprom_write_uint8_t(SPL_CHIP_ADDRESS, 0X06, 0x04); // Pressure 16x oversampling *ONLY change to the code 0x03 to 0x04 for 16x.

i2c_eeprom_write_uint8_t(SPL_CHIP_ADDRESS, 0X07, 0X83); // Temperature 8x oversampling

i2c_eeprom_write_uint8_t(SPL_CHIP_ADDRESS, 0X08, 0B0111);   // continuous temp and pressure measurement

i2c_eeprom_write_uint8_t(SPL_CHIP_ADDRESS, 0X09, 0X00); // FIFO Pressure measurement  

} `

this gives a wrong pressure reading, is their something. else I need to change also?

rv701 commented 3 years ago

There are two modes of operation for the chip. There is a base mode where single values are stored in the pressure and temperature registers. Then there is a FIFO operation mode. If oversampling is increased over 8x the chip switches to the FIFO mode. I only implemented the first mode. My last batch of motivation I focused on moving the code to a library format. I think you are looking at getting high sample rate data you probably want data at a lower oversampling rate. You have to refer to the data sheet to figure out which settings give data at the fastest rates. My code should work for temp and pressure of 8x or less. For greater rate I would have to implement FIFO operation mode.

wadoadi commented 3 years ago

thanks, I will look into it if I find I need the higher rate... and if I can understand it!