Hi Tomas
Yes, I thought about bytes (register), it was my mistake.
Yes I had problem with pressure (too small, for example 107,555 Pa) and altitude (24410 or 65520 m), but it was for following configuration:
set oversampling as 128 in control register 1
set sysb bit in control register 1
set tdfe, drem and pdfe bits in ptDataCfg register
at reading time:
set reference pressure in BAR_IN register
waits for ptdr bit in status register
reads 3 bits from pressure out register
converts it into float
I thought that status register's reading was sufficient. At current configuration only altitude has bad value.
I use conversions like below:
For pressure:
union32_t integerPart = {.u8 = {rawPressure[2], rawPressure[1], rawPressure[0], 0}};
return ((float)(integerPart.u32 >> 6)) + ((float)((rawPressure[2] & 0x30) >> 4) * 0.25);
For altitude:
return ((float)((int32_t) ((rawAltitude[0] << 8) | rawAltitude[1]))) + ((float)(rawAltitude[2] >> 4) * 0.625);
Best regards. Wojciech Jasiewicz.