U
SER
'
S
G
UIDE
_______________________________________________________________________
14 ___________________________________________________________________ M010035
EN
-A
The form of coefficients (32-bit signed integer) in the eeprom:
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
eeprom:
byte_0 xxxxxxxx byte_1 xxxxxxxx byte_2 xxxxxxxx byte_3 xxxxxxxx
long_int: bit_31 xxxxxxxx bit_23 xxxxxxxx bit_15 xxxxxxxx bit_7
xxxxxxxx bit_0
MSB
LSB
32-bit signed integer
→
FLOAT
(1.0...-1.0)
float=signed_long_int/2^31
In following there is an example of C-program to convert the 32 bit
coefficients to floating point numbers.
unsigned char read_eeprom(addr)
{
/* eeprom read routine */
return(read_data);
}
/*------------------------------------------------------
-------------------- -------------------*/
void read_long_int( char addr, long int *coef )
{
unsigned char *pointer=(char*)coef;
*+=read_eeprom(addr++);
*+=read_eeprom(addr++);
*+=read_eeprom(addr++);
*pointer=read_eeprom(addr);
}
/*------------------------------------------------------
-------------------- -------------------*/
void main(void)
{
long int long_coef=0;
/* signed long integer
(32 bit) */
float float_coef=0.;
read_long_int(14,&long_coef);
float_coef=(float)long_coef/0x80000000;
printf("Float is %e\r\n",float_coef);
}
Summary of Contents for Barocap PMB100
Page 1: ...USER S GUIDE Vaisala BAROCAP Barometer Module PMB100 M010035EN A...
Page 15: ......
Page 16: ...www vaisala com M010035EN...