Datasheet
ICP-10111
Document Number: DS-000177 Page 17 of 31
Revision: 1.3
5.10 READ-OUT OF CALIBRATION PARAMETERS
For converting raw pressure data to physical values, four calibration parameters have to be retrieved from the OTP of the sensor.
Set up of OTP read:
1) Send I
2
C write header 0xC6
2) Send command 0xC595 (move pointer in address register)
3) Send address parameter together with its CRC 0x00669C
Steps 1) – 3) can be executed on many platforms by a single I
2
C write of the value 0xC59500669C.
Read out parameters:
Repeat the following procedure 4 times:
a) Send I
2
C write header 0xC6
b) Send command 0xC7F7 (incremental read-out of OTP)
c) Send I
2
C read header 0xC7
d) Read 3B (2B of data and 1B of CRC)
e) Decode data as 16bit big endian signed integer and store result into n-th calibration parameter cn.
Steps a) to d) can be executed on many platforms by a single write 0xC7F7 to the chip address followed by a single read of 3 B from
the chip address.
5.11 SAMPLE CODE: EXAMPLE C SYNTAX
/* data structure to hold pressure sensor related parameters */
typedef struct inv_invpres
{
struct inv_invpres_serif serif;
uint32_t min_delay_us;
uint8_t pressure_en;
uint8_t temperature_en;
float sensor_constants[4]; // OTP values
float p_Pa_calib[3];
float LUT_lower;
float LUT_upper;
float quadr_factor;
float offst_factor;
} inv_invpres_t;
int inv_invpres_init(struct inv_invpres * s)
{
short otp[4];
read_otp_from_i2c(s, otp);
init_base(s, otp);
return 0;
}
int read_otp_from_i2c(struct inv_invpres * s, short *out)
{
unsigned char data_write[10];
unsigned char data_read[10] = {0};
int status;
int i;
// OTP Read mode
data_write[0] = 0xC5;
data_write[1] = 0x95;
data_write[2] = 0x00;
data_write[3] = 0x66;
data_write[4] = 0x9C;