User Manual

Data sheet
BMP085
Page 14
BST-BMP085-DS000-06 | Revision 1.3 | August 2011 Bosch Sensortec
© Bosch Sensortec GmbH reserves all rights even in the event of industrial property rights. We reserve all rights of disposal such as copying and passing on to
third parties. BOSCH and the symbol are registered trademarks of Robert Bosch GmbH, Germany.
Note: Specifications within this document are subject to change without notice.
Calculation of pressure and temperature for BMP085
C code function:
type:
bmp085_ get_ cal_ param
AC1 (0xAA , 0xAB) (16 bit) AC1 = 408
short
AC2 (0xAC, 0xAD) (16 bit) AC2 = -72
short
AC3 (0xAE, 0xA F) (16 bit) AC3 = -14383
short
AC4 (0xB0, 0xB1) (16 bit) AC4 = 32741
unsigned short
AC5 (0xB2, 0xB3) (16 bit) AC5 = 32757
unsigned short
AC6 (0xB4, 0xB5) (16 bit) AC6 = 23153
unsigned short
B1 (0xB6, 0xB7) (16 bit) B1 = 6190
short
B2 (0xB8, 0xB9) (16 bit) B2 = 4
short
MB (0xBa, 0xBB) (16 bit) MB = -32768
short
MC (0xBC, 0xBD) (16 bit) MC = -8711
short
MD (0xBE, 0xBF) (16 bit) MD = 2868
short
bmp085_get_ut
UT =
27898
long
oss = 0
= oversampling_setting
short (0 .. 3)
(u ltra l o w p owe r mode )
bmp085_get_up
UP =
2384
3
long
bmp085_ get_ temperature
X1 = (UT
- AC6) * AC5 / 2
15
X1 = 4743
long
X2 = MC * 2
11
/ (X 1 + MD )
X2 = -2344
long
B5 = X1 + X2 B5 = 2399
long
T = (B5 + 8) / 2
T = 150 temp in 0.1°C
long
BMP085 cal
p
res su re
B6 = B5 - 4000
B6 = -1601
lon
g
X1 = (B2 * (B6 * B6 / 2
12
)) / 2
11
X1 = 1
long
X2 = AC2 * B6 / 2
11
X2 = 56
long
X3 = X1 + X2 X3 = 57
long
B3 = ((AC1*4+X3) << oss + 2) / 4 B3 = 422
long
X1 = AC3 * B6 / 2
13
X1 = 2810
lon
g
X2 = (B1 * (B6 * B6 / 2
12
)) / 2
16
X2 = 59
long
X3 = ((X1 + X2) + 2) / 2
2
X3 = 717
long
B4 = AC4 * (unsigend long)(X3 + 32768) / 2
15
B4 = 33457
unsi
g
ned lon
g
B7 = ((unsigned long)UP - B 3) * (50000 >> oss) B7 = 1171050000
unsigned long
if (B7 < 0x80000000) { p = (B7 * 2) / B4 } p = 70003
long
else { p = (B7 / B4) * 2 }
long
X1 = (p / 2
8
) * (p / 2
8
)X1 =74529
long
X1 = (X1 * 3038) / 2
16
X1 = 3454
lon
g
X2 = (- 7357 * p) / 2
16
X2 = -7859
lon
g
p = p + (X 1 + X2 + 3791) / 2
4
p = 69964 press. in Pa
long
display temperature and pressure value
calculate true pressure
ca lcu late true tempe rature
re a d unco mpensa ted pre ss ure v a lue
write 0x34+(oss <<6) into re
g
0xF4, wait
read reg 0xF6 (MSB), 0xF7 (LSB), 0xF8 (XLSB)
example:
R ead c alibration data
from the E
2
PROM of the BMP085
read out E
2
PROM re
g
isters, 16 bit, MSB first
read uncompe nsated temperature v alue
UT = MSB << 8 + LSB
UP = (MSB<<16 + LSB<<8 + XLSB) >> (8-oss)
write 0x2E into re
g
0xF4, wait 4.5m
s
read reg 0xF6 (MSB), 0xF7 (LSB)
Start
Figure 3: Calculating p
ressure and temperature for BMP085