MPL115A fixed point question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPL115A fixed point question

17,760 Views
BillTheBiker
Contributor III
I am trying to make sense of the coefficients I receive from the pressure sensor MPL115A.  I can successfully access the IIC bus and get the data, but the algorithm provided in the AN3785 does not appear to work (at least for me).  Closer inspection of the comments raises some questions.  For example, the coeff C11 is described as a signed number with no int bits and 10 frac bits.  There are 11 pad zeros.  So I think the number looks like this:

S0.00000000000 F10 F9 F8 F7 F6 F5 F4 F3 F2 F1 F0

To me the representation of this number is s(0,21), but the comment says s(16,27).

When I extract the data from the sensor, C11 is given as 0x0340.  This is a 2's compliment number and only the first 11 bits are used (the 10 frac bits and the sign bit).  So if I convert this to a real number (not something I would do in the processor, but just to see if I am understanding this correctly),  I get

S0.00000000000 0000 0011 010x xxxx

this gives 2^-17+ 2^-18 + 2^-20 = 0.00001239776611328125

this is the extent of my understanding, and I wonder if someone could confirm I have done this correctly.  In addition, as the algorithm in AN3785 keeps everything in fixed point, I cannot see where lt1 (a 32-bit value) can be assigned C11 and this be correctly justified.  When I assign 0x0340 to the long I get

lt1    0x00000340
= 0000 0000 0000 0000 0000 0011 010x xxxx

so you can see I am not correctly aligned as per the bit-width specifications.  The following is the code snippet.  The comments make no sense to me, so any clarification you could prrovide would be most helpful

 //******* STEP 1 c11x1= c11 * Padc
 lt1 = (S32)sic11;                  // s(16,27)    s(N,F+zeropad) goes from s(11,10)+11ZeroPad = s(11,22) => Left Justified = s(16,27)

Thanks

-Bill
0 Kudos
35 Replies

4,868 Views
PJH
Contributor I

I assume you mean C22 for your last coefficient.

 

On one of my systems I got

 

A0=2156.625000
B1=-2.528809
B2=-1.034241
C12=0.000876
C11=0.000000
C22=0.000000


pressureADC 420
tempADC 419

result 101.802 kPa.  So that comes out at 1018.02 mBar.

 

Looking at the  values it seems that the one which is likely to be wrong is C12. Your number is much smaller than what I get.  If you put my numbers into your calculation function do you get the same result as I did?

 

Also check the decimial point position in B2 your number is a factor of 10 smaller than mine.

Don't forget too that you have to scale the pComp value.  The output is 0-1023 which is for a scale of 50kPa to 115kPa. So range is 65kPa in 1023 steps. Final pressure = (65/1023*pComp)+50

 

 

0 Kudos

4,868 Views
tremichl
Contributor I

Peter, please could you explane how you have calculated C12. The AN3785 says dec pt zero pad=9. So 9 "0" after "."  If I do so I can't get an acceptable result. Even all other values are almost the same as yours.

 

Thank you!

 

Michael

0 Kudos

4,868 Views
Mommmo
Contributor I

Hello,

I have a problem with the MPL115A2.

 

The coef data are:

3a 4d ba cc bf a6 31 78 00 00 00 00

 

Padc = 990

Tadc = 523

 

I calculate:

a0 = 1865.63

b1 = -2.16

b2 = -1.01

c12 = 0.00075

c11 = 0

c22 = 0

 

Pcomp = -411 (negative!!!)

 

Any idea?

 

Many thank !

 

Nicola (Italy)

0 Kudos

4,868 Views
ZenerX
Contributor I

 

Hi Mommmo,

 

Did you solve your problem?, As they give me similar results.

Negative pressure and a value of PADC = 990

 

regards 

0 Kudos

4,868 Views
MPL115A2
Contributor I

I've the same problem as other users of the MPL115A2 programming...

I can read the data from the registers, however, to get the real pressure and temperature is a long way to go from there,

 

ok, here's my problems and wishing someone can help me, the following are the data I read from the registers $00 to $0f

 

5a c0 75 c0 39 e3 b9 7a ca 7b 32 cc 00 00 00 00

 

Please, anyone can help me to decipher the mystery of the above data - I know the first four bytes are the Padc and Tadc value, then the a0-msb, a0-lsb, b1.....c22 etc, however, I don't know how to convert these No. into floating point notation - actually I can't find any 'Freescale' document mention about it.

 

Many thanks for your help.

0 Kudos

4,868 Views
lrf
Contributor I

It has been a long time since I worked with this component but I can tell you it works fine once you get the math correct. I found that the equations given in the manual are in correct. Unfortunately I don't remember exactly what the issue was so I went back thru my code looking for differences. The following is the only difference I can find:

 

The manual says:

siPcomp = ((S16)lt3>>13);

 

Change this to this:

siPcomp = ((S16)(lt3>>13));

 

Hope this helps

0 Kudos

4,868 Views
PWC
Contributor I

 


lrf wrote:

 

The manual says:

siPcomp = ((S16)lt3>>13);

 

Change this to this:

siPcomp = ((S16)(lt3>>13));

 



 

That was a HUGE help to me.  Thank you very much!

 

(This, plus the undocumented ox01 I2C   write that is necessary to initiate the pressure/Temp conversion)

0 Kudos

4,868 Views
risototh
Contributor I

Hi

 

has anyone solved this math mystery? I can finaly read the data from the sensor, but i can't pass thru the math described in the app. note on pages 17-18. As siPcomp i get about 5726, which is significantly more than 1023...

The coefs are fine (proccessed to float just for info: 

 

A0 Result = 2101

 B1 Result = -2.4163818359375

 B2 Result = -1.2173461914062

 C12 Result = 0.00083708763122559

 C11 Result = 0

 C22 Result = 0

 

The code is exactly copy-pasted from the app. note, but the result is completly insane...

 

Has anyone a working code snippet?

 

My data are here (pressure, temperature, coeffs):  5B 40 81 80 41 A8 B2 AD B2 17 36 DC 00 00 00 00

My code is here:

 

 

unsigned char mpl115a_raw_data[16];unsigned int mpl115a_p;unsigned int mpl115a_t;signed int mpl115a_a0;signed int mpl115a_b1;signed int mpl115a_b2;signed int mpl115a_c12;signed int mpl115a_c11;signed int mpl115a_c22;//====================================================// MPL115A Placing Coefficients into 16 bit variables//====================================================void mpl115a_raw_dissection(void){ mpl115a_p = (unsigned int)mpl115a_raw_data[0] <<8; mpl115a_p += (unsigned int)mpl115a_raw_data[1] & 0x00FF;  mpl115a_t = (unsigned int)mpl115a_raw_data[2] <<8; mpl115a_t += (unsigned int)mpl115a_raw_data[3] & 0x00FF;  mpl115a_a0 = (signed int)mpl115a_raw_data[4] <<8; mpl115a_a0 += (signed int)mpl115a_raw_data[5] & 0x00FF;  mpl115a_b1 = (signed int)mpl115a_raw_data[6] <<8; mpl115a_b1 += (signed int)mpl115a_raw_data[7] & 0x00FF;  mpl115a_b2 = (signed int)mpl115a_raw_data[8] <<8; mpl115a_b2 += (signed int)mpl115a_raw_data[9] & 0x00FF;  mpl115a_c12 = (signed int)mpl115a_raw_data[10] <<8; mpl115a_c12 += (signed int)mpl115a_raw_data[11] & 0x00FF;  mpl115a_c11 = (signed int)mpl115a_raw_data[12] <<8; mpl115a_c11 += (signed int)mpl115a_raw_data[13] & 0x00FF;  mpl115a_c22 = (signed int)mpl115a_raw_data[14] <<8; mpl115a_c22 += (signed int)mpl115a_raw_data[15] & 0x00FF;}//===================================================//Coefficient 9 equation compensation//===================================================unsigned long mpl115a_compensated_pressure(void){ //Variable used to do large calculation as 3 temp variables in the process below signed long lt1, lt2, lt3, si_c11x1, si_a11, si_c12x2, si_a1, si_c22x2, si_a2, si_a1x1, si_y1, si_a2x2;;  //Variables used for Pressure and Temperature Raw. unsigned int uiPadc, uiTadc;  signed int siPcomp; unsigned long decPcomp;   uiPadc = mpl115a_p >> 6; uiTadc = mpl115a_t >> 6; //******* STEP 1 c11x1= c11 * Padc lt1 = (signed long) mpl115a_c11; lt2 = (signed long) uiPadc; lt3 = lt1 * lt2; si_c11x1 = (signed long) lt3;  //******* STEP 2 a11= b1 + c11x1 lt1 = ((signed long) mpl115a_b1) << 14; lt2 = (signed long) si_c11x1; lt3 = lt1 + lt2; si_a11 = (signed long) (lt3 >> 14);   //******* STEP 3 c12x2= c12 * Tadc lt1 = (signed long) mpl115a_c12; lt2 = (signed long) uiTadc; lt3 = lt1 * lt2; si_c12x2 = (signed long) lt3; //******* STEP 4 a1= a11 + c12x2 lt1 = ((signed long) si_a11) << 11; lt2 = (signed long) si_c12x2; lt3 = lt1 + lt2; si_a1 =(signed long) (lt3 >> 11); //******* STEP 5 c22x2= c22 * Tadc lt1 = (signed long) mpl115a_c22; lt2 = (signed long) uiTadc; lt3 = lt1 * lt2; si_c22x2 = (signed long) lt3; //******* STEP 6 a2= b2 + c22x2 lt1 = ((signed long) mpl115a_b2) << 15; lt2 = ((signed long) si_c22x2) >> 1; lt3 = lt1 + lt2; si_a2 = ((signed long)lt3) >> 16; //******* STEP 7 a1x1= a1 * Padc lt1 = (signed long) si_a1; lt2 = (signed long) uiPadc; lt3 = lt1 * lt2; si_a1x1 = (signed long) lt3; //******* STEP 8 y1= a0 + a1x1 lt1 = ((signed long) mpl115a_a0) << 10; lt2 = (signed long) si_a1x1; lt3 = lt1 + lt2; si_y1 = ((signed long)lt3) >> 10; //******* STEP 9 a2x2= a2 *Tadc lt1 = (signed long) si_a2; lt2 = (signed long) uiTadc; lt3 = lt1 * lt2; si_a2x2 = (signed long) lt3; //******* STEP 10 pComp = y1 +a2x2 lt1 = ((signed long) si_y1) << 10; lt2 = (signed long) si_a2x2; lt3 = lt1 + lt2; // FIXED POINT RESULT WITH ROUNDING: siPcomp = (signed int)(lt3 >> 13); // goes to no fractional parts since this is an ADC count.  //decPcomp is defined as a floating point number. //Conversion to Decimal value from 1023 ADC count value. ADC counts are 0 to 1023. Pressure is 50 to 115kPa correspondingly. //decPcomp = (((unsigned long)siPcomp) * 65000 + 51150000) / 1023; // result in Pa, not kPa  decPcomp = (unsigned long)siPcomp; // temporary return decPcomp;}

 

 

0 Kudos

4,868 Views
risototh
Contributor I

Ok, finally i found the problem. The problem is in data type int. I meant that it has 16 bits (as in gcc, borland c, ...) but in fact it has 32. And therefore the negative numbers aren't negative...

 

The solution is to change all int to short (at least in CW 6.3). :smileysad:

0 Kudos

4,868 Views
MPL115A2
Contributor I

irf,

 

'It has been a long time since I worked with this component but I can tell you it works fine once you get the math correct...'

 

The problem is I can't get the math correct, I need your help, would you please explain how to convert the coef' value into floating point number in plain english, not c programming notation.

eg, the numbers I read from the registers of $00 - $0f are:

5a c0 75 c0 39 e3 b9 7a ca 7b 32 cc 00 00 00 00

 

Thanks your help.

cw.

0 Kudos

4,868 Views
lrf
Contributor I

CW,

 

Why do you need to understand the math? If you are trying to get the chip to do something then just use the programming that Freescale provided in AN3785, with the small mod I stated above. To understand the math simply reverse engineer the equations.

 

The chip is what it is and the way they chose to do the calculations is what they chose. Doing the equations at the MC is much faster and open to user tweaking better then having the chip do the math and you are stuck with the results.  Either use it or find another.

 

My weather station has been running for about a year and without any issues. Its readings track with the national weather service spot on for barometric pressure, given a correction for altitutde (NWS values are at sea level).

0 Kudos

4,868 Views
pmatil
Contributor I

Yes I meant C22. I calculated the pressure using your values and got the same result as you. And I think I finally realized what I did wrong. I looked at the first post of this thread and converted the coeffs following that as an example. So C12 is S0.0000000001110001110000 -> 2^-10 + 2^-11 + 2^-12 + 2^-16 + 2^-17 + 2^-18 = 0.0017281. But the sign bit is 1 (0x38E0). Should I invert the 13 fractional bits and add 1 to get the real result? And for the B2 it's probably the same error. Thanks for your help PJH!

0 Kudos

4,868 Views
ringo42
Contributor I

Can anyone tell me how to convert the uiTADC number to c or F? I'm getting around a 523. What is the conversion factor?

Thansk

Ringo

 

0 Kudos

4,868 Views
ringo42
Contributor I

What kind of accuracy/repeatability is anyone getting? Mine is bouncing all over the place.

Alt feet: 149
Alt feet:  57
Alt feet:  97
Alt feet:  57
Alt feet:  97
Alt feet: 109
Alt feet:  57
Alt feet:  45
Alt feet: 109
Alt feet:  45
Alt feet: 109
Alt feet:  57
Alt feet:  57
Alt feet:  97
Alt feet: 109
Alt feet:  97
Alt feet: 109
Alt feet:  57
Alt feet: 109
Alt feet: 109
Alt feet: 109
Alt feet:  97
Alt feet: 109
Alt feet:  97
Alt feet:  45
Alt feet:  57
Alt feet: 109
Alt feet:  97
Alt feet:  57

0 Kudos

4,868 Views
PJH
Contributor I

Ringo,

          Here are answers to your 2 questions.

 

1. The temperature ADC does not have a direct conversion to an actual temperature. You could always try and vary the ambient temperature of the sensor and see what the ADC value is over a range of temperatures. Then you might be able to figure out a conversion factor.

 

2. The final pressure reading is noisy and thus any conversion of that value to an altitude will also be noisy.  Typically the pressure varies quite slowly so the best approach is to take multiple readings and have a running average of the last measurements so that noise is averaged out.  For our application we take measurements every second and average over the last 100 seconds.

 

Peter

 

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-214595%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214595%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20am%20trying%20to%20make%20sense%20of%20the%20coefficients%20I%20receive%20from%20the%20pressure%20sensor%20MPL115A.%20%26nbsp%3BI%20can%20successfully%20access%20the%20IIC%20bus%20and%20get%20the%20data%2C%20but%20the%20algorithm%20provided%20in%20the%20AN3785%20does%20not%20appear%20to%20work%20(at%20least%20for%20me).%20%26nbsp%3BCloser%20inspection%20of%20the%20comments%20raises%20some%20questions.%20%26nbsp%3BFor%20example%2C%20the%20coeff%20C11%20is%20described%20as%20a%20signed%20number%20with%20no%20int%20bits%20and%2010%20frac%20bits.%20%26nbsp%3BThere%20are%2011%20pad%20zeros.%20%26nbsp%3BSo%20I%20think%20the%20number%20looks%20like%20this%3A%3CBR%20%2F%3E%3CBR%20%2F%3ES0.00000000000%20F10%20F9%20F8%20F7%20F6%20F5%20F4%20F3%20F2%20F1%20F0%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20me%20the%20representation%20of%20this%20number%20is%20s(0%2C21)%2C%20but%20the%20comment%20says%20s(16%2C27).%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20I%20extract%20the%20data%20from%20the%20sensor%2C%20C11%20is%20given%20as%200x0340.%20%26nbsp%3BThis%20is%20a%202's%20compliment%20number%20and%20only%20the%20first%2011%20bits%20are%20used%20(the%2010%20frac%20bits%20and%20the%20sign%20bit).%20%26nbsp%3BSo%20if%20I%20convert%20this%20to%20a%20real%20number%20(not%20something%20I%20would%20do%20in%20the%20processor%2C%20but%20just%20to%20see%20if%20I%20am%20understanding%20this%20correctly)%2C%20%26nbsp%3BI%20get%3CBR%20%2F%3E%3CBR%20%2F%3ES0.00000000000%200000%200011%20010x%20xxxx%3CBR%20%2F%3E%3CBR%20%2F%3Ethis%20gives%202%5E-17%2B%202%5E-18%20%2B%202%5E-20%20%3D%200.00001239776611328125%3CBR%20%2F%3E%3CBR%20%2F%3Ethis%20is%20the%20extent%20of%20my%20understanding%2C%20and%20I%20wonder%20if%20someone%20could%20confirm%20I%20have%20done%20this%20correctly.%20%26nbsp%3BIn%20addition%2C%20as%20the%20algorithm%20in%20AN3785%20keeps%20everything%20in%20fixed%20point%2C%20I%20cannot%20see%20where%20lt1%20(a%2032-bit%20value)%20can%20be%20assigned%20C11%20and%20this%20be%20correctly%20justified.%20%26nbsp%3BWhen%20I%20assign%200x0340%20to%20the%20long%20I%20get%3CBR%20%2F%3E%3CBR%20%2F%3Elt1%20%26nbsp%3B%20%26nbsp%3B0x00000340%3CBR%20%2F%3E%3D%200000%200000%200000%200000%200000%200011%20010x%20xxxx%3CBR%20%2F%3E%3CBR%20%2F%3Eso%20you%20can%20see%20I%20am%20not%20correctly%20aligned%20as%20per%20the%20bit-width%20specifications.%20%26nbsp%3BThe%20following%20is%20the%20code%20snippet.%20%26nbsp%3BThe%20comments%20make%20no%20sense%20to%20me%2C%20so%20any%20clarification%20you%20could%20prrovide%20would%20be%20most%20helpful%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%2F%2F*******%20STEP%201%20c11x1%3D%20c11%20*%20Padc%3CBR%20%2F%3E%26nbsp%3Blt1%20%3D%20(S32)sic11%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F%2F%20s(16%2C27)%20%26nbsp%3B%20%26nbsp%3Bs(N%2CF%2Bzeropad)%20goes%20from%20s(11%2C10)%2B11ZeroPad%20%3D%20s(11%2C22)%20%3D%26gt%3B%20Left%20Justified%20%3D%20s(16%2C27)%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3CBR%20%2F%3E%3CBR%20%2F%3E-Bill%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214630%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214630%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20coded%20this%20in%20an%20old%20assembler%20for%20the%2068hc912b32%3C%2FP%3E%3CP%3ENote%20each%20coefficient%20is%20placed%20in%20a%2032%20bit%20variable.%3C%2FP%3E%3CP%3EI%20am%20sure%20there%20is%20room%20for%20optimizations.%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22%3A%20%3B%20color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E.include%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%232a00ff%3B%20font-size%3A%2010pt%3B%22%3E%22globals.s%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%232a00ff%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22%3A%20%3B%20color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E.include%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%232a00ff%3B%20font-size%3A%2010pt%3B%22%3E%22hc12.s%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%232a00ff%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ec12x2%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ea1%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ea1x1%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ey1%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ea2x2%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3EPComp32%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%204%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ebaro_fltr%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20.blkb%203%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3B***************************************************************************************************************%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20Initialize%20and%20read%20coefficients%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230b00000000%2Csp0br%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20set%20spi%20to%204%20MHz%20clock%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Eibaro%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20bclr%20portb%2C%230b10000000%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20Set%20CS%20low%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%23%2488%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20a0%20msb%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Eldaa%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20a0%20msb%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%23%248A%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20a0%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Emovb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Ebrclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Eldab%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20a0%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20std%20BaroCoa0%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20save%20baro%20coefficient%20a0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20movb%20%23%248C%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20b1%20MSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Eldaa%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20b1%20MSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Emovb%20%23%248e%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20b1%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Eldab%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20b1%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20std%20BaroCob1%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20save%20baro%20coeffiecient%20b1%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20movb%20%23%2490%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20b2%20msb%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldaa%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20b2%20msb%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%23%2492%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20b2%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldab%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20b2%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20std%20BaroCob2%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20save%20baro%20Coefficient%20b2%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%23%2494%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20c12%20MSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3Eldaa%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20c12%20MSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%23%2496%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20read%20c12%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldab%20sp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20get%20c12%20LSB%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20movb%20%230%2Csp0dr%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20extra%20clearing%20byte%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20brclr%20sp0sr%2C%23SPIF%2C.%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20wait%20for%20spi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20bset%20portb%2C%230b10000000%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20Set%20CS%20hi%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20std%20BaroCoc12%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20save%20baro%20coeffiecient%20c12%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3Erts%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3ECompBaro%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20emuls%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3Bresult%20in%20Y%3AD%20needs%20shift%2011%20bits%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3Bor%20divide%20by%202%5E11%20which%20is%202048.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldx%20%232048%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20****%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22%3A%20%3B%20color%3A%20%237f9fbf%3B%20font-size%3A%2010pt%3B%22%3ETODO%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20or%20could%20do%203%20shifts%20then%20load%20from%20mid%20byte%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20to%20acomplishs%20the%20other%208%20bits.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20sty%20c12x2%2B2%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20only%20save%20as%2016%20bit%20****%20%3B%2F%20*%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20adca%20a1%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3Bpreserve%20sign%20bit%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldd%20a1%2B2%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3Bget%20lower%2016%20bits%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ror%20PComp32%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3BShift%201%20bit%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22%3A%20%3B%20color%3A%20%237f9fbf%3B%20font-size%3A%2010pt%3B%22%3Etodo%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20check%20this%20for%20best%20resolution%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldd%20PComp32%2B1%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20Get%20mid%20bytes%20effectly%20shifts%208%20bit%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20ldx%20%2316394%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%201023...%20times%2016%20for%20binary%20fraction%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3Buse%20IRR%20filter%20with%20an%20index%20of%2015%20to%20smooth%20out%20noise%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20subd%20AmbBaro%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20subtract%20last%20filtered%20Baro%20value%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20psha%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20save%20sign%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20addd%20baro_fltr%2B1%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20add%20accumulator%20lsword%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20std%20baro_fltr%2B1%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20update%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20pulb%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20msbyte%20difference%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20tfr%20b%2Cd%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20extend%20sign%20to%20acca%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20adca%20baro_fltr%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20add%20with%20carry%20to%20msbyte%20accumulator%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20staa%20baro_fltr%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20update%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20ldd%20baro_fltr%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20IIR%20filtered%20result%20in%20msword%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20pshd%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20to%20temp%20on%20stack%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20ldab%20baro_fltr%2B2%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20lsbyte%20filter%20for%20left%20shift%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20ldaa%20%2315%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20filter%20control%2C%200%20%3D%20min%20fltr%2C%2015%3D%20max%20fltr%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20flip%20bits%20for%20decrement%3F%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20eora%20%23%24F%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20***%20could%20use%20Higer%20if%20this%20is%20not%20enough%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20less%20filtering%20%3D%26gt%3B%20more%20shifts%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ebfc1%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20beq%20bfc2%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20begin%20shift%20loop%20for%20less%20filtering%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20lslb%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20left%20shift%20lsbyte%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20rol%201%2Cs%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20shift%20into%20filtered%20pressure%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20rol%20%2Cs%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20msbyte%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20deca%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20dec%20shift%20count%20by%20subtracting%20bit%204%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20bra%20bfc1%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20repeat%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3Ebfc2%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%26nbsp%3B%20puld%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3B%20retrieve%20result%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%22%3E%20std%20AmbBaro%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3BResults%20in%20kPa%3D%20mBar*10%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3EJack%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20Tomas%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20get%20it%20now.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EDave%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214628%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Re%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214628%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Dave%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20have%20just%20explained%20it%20in%20your%20SR%201-1348149811.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EFirst%2C%20you%20need%20to%20take%20into%20consideration%20that%20the%20last%20two%20bits%20of%20the%20c12_LSB%20are%20zero%20as%20shown%20on%20page%205%20of%20the%20data%20sheet%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ec12%20MSB%20byte%20%3D%20c12%5B13%3A6%5D%20%3D%20%5Bb13%20%2C%20b12%20%2C%20b11%20%2C%20b10%20%2C%20b9%20%2C%20b8%20%2C%20b7%20%2C%20b6%5D%3C%2FP%3E%3CP%3Ec12%20LSB%20byte%20%3D%20c12%5B5%3A0%5D%20%26amp%3B%20%E2%80%9C00%E2%80%9D%20%3D%20%5Bb5%20%2C%20b4%20%2C%20b3%20%2C%20b2%20%2C%20b1%20%2C%20b0%20%2C%200%20%2C%200%5D%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThen%20the%20c12%20coefficient%20is%20formatted%20as%20follows%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ec12%20%3D%20b13%200%20.%20000%20000%20000%20b12%20b11%20b10%20b9%20b8%20b7%20b6%20b5%20b4%20b3%20b2%20b1%20b0%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%2C%20each%20fractional%20bit%20has%20the%20value%20of%201%20%2F%202%3CSPAN%20lang%3D%22CS%22%3E%5E(9%2B13)%20and%20the%2016-bit%20c12%20value%20needs%20to%20be%20first%20right%20shifted%20by%202%20(or%20divided%20by%204)%20to%20obtain%2013%20fractional%20bits.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3EConsidering%20our%20example%2C%20the%2016-bit%20c12%20%3D%200x33C8.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3EThen%20c12%20%26gt%3B%26gt%3B%202%20%3D%200x33C8%20%26gt%3B%26gt%3B%202%20%3D%200xCF2%20%3D%203314%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3Eand%20c12%20coefficient%20%3D%203314%20%2F%202%5E22%20%3D%200.00079%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3EI%20hope%20it%20helps.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20lang%3D%22CS%22%3ETomas%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214627%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214627%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOh%2C%20sorry.%26nbsp%3B%20I%20see%20that%20the%202%20LSBs%20are%20zeros.%26nbsp%3B%20I%20still%20don't%20see%20how%20you%20get%200.000790%20though.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214626%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214626%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGee%2C%20I%20know%20this%20thread%20is%20years%20old.%26nbsp%3B%20But%20I%20am%20dense.%26nbsp%3B%20Bill's%20original%20post%20was%20about%20c12%20where%20he%20said%20the%20data%20sheet%20shows%2011%20pad%20zeros.%26nbsp%3B%20My%20data%20sheet%20says%209%20pad%20zeros.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAnd%20I'm%20lost%20in%20that%20data%20sheet%20where%20the%20value%20of%20c12%20is%200x33C8.%26nbsp%3B%20I%20don't%20see%20how%20you%20get%20from%20that%20to%20the%20value%200.000790.%26nbsp%3B%20If%20you%20pad%20F12%20-%20F0%20with%209%20zeros%2C%20you%20get%200000000001001....%26nbsp%3B%20That%20would%20mean%20the%20the%20first%201%20bit%20would%20be%202%5E%5E-10%2C%20or%200.0009xxx%2C%20which%20is%20already%20greater%20than%200.000790.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESorry%2C%20I%20don't%20get%20it.%26nbsp%3B%20Anybody%20have%20some%20thoughts%20for%20me%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214625%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214625%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDo%20I%20convert%20the%20coefficient%20of%20c12%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMSB%20c12%20%3D%2000110000%20%26nbsp%3B%3C%2FP%3E%3CP%3ELSB%20c12%20%3D%20101011xx%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECoef%20c12%20%3DS0%2C%20000000000%2000%20110000101011xx%20%3D%202%5E-10%20%2B%202%5E-11%20%2B%202%5E-16%20%2B%202%5E-18%20%2B%202%5E-20%20%2B%202%5E-21%20%3D%200%2C001485%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIs%20that%20right%3F%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3EHi%20Mommmo%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EDid%20you%20solve%20your%20problem%3F%2C%20As%20they%20give%20me%20similar%20results.%3C%2FP%3E%3CP%3ENegative%20pressure%20and%20a%20value%20of%20PADC%20%3D%20990%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eregards%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214623%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214623%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPeter%2C%20please%20could%20you%20explane%20how%20you%20have%20calculated%20C12.%20The%20AN3785%20says%20dec%20pt%20zero%20pad%3D9.%20So%209%20%220%22%20after%20%22.%22%20%26nbsp%3BIf%20I%20do%20so%20I%20can't%20get%20an%20acceptable%20result.%20Even%20all%20other%20values%20are%20almost%20the%20same%20as%20yours.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThank%20you!%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMichael%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214622%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214622%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENew%20to%20the%20game%3B%20however%20willing%20to%20learn.%20Thank%20you%20for%20your%20coding%20example.%20Do%20you%20have%20raw%20data%20and%20result%20so%20I%20can%20determine%20if%20I%20have%20converted%20to%20VB%20correctly%3F%20Thanks.%3C%2FP%3E%3CP%3EI%20used%3A%3C%2FP%3E%3CP%3EPadc%26nbsp%3B64%20C0%26nbsp%3B%3C%2FP%3E%3CP%3ETadc%26nbsp%3B75%2080%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA0%26nbsp%3B-%203D%209B%26nbsp%3B%3C%2FP%3E%3CP%3EB1%20-%20B9%204A%26nbsp%3B%3C%2FP%3E%3CP%3EB2%20-%26nbsp%3BC7%2046%26nbsp%3B%3C%2FP%3E%3CP%3EC12%20-%26nbsp%3B32%20BC%26nbsp%3B%3C%2FP%3E%3CP%3EC11%26nbsp%3B%20-%2002%2020%26nbsp%3B%3C%2FP%3E%3CP%3EC22%20-%26nbsp%3BFD%2060%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3Bmy%20result%20was%20%26nbsp%3B105.13476438%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214621%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214621%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20trying%20ot%20interface%20to%20this%20device%20and%20I'm%20havin%20some%20issues.%20The%20coefficients%20%26nbsp%3Band%20readings%20I%20get%20from%20the%20device%20are%20as%20follows%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ea0%3A3b99%20b1%3Affffb8b9%20b2%3Affffc24d%20c12%3A3274%20c11%3A0%20c22%3A0%20Padc%3A157%20Tadc%3A1f5%3C%2FP%3E%3CP%3EPadc%3A343%20Tadc%3A501%3C%2FP%3E%3CP%3Etemperature%3A%2026.536017%20C%3C%2FP%3E%3CP%3Epressure%3A%2051.450000%20kPa%3C%2FP%3E%3CP%3ECompensated%20Pressure%3A%2091.935486%20kPA%20%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EUsing%20the%20coefficient%20to%20floating%20point%20functino%20earlier%20in%20the%20forum%20I%20get%20these%20values%3A%3C%2FP%3E%3CP%3Ea0_d%3A1906.250000%3C%2FP%3E%3CP%3Eb1_d%3A-2.056824%3C%2FP%3E%3CP%3Eb2_d%3A-0.240997%3C%2FP%3E%3CP%3Ec12_d%3A0.000192%3C%2FP%3E%3CP%3Ec11_d%3A0.000000%3C%2FP%3E%3CP%3Ec22_d%3A0.000000%26nbsp%3B%3C%2FP%3E%3CP%3EPressure_d%3A%26nbsp%3B120.723752%20kPa%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20take%20those%20double%20values%20and%20calculate%20it%20using%20the%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPcomp%20%3D%20a0_D%20%2B%20(b1_D%20%2B%20c11_D*Padc%20%2B%20c12_D*Tadc)*Padc%20%2B%20(b2_D%20%2B%20c22_D*Tadc)*Tadc%3C%2FP%3E%3CP%3EThen%20using%20the%20(65.0%2F1023.0*Pcomp%20%2B%2050%2C%20I%20get%20Pressure_d.%20Was%20there%20something%20special%20I%20needed%20to%20do%20because%20neither%20of%20thsese%20match%20the%20101%20kPa%20I%20was%20expecintg%20and%20what's%20even%20more%20confusing%20is%20that%20these%20numbers%20are%20different.%20The%20first%20compensated%20pressure%20value%20was%20calculate%20according%20the%20application%20note%20sheet.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214620%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214620%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOk%2C%20finally%20i%20found%20the%20problem.%20The%20problem%20is%20in%20data%20type%20int.%20I%20meant%20that%20it%20has%2016%20bits%20(as%20in%20gcc%2C%20borland%20c%2C%20...)%20but%20in%20fact%20it%20has%2032.%20And%20therefore%20the%20negative%20numbers%20aren't%20negative...%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20solution%20is%20to%20change%20all%20int%20to%20short%20(at%20least%20in%20CW%206.3).%26nbsp%3B%3CIMG%20alt%3D%22%3Asmileysad%3A%22%20class%3D%22emoticon%20emoticon-smileysad%22%20id%3D%22smileysad%22%20src%3D%22http%3A%2F%2Ffreescale.i.lithium.com%2Fi%2Fsmilies%2F16x16_smiley-sad.gif%22%20title%3D%22Smiley%20Sad%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214619%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214619%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ehas%20anyone%20solved%20this%20math%20mystery%3F%20I%20can%20finaly%20read%20the%20data%20from%20the%20sensor%2C%20but%20i%20can't%20pass%20thru%20the%20math%20described%20in%20the%20app.%20note%20on%20pages%2017-18.%20As%20siPcomp%20i%20get%20about%205726%2C%20which%20is%20significantly%20more%20than%201023...%3C%2FP%3E%3CP%3EThe%20coefs%20are%20fine%20(proccessed%20to%20float%20just%20for%20info%3A%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EA0%20Result%20%3D%202101%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EB1%20Result%20%3D%20-2.4163818359375%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EB2%20Result%20%3D%20-1.2173461914062%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EC12%20Result%20%3D%200.00083708763122559%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EC11%20Result%20%3D%200%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3EC22%20Result%20%3D%200%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20code%20is%20exactly%20copy-pasted%20from%20the%20app.%20note%2C%20but%20the%20result%20is%20completly%20insane...%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EHas%20anyone%20a%20working%20code%20snippet%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMy%20data%20are%20here%20(pressure%2C%20temperature%2C%20coeffs)%3A%20%26nbsp%3B%3CSPAN%20style%3D%22font-family%3A%20monospace%3B%20font-size%3A%208.33333px%3B%20white-space%3A%20pre-wrap%3B%22%3E5B%2040%2081%2080%2041%20A8%20B2%20AD%20B2%2017%2036%20DC%2000%2000%2000%2000%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EMy%20code%20is%20here%3A%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CPRE%3E%3CSTRONG%3Eunsigned%20char%20mpl115a_raw_data%5B16%5D%3Bunsigned%20int%20mpl115a_p%3Bunsigned%20int%20mpl115a_t%3Bsigned%20int%20mpl115a_a0%3Bsigned%20int%20mpl115a_b1%3Bsigned%20int%20mpl115a_b2%3Bsigned%20int%20mpl115a_c12%3Bsigned%20int%20mpl115a_c11%3Bsigned%20int%20mpl115a_c22%3B%3C%2FSTRONG%3E%2F%2F%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%2F%2F%20MPL115A%20Placing%20Coefficients%20into%2016%20bit%20variables%2F%2F%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CSTRONG%3Evoid%20mpl115a_raw_dissection(void)%7B%20mpl115a_p%20%3D%20(unsigned%20int)mpl115a_raw_data%5B0%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_p%20%2B%3D%20(unsigned%20int)mpl115a_raw_data%5B1%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_t%20%3D%20(unsigned%20int)mpl115a_raw_data%5B2%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_t%20%2B%3D%20(unsigned%20int)mpl115a_raw_data%5B3%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_a0%20%3D%20(signed%20int)mpl115a_raw_data%5B4%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_a0%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B5%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_b1%20%3D%20(signed%20int)mpl115a_raw_data%5B6%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_b1%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B7%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_b2%20%3D%20(signed%20int)mpl115a_raw_data%5B8%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_b2%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B9%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_c12%20%3D%20(signed%20int)mpl115a_raw_data%5B10%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_c12%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B11%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_c11%20%3D%20(signed%20int)mpl115a_raw_data%5B12%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_c11%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B13%5D%20%26amp%3B%200x00FF%3B%20%20mpl115a_c22%20%3D%20(signed%20int)mpl115a_raw_data%5B14%5D%20%26lt%3B%26lt%3B8%3B%20mpl115a_c22%20%2B%3D%20(signed%20int)mpl115a_raw_data%5B15%5D%20%26amp%3B%200x00FF%3B%7D%3C%2FSTRONG%3E%2F%2F%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%2F%2FCoefficient%209%20equation%20compensation%2F%2F%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CSTRONG%3Eunsigned%20long%20mpl115a_compensated_pressure(void)%7B%3C%2FSTRONG%3E%20%2F%2FVariable%20used%20to%20do%20large%20calculation%20as%203%20temp%20variables%20in%20the%20process%20below%20%3CSTRONG%3Esigned%20long%20lt1%2C%20lt2%2C%20lt3%2C%20si_c11x1%2C%20si_a11%2C%20si_c12x2%2C%20si_a1%2C%20si_c22x2%2C%20si_a2%2C%20si_a1x1%2C%20si_y1%2C%20si_a2x2%3B%3B%3C%2FSTRONG%3E%20%20%2F%2FVariables%20used%20for%20Pressure%20and%20Temperature%20Raw.%20%3CSTRONG%3Eunsigned%20int%20uiPadc%2C%20uiTadc%3B%20%20signed%20int%20siPcomp%3B%20unsigned%20long%20decPcomp%3B%20%20%20uiPadc%20%3D%20mpl115a_p%20%26gt%3B%26gt%3B%206%3B%20uiTadc%20%3D%20mpl115a_t%20%26gt%3B%26gt%3B%206%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%201%20c11x1%3D%20c11%20*%20Padc%20%3CSTRONG%3Elt1%20%3D%20(signed%20long)%20mpl115a_c11%3B%20lt2%20%3D%20(signed%20long)%20uiPadc%3B%20lt3%20%3D%20lt1%20*%20lt2%3B%20si_c11x1%20%3D%20(signed%20long)%20lt3%3B%3C%2FSTRONG%3E%20%20%2F%2F*******%20STEP%202%20a11%3D%20b1%20%2B%20c11x1%20%3CSTRONG%3Elt1%20%3D%20((signed%20long)%20mpl115a_b1)%20%26lt%3B%26lt%3B%2014%3B%20lt2%20%3D%20(signed%20long)%20si_c11x1%3B%20lt3%20%3D%20lt1%20%2B%20lt2%3B%20si_a11%20%3D%20(signed%20long)%20(lt3%20%26gt%3B%26gt%3B%2014)%3B%3C%2FSTRONG%3E%20%20%20%2F%2F*******%20STEP%203%20c12x2%3D%20c12%20*%20Tadc%20%3CSTRONG%3Elt1%20%3D%20(signed%20long)%20mpl115a_c12%3B%20lt2%20%3D%20(signed%20long)%20uiTadc%3B%20lt3%20%3D%20lt1%20*%20lt2%3B%20si_c12x2%20%3D%20(signed%20long)%20lt3%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%204%20a1%3D%20a11%20%2B%20c12x2%20%3CSTRONG%3Elt1%20%3D%20((signed%20long)%20si_a11)%20%26lt%3B%26lt%3B%2011%3B%20lt2%20%3D%20(signed%20long)%20si_c12x2%3B%20lt3%20%3D%20lt1%20%2B%20lt2%3B%20si_a1%20%3D(signed%20long)%20(lt3%20%26gt%3B%26gt%3B%2011)%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%205%20c22x2%3D%20c22%20*%20Tadc%20%3CSTRONG%3Elt1%20%3D%20(signed%20long)%20mpl115a_c22%3B%20lt2%20%3D%20(signed%20long)%20uiTadc%3B%20lt3%20%3D%20lt1%20*%20lt2%3B%20si_c22x2%20%3D%20(signed%20long)%20lt3%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%206%20a2%3D%20b2%20%2B%20c22x2%20%3CSTRONG%3Elt1%20%3D%20((signed%20long)%20mpl115a_b2)%20%26lt%3B%26lt%3B%2015%3B%20lt2%20%3D%20((signed%20long)%20si_c22x2)%20%26gt%3B%26gt%3B%201%3B%20lt3%20%3D%20lt1%20%2B%20lt2%3B%20si_a2%20%3D%20((signed%20long)lt3)%20%26gt%3B%26gt%3B%2016%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%207%20a1x1%3D%20a1%20*%20Padc%20%3CSTRONG%3Elt1%20%3D%20(signed%20long)%20si_a1%3B%20lt2%20%3D%20(signed%20long)%20uiPadc%3B%20lt3%20%3D%20lt1%20*%20lt2%3B%20si_a1x1%20%3D%20(signed%20long)%20lt3%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%208%20y1%3D%20a0%20%2B%20a1x1%20%3CSTRONG%3Elt1%20%3D%20((signed%20long)%20mpl115a_a0)%20%26lt%3B%26lt%3B%2010%3B%20lt2%20%3D%20(signed%20long)%20si_a1x1%3B%20lt3%20%3D%20lt1%20%2B%20lt2%3B%20si_y1%20%3D%20((signed%20long)lt3)%20%26gt%3B%26gt%3B%2010%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%209%20a2x2%3D%20a2%20*Tadc%20%3CSTRONG%3Elt1%20%3D%20(signed%20long)%20si_a2%3B%20lt2%20%3D%20(signed%20long)%20uiTadc%3B%20lt3%20%3D%20lt1%20*%20lt2%3B%20si_a2x2%20%3D%20(signed%20long)%20lt3%3B%3C%2FSTRONG%3E%20%2F%2F*******%20STEP%2010%20pComp%20%3D%20y1%20%2Ba2x2%20%3CSTRONG%3Elt1%20%3D%20((signed%20long)%20si_y1)%20%26lt%3B%26lt%3B%2010%3B%20lt2%20%3D%20(signed%20long)%20si_a2x2%3B%20lt3%20%3D%20lt1%20%2B%20lt2%3B%3C%2FSTRONG%3E%20%2F%2F%20FIXED%20POINT%20RESULT%20WITH%20ROUNDING%3A%20%3CSTRONG%3EsiPcomp%20%3D%20(signed%20int)(lt3%20%26gt%3B%26gt%3B%2013)%3B%3C%2FSTRONG%3E%20%2F%2F%20goes%20to%20no%20fractional%20parts%20since%20this%20is%20an%20ADC%20count.%20%20%2F%2FdecPcomp%20is%20defined%20as%20a%20floating%20point%20number.%20%2F%2FConversion%20to%20Decimal%20value%20from%201023%20ADC%20count%20value.%20ADC%20counts%20are%200%20to%201023.%20Pressure%20is%2050%20to%20115kPa%20correspondingly.%20%2F%2FdecPcomp%20%3D%20(((unsigned%20long)siPcomp)%20*%2065000%20%2B%2051150000)%20%2F%201023%3B%20%2F%2F%20result%20in%20Pa%2C%20not%20kPa%20%20%3CSTRONG%3EdecPcomp%20%3D%20(unsigned%20long)siPcomp%3B%3C%2FSTRONG%3E%20%2F%2F%20temporary%20%3CSTRONG%3Ereturn%20decPcomp%3B%7D%3C%2FSTRONG%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3Elrf%20wrote%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20size%3D%222%22%3EThe%20manual%20says%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Arial%22%3E%3CFONT%20face%3D%22Arial%22%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3EsiPcomp%20%3D%20((S16)lt3%26gt%3B%26gt%3B13)%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3EChange%20this%20to%20this%3A%3C%2FFONT%3E%3C%2FP%3E%3CDIV%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EsiPcomp%20%3D%20((S16)(lt3%26gt%3B%26gt%3B13))%3B%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%3CP%3EThat%20was%20a%20HUGE%20help%20to%20me.%20%26nbsp%3BThank%20you%20very%20much!%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E(This%2C%20plus%20the%20undocumented%20ox01%20I2C%20%26nbsp%3B%20write%20that%20is%20necessary%20to%20initiate%20the%20pressure%2FTemp%20conversion)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214617%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214617%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20totally%20agreed%20your%20points%2C%20its%20cheaper%20to%20have%20the%20cal'%20externally%20and%20thats%20more%20open%20to%20the%20users%20-%20once%20you%20understand%20the%20way%20to%20convert%20the%20coefficient%20values.%3C%2FP%3E%3CP%3Eok%2C%20I%20saw%20the%20programs%20from%20you%20and%20others%20as%20well%2C%20however%2C%20not%20everyone%20use%20C%2C%20and%20of%20cause%20not%20every%20one%20use%20large%20memory%20cpu%2Fmcu%20as%20well%2C%20just%20think%20about%20if%20you%20have%20a%20128bytes%20memory%2C%20(ram)%20and%20less%20than%202K%20code%20memory%20(flash%20or%20rom)%3C%2FP%3E%3CP%3Ethen%20your%20desgin%20may%20not%20be%20the%20same.%20Anyway%2C%20according%20to%20your%20experience%2C%20every%20problem%20solved%20after%20few%20days%20and%20the%20Freescale's%20support%20person%2Fengineers%20are%20quite%20helpful%2C%20well%2C%20thats%20my%20third%20days%2C%20and%20holpfully%20problem%20can%20solved%20today%2C%20and%20wishing%20some%20one%20from%20Freescale%20can%20give%20me%20some%20helpfull%20hints.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EWish%20me%20luck.%3C%2FP%3E%3CP%3Ecw.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214616%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214616%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECW%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EWhy%20do%20you%20need%20to%20understand%20the%20math%3F%20If%20you%20are%20trying%20to%20get%20the%20chip%20to%20do%20something%20then%20just%20use%20the%20programming%20that%20Freescale%20provided%20in%20AN3785%2C%20with%20the%20small%20mod%20I%20stated%20above.%20To%20understand%20the%20math%20simply%20reverse%20engineer%20the%20equations.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20chip%20is%20what%20it%20is%20and%20the%20way%20they%20chose%20to%20do%20the%20calculations%20is%20what%20they%20chose.%20Doing%20the%20equations%20at%20the%20MC%20is%20much%20faster%26nbsp%3Band%20open%20to%20user%20tweaking%20better%20then%20having%20the%20chip%20do%20the%20math%20and%20you%20are%20stuck%20with%20the%20results.%20%26nbsp%3BEither%20use%20it%20or%20find%20another.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMy%20weather%20station%20has%20been%20running%20for%20about%20a%20year%20and%20without%20any%20issues.%20Its%20readings%20track%20with%20the%20national%20weather%20service%20spot%20on%20for%20barometric%20pressure%2C%20given%20a%20correction%20for%20altitutde%20(NWS%20values%20are%20at%20sea%20level).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214615%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214615%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt's%20much%20cheaper%20and%20easier%20to%20do%20the%20math%20in%20another%20processor%2C%20rather%20than%20have%20the%20processing%20be%20built%20into%20the%20sensor.%26nbsp%3B%26nbsp%3B%20I%20have%20to%20agree%20that%20it%20is%20awkward%20to%20figure%20out%2C%20but%20once%20done%20it%20is%20works%20well.%26nbsp%3B%20The%20original%20app%20note%20did%20have%20some%20errors%20in%20the%20description%20of%20the%20storage%20of%20the%20coefficients%20and%20the%20sample%20code%20is%20dependent%20on%20certain%20byte%20ordering%20of%20your%20processors.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20apps%20person%20was%20very%20helpful%20and%20I%20was%20able%20to%20get%20up%20and%20running%20within%20a%20day%20or%20so%20of%20getting%20the%20sample%20part.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20posted%20pretty%20much%20all%20the%20code%20I%20used%20to%20get%20this%20working%20in%20this%20forum%2C%20in%20the%20hope%20that%20others%20can%20benefit%20from%20the%20work%20I%20had%20to%20do.%26nbsp%3B%20Please%20look%20back%20at%20the%20other%20messages%20in%20this%20thread%20to%20see%20these%20examples.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eif%20I%20had%20one%20suggestion%20for%20improvement%2C%20it%20would%20be%20to%20improve%20the%20noise%20on%20the%20device.%20The%20readings%20do%20bounce%20around%20quite%20a%20lot%2C%20but%20again%20a%20higher%20level%20processor%20with%20memory%20is%20easily%20able%20to%20implement%20a%20smoothing%20algorithm.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EGood%20luck%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214614%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214614%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20just%20don't%20know%20why%20the%20hell%20'Freescale'%20made%20this%20device%20so%20confused%20with%20all%20the%20coeficients%20compensation%20calculation%20and%20not%20do%20it%20internally!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214613%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214613%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eirf%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E'It%20has%20been%20a%20long%20time%20since%20I%20worked%20with%20this%20component%20but%20I%20can%20tell%20you%20it%20works%20fine%20once%20you%20get%20the%20math%20correct...'%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20problem%20is%20I%20can't%20get%20the%20math%20correct%2C%20I%20need%20your%20help%2C%20would%20you%20please%20explain%20how%20to%20convert%20the%20coef'%20value%20into%20floating%20point%20number%20in%20plain%20english%2C%20not%20c%20programming%20notation.%3C%2FP%3E%3CP%3Eeg%2C%20the%20numbers%20I%20read%20from%20the%20registers%20of%20%2400%20-%20%240f%20are%3A%3C%2FP%3E%3CP%3E5a%20c0%2075%20c0%2039%20e3%20b9%207a%20ca%207b%2032%20cc%2000%2000%2000%2000%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%20your%20help.%3C%2FP%3E%3CP%3Ecw.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20has%20been%20a%20long%20time%20since%20I%20worked%20with%20this%20component%20but%20I%20can%20tell%20you%20it%20works%20fine%20once%20you%20get%20the%20math%20correct.%20I%20found%20that%20the%20equations%20given%20in%20the%20manual%20are%20in%20correct.%20Unfortunately%20I%20don't%20remember%20exactly%20what%20the%20issue%20was%20so%20I%20went%20back%20thru%20my%20code%20looking%20for%20differences.%20The%20following%20is%20the%20only%20difference%20I%20can%20find%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20size%3D%222%22%3EThe%20manual%20says%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Arial%22%3E%3CFONT%20face%3D%22Arial%22%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3EsiPcomp%20%3D%20((S16)lt3%26gt%3B%26gt%3B13)%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%20align%3D%22left%22%3E%3CFONT%20size%3D%222%22%3EChange%20this%20to%20this%3A%3C%2FFONT%3E%3C%2FP%3E%3CDIV%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EsiPcomp%20%3D%20((S16)(lt3%26gt%3B%26gt%3B13))%3B%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20size%3D%222%22%3EHope%20this%20helps%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI've%20the%20same%20problem%20as%20other%20users%20of%20the%20MPL115A2%20programming...%3C%2FP%3E%3CP%3EI%20can%20read%20the%20data%20from%20the%20registers%2C%20however%2C%20to%20get%20the%20real%20pressure%20and%20temperature%20is%20a%20long%20way%20to%20go%20from%20there%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eok%2C%20here's%20my%20problems%20and%20wishing%20someone%20can%20help%20me%2C%20the%20following%20are%20the%20data%20I%20read%20from%20the%20registers%20%2400%20to%20%240f%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E5a%20c0%2075%20c0%2039%20e3%20b9%207a%20ca%207b%2032%20cc%2000%2000%2000%2000%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPlease%2C%20anyone%20can%20help%20me%20to%20decipher%20the%20mystery%20of%20the%20above%20data%20-%20I%20know%20the%20first%20four%20bytes%20are%20the%20Padc%20and%20Tadc%20value%2C%20then%20the%20a0-msb%2C%20a0-lsb%2C%20b1.....c22%20etc%2C%20however%2C%20I%20don't%20know%20how%20to%20convert%20these%20No.%20into%20floating%20point%20notation%20-%20actually%20I%20can't%20find%20any%20'Freescale'%20document%20mention%20about%20it.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMany%20thanks%20for%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214610%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214610%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20have%20a%20problem%20with%20the%20MPL115A2.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20coef%20data%20are%3A%3C%2FP%3E%3CP%3E3a%204d%20ba%20cc%20bf%20a6%2031%2078%2000%2000%2000%2000%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPadc%20%3D%20990%3C%2FP%3E%3CP%3ETadc%20%3D%20523%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20calculate%3A%3C%2FP%3E%3CP%3Ea0%20%3D%201865.63%3C%2FP%3E%3CP%3Eb1%20%3D%20-2.16%3C%2FP%3E%3CP%3Eb2%20%3D%20-1.01%3C%2FP%3E%3CP%3Ec12%20%3D%200.00075%3C%2FP%3E%3CP%3Ec11%20%3D%200%3C%2FP%3E%3CP%3Ec22%20%3D%200%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPcomp%20%3D%20-411%20(negative!!!)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAny%20idea%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMany%20thank%20!%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENicola%20(Italy)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214609%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214609%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ERingo%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Here%20are%20answers%20to%20your%202%20questions.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E1.%20The%20temperature%20ADC%20does%20not%20have%20a%20direct%20conversion%20to%20an%20actual%20temperature.%20You%20could%20always%20try%20and%20vary%20the%20ambient%20temperature%20of%20the%20sensor%20and%20see%20what%20the%20ADC%20value%20is%20over%20a%20range%20of%20temperatures.%20Then%20you%20might%20be%20able%20to%20figure%20out%20a%20conversion%20factor.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E2.%20The%20final%20pressure%20reading%20is%20noisy%20and%20thus%20any%20conversion%20of%20that%20value%20to%20an%20altitude%20will%20also%20be%20noisy.%26nbsp%3B%20Typically%20the%20pressure%20varies%20quite%20slowly%20so%20the%20best%20approach%20is%20to%20take%20multiple%20readings%20and%20have%20a%20running%20average%20of%20the%20last%20measurements%20so%20that%20noise%20is%20averaged%20out.%26nbsp%3B%20For%20our%20application%20we%20take%20measurements%20every%20second%20and%20average%20over%20the%20last%20100%20seconds.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPeter%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhat%20kind%20of%20accuracy%2Frepeatability%20is%20anyone%20getting%3F%20Mine%20is%20bouncing%20all%20over%20the%20place.%3C%2FP%3E%3CP%3EAlt%20feet%3A%20149%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2045%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2045%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2045%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3EAlt%20feet%3A%20109%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2097%3CBR%20%2F%3EAlt%20feet%3A%26nbsp%3B%2057%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214607%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214607%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20anyone%20tell%20me%20how%20to%20convert%20the%20uiTADC%20number%20to%20c%20or%20F%3F%20I'm%20getting%20around%20a%20523.%20What%20is%20the%20conversion%20factor%3F%3C%2FP%3E%3CP%3EThansk%3C%2FP%3E%3CP%3ERingo%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214606%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214606%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%20I%20meant%20C22.%20I%20calculated%20the%20pressure%20using%20your%20values%20and%20got%20the%20same%20result%20as%20you.%20And%20I%20think%20I%20finally%20realized%20what%20I%20did%20wrong.%20I%20looked%20at%20the%20first%20post%20of%20this%20thread%20and%20converted%20the%20coeffs%20following%20that%20as%20an%20example.%20So%20C12%20is%20S0.0000000001110001110000%20-%26gt%3B%202%5E-10%20%2B%202%5E-11%20%2B%202%5E-12%20%2B%202%5E-16%20%2B%202%5E-17%20%2B%202%5E-18%20%3D%200.0017281.%20But%20the%20sign%20bit%20is%201%20(0x38E0).%20Should%20I%20invert%20the%2013%20fractional%20bits%20and%20add%201%20to%20get%20the%20real%20result%3F%20And%20for%20the%20B2%20it's%20probably%20the%20same%20error.%20Thanks%20for%20your%20help%20PJH!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214605%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20assume%20you%20mean%20C22%20for%20your%20last%20coefficient.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOn%20one%20of%20my%20systems%20I%20got%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA0%3D2156.625000%3CBR%20%2F%3EB1%3D-2.528809%3CBR%20%2F%3EB2%3D-1.034241%3CBR%20%2F%3EC12%3D0.000876%3CBR%20%2F%3EC11%3D0.000000%3CBR%20%2F%3EC22%3D0.000000%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EpressureADC%20420%3CBR%20%2F%3EtempADC%20419%3CBR%20%2F%3E%3CBR%20%2F%3Eresult%20101.802%20kPa.%26nbsp%3B%20So%20that%20comes%20out%20at%201018.02%20mBar.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ELooking%20at%20the%26nbsp%3B%20values%20it%20seems%20that%20the%20one%20which%20is%20likely%20to%20be%20wrong%20is%20C12.%20Your%20number%20is%20much%20smaller%20than%20what%20I%20get.%26nbsp%3B%20If%20you%20put%20my%20numbers%20into%20your%20calculation%20function%20do%20you%20get%20the%20same%20result%20as%20I%20did%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAlso%20check%20the%20decimial%20point%20position%20in%20B2%20your%20number%20is%20a%20factor%20of%2010%20smaller%20than%20mine.%3C%2FP%3E%3CP%3EDon't%20forget%20too%20that%20you%20have%20to%20scale%20the%20pComp%20value.%26nbsp%3B%20The%20output%20is%200-1023%20which%20is%20for%20a%20scale%20of%2050kPa%20to%20115kPa.%20So%20range%20is%2065kPa%20in%201023%20steps.%20Final%20pressure%20%3D%20(65%2F1023*pComp)%2B50%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20PJH%20but%20I%20believe%20I%20have%20converted%20them%20correctly.%20Or%20have%20I%3F%20At%20the%20moment%20the%20result%20Pcomp%20is%201067%20which%20cannot%20be%20right%20since%20it%20should%20be%20in%20between%200%20and%201023.%20Converted%20coeffs%20are%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ea0%20%3D%202003%3C%2FP%3E%3CP%3Eb1%20%3D%20-2.3118%3C%2FP%3E%3CP%3Eb2%20%3D%20-0.15836%3C%2FP%3E%3CP%3Ec12%20%3D%201.456E-10%3C%2FP%3E%3CP%3Ec11%20%3D%200%3C%2FP%3E%3CP%3Ec12%20%3D%200%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPadc%20%3D%20370%3C%2FP%3E%3CP%3ETadc%20%3D%20509%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20coefficients%20are%20not%20all%20the%20same%20size%2Cbut%20are%20packed%20into%20a%2012%20bytes%20(96%20bits)%20in%20registers%20x04%20to%20x0F.%20The%20coeffs%20are%20really%20floating%20point%20numbers%20but%20the%20decimal%20point%20is%20in%20a%20different%20place%20in%20each%20number%20and%20some%20are%20negative%20etc.%26nbsp%3B%20So%20since%20I%20was%20unable%20to%20get%20the%20sample%20code%20to%20work%20due%20possibly%20to%20the%20byte%20endian%20nature%20of%20the%20data%20I%20wrote%20a%20function%20that%20can%20convert%20the%20bytes%20to%20the%20doubles.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFirst%20here%20is%20the%20code%20to%20download%20the%20coeffs.%26nbsp%3B%20Obviously%20the%20implementation%20of%20the%20I2C%20is%20left%20to%20the%20reader.%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Evoid%20CMPL115A%3A%3CIMG%20alt%3D%22%3Asmileyvery-happy%3A%22%20class%3D%22emoticon%20emoticon-smileyvery-happy%22%20id%3D%22smileyvery-happy%22%20src%3D%22http%3A%2F%2Ffreescale.i.lithium.com%2Fi%2Fsmilies%2F16x16_smiley-very-happy.gif%22%20title%3D%22Smiley%20Very%20Happy%22%20%2F%3EownloadCoeffs()%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bint%20err%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bint%20resultL%2CresultH%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BBYTE%20data%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiA0%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiB1%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiB2%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC11%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC12%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC22%3D0%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2F%20Get%20A0%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Berr%3Dm_I2C.ModuleReadByte(BAROMETER%2C0x05%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(err%3D%3DERROR_SUCCESS)%20%2F%2F%20Then%20we%20probably%20have%20a%20device%20connected.%20so%20assume%20rest%20of%20calls%20will%20succeed.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x04%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiA0%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdA0%3DConvertCoeffToDouble(iA0%2C16%2C12%2C3%2C0)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20Get%20B1%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x07%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x06%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiB1%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdB1%3DConvertCoeffToDouble(iB1%2C16%2C2%2C13%2C0)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20Get%20B2%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x09%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x08%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiB2%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdB2%3DConvertCoeffToDouble(iB2%2C16%2C1%2C14%2C0)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20Get%20C12%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0B%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0A%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC12%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdC12%3DConvertCoeffToDouble(iC12%2C14%2C0%2C13%2C9)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20Get%20C11%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0D%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0C%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC11%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdC11%3DConvertCoeffToDouble(iC11%2C11%2C0%2C10%2C11)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20Get%20C22%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0F%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultL%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_I2C.ModuleReadByte(BAROMETER%2C0x0E%2C%26amp%3Bdata)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BresultH%3DINT8(data)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiC22%3D(resultH%26lt%3B%26lt%3B8)%2B(resultL%26amp%3B0x00FF)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BdC22%3DConvertCoeffToDouble(iC22%2C11%2C0%2C10%2C15)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_InitSuccess%3Dtrue%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Belse%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bm_InitSuccess%3Dfalse%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%7D%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22arial%2Chelvetica%2Csans-serif%22%3Eand%20the%20here%20is%20the%20ConvertCoeffToDouble%20which%20takes%20the%202byte%20word%20and%20then%20parameters%20which%20describe%20the%20number%20of%20bits%2C%20integer%20bits%2C%20fractional%20bits%20and%20padbits.%20There%20may%20be%20more%20efficient%20ways%20to%20do%20this%2C%20but%20since%20it%20only%20has%20to%20be%20done%20once%20when%20the%20device%20is%20initialized%20it%20is%20not%20critical%20to%20optimize.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Edouble%20ConvertCoeffToDouble(INT16%20coeff%2Cshort%20bitCount%2Cshort%20iBits%2C%20short%20fracBits%2C%20short%20padBits)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F%2F%20Utility%20function%20to%20convert%20the%20coeff's%20into%20floating%20point%20parameters.%3CBR%20%2F%3E%2F%2F%20See%20Freescale%20App%20note%20AN3785%20for%20details%20of%20how%20the%20parameters%20are%20stored.%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bdouble%20result%3D0%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bbool%20s%3Dfalse%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bbool%20bit%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bint%20fb%3D0%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2F%20We%20start%20working%20our%20way%20through%20the%20bits%20from%20high%20to%20low.%3CBR%20%2F%3E%2F%2F%20The%20incoming%20data%20is%20a%2016bit%20integer%20which%20we%20have%20to%20shorten%20since%20the%20lower%20LSB's%20are%20empty%20if%20%26lt%3B16%20bits.%20(see%20pg%2015%20of%20AN3785).%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif%20(bitCount%26lt%3B16)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%2F%2F%20Make%20coeff%20the%20appropriate%20size%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcoeff%3Dcoeff%26gt%3B%26gt%3B(16-bitCount)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2F%20Sanity%20check%20that%20the%20parameters%20passed%20into%20the%20function%20make%20sense.%20We%20can't%20have%20more%20or%20less%20bits%20than%20the%20amount%20of%20data.%3CBR%20%2F%3E%2F%2F%20Add%201%20to%20account%20for%20sign%20bit.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif((iBits%2BfracBits%2B1)!%3DbitCount)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BTRACE(_T(%22Error%20in%20parameters!!%5Cn%22))%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breturn%200%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%2F%2FSanity%20check%20that%20if%20we%20are%20padding%20the%20decimal%20point%20that%20we%20can't%20also%20have%20integer%20bits.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif((padBits%26gt%3B0)%26amp%3B%26amp%3B(iBits%26gt%3B0))%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BTRACE(_T(%22Error%20in%20parameters.%20iBits%20and%20padBits%20not%20consistent!!%5Cn%22))%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breturn%200%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bfor(int%20b%3DbitCount%3Bb%26gt%3B0%3Bb--)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bbit%3Dbool((int(pow(2.0%2Cb-1))%26amp%3B%20coeff)%26gt%3B%26gt%3B(b-1))%3B%20%2F%2F%20Get%20each%20bit%20in%20turn%20as%20a%201%20or%20a%200.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif%20(b%3D%3DbitCount)%20%2F%2F%20if%20this%20is%20the%20first%20bit%20(sign%20bit%20check%20if%20it%20is%20set)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bs%3Dbit%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(s)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcoeff%3D~coeff%2B1%3B%20%2F%2FCalculate%202's%20complement%3B%20%2F%2F(See%20App%20note%20AN3785%20middle%20of%20Pg15%20for%20explanation.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Belse%20%2F%2F%20process%20the%20bits%20in%20turn.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(iBits%26gt%3B0)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%20%2F%2F%20we%20have%20an%20integer%20bit%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(bit)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bresult%2B%3Dpow(2.0%2CiBits-1)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BiBits--%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Belse%20%2F%2F%20we%20have%20a%20fractional%20bit%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bfb%2B%2B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(bit)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bresult%2B%3D%20(1%2Fpow(2.0%2Cfb%2BpadBits))%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BfracBits--%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif(s)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bresult*%3D-1%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3BTRACE(_T(%22Result%3D%25f%5Cn%22)%2Cresult)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breturn%20result%3B%3CBR%20%2F%3E%7D%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22arial%2Chelvetica%2Csans-serif%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CFONT%20face%3D%22arial%2Chelvetica%2Csans-serif%22%3EOnly%20after%20you%20have%20converted%20all%20the%20coefficients%20to%20the%20correct%26nbsp%3B%20sign%2C%20significant%20digits%20etc%2C%20does%20the%20thing%20start%20to%20make%20sense%20and%20read%20correctly.%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CFONT%20face%3D%22arial%2Chelvetica%2Csans-serif%22%3EPeter%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20just%20managed%20to%20read%20something%20from%20the%20sensor.%20First%20of%20all%2C%20the%20coeffs%20C11%20and%20C22%20are%20all%20zero.%20Coeffs%20are%20like%20this%20(coeff1%20coeff2%20...%20coeff12)%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E3E%2098%20B3%20D2%20C2%2024%2038%20E0%2000%2000%2000%2000%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAnd%20when%20I%20calculate%20the%20real%20pressure%20(pressure%20adc%20%3D%205C80%2C%20temp%20adc%20%3D%207F40)%20it%20says%20918%20hPa%20which%20cannot%20be%20correct%20since%20I'm%20at%2025%20m%20above%20sea%20level%20and%20pressure%20at%20sea%20level%20should%20be%201008%20hPa.%20%26nbsp%3BIt's%20very%20weird%20that%20C11%20and%20C22%20are%20all%20zero.%20Any%20ideas%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGetting%20to%20the%20pressure%20is%20a%20multistep%20process.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFirst%20you%20need%20to%20read%20the%20pressureADC%20and%20the%20temperatureADC.%26nbsp%3B%20Both%20of%20these%20are%202%20bytes.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EpressureADC%3D%20(pressureMSB%26lt%3B%26lt%3B8%2BpressureLSB)%26gt%3B%26gt%3B6%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EtemperatureADC%3D(tempMSB%26lt%3B%26lt%3B8%2BtempLSB)%26gt%3B%26gt%3B6%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENext%20you%20need%20to%20use%20those%202%20ADC%20values%20along%20with%20all%20the%20coefficients%20to%20calculate%20the%20pressure.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Epressure%3D%20AO%2B(B1%2BC11*pressureADC%2BC12*temperatureADC)*pressureADC%2B(B2%2BC22*temperatureADC)*temperatureADC)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Efinally%20you%20make%20another%20correction%3C%2FP%3E%3CP%3EpressureC%3D(65%2F1023*pressure)%2B50%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThat%20finally%20gives%20you%20a%20temperature%20compensated%20pressure%20in%20mBar.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20hardest%20thing%20I%20found%20was%20getting%20the%20coefficients%20to%20be%20read%20in%20correctly.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehi%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20also%20use%20MPL115A%20but%20in%20SPI%2C%20I%20can%20read%20Temperature%2C%20pressure%20and%20coeffcicient%20whihout%20problem%3C%2FP%3E%3CP%3Ebut%20I'm%20not%20sure%20how%20to%20convert%2010bit%20data%20receive%20in%20KPa%20or%20Celsuis%20degree%3C%2FP%3E%3CP%3EFor%20example%20%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20get%20MSB%20pressure%200x5B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LSB%26nbsp%3B%20pressure%200xC0%3C%2FP%3E%3CP%3EI%20do%20this%20%3A%200x5BC0%20%26gt%3B%26gt%3B6%20then%26nbsp%3B%20Pka%20%3D%20(65%2F1023)*Padc%20%2B%2050%3C%2FP%3E%3CP%3Ebut%20I%20obtain%2073KPa%20and%20I'm%20not%20at%202500%20meters%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EHow%20do%20you%20get%20the%20correct%20result%20%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethanks%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Emarkleman%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI've%20been%20trying%20unsuccessfully%20for%20two%20days%20to%20start%20a%20new%20pressure%20and%20temp%20conversion%20with%20no%20avail.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20AN3785%2C%20under%20the%20'Write%20Mode'%20header%2C%20it%20shows%20the%20commands%26nbsp%3Band%20gives%20examples%20of%20how%20to%20write%20the%20'start%20both%20conversions'%26nbsp%3Bbyte%20string%26nbsp%3Bwhich%20shows%20as%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EStart%20bit%3C%2FP%3E%3CP%3ESlave%20address%20(0x60)%3C%2FP%3E%3CP%3EAck%3C%2FP%3E%3CP%3EStart%20both%20conversions%20(0x12)%3C%2FP%3E%3CP%3EAck%3C%2FP%3E%3CP%3EStop%20bit%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBut%26nbsp%3Bunder%20the%20'I2C%20Simplified'%20heading%20it%20show%20to%26nbsp%3Bwrite%20an%20additional%20byte%20of%200x01%20after%20the%26nbsp%3B0x12%20byte%20and%20you%20also%20have%20it%20your%20code.%20I%20added%20it%20and%20now%20it%20works%2C%20Do%20you%20know%20what%20is%20the%200x01%20for%3F%20It's%20not%20documented%20anywhere%20in%20the%20sheet%20except%20in%20the%20'I2C%20Simplified'%20header%20unless%20I'm%20not%20seeing%20it%20somewhere%20else.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3ERobert%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214598%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214598%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EBill%2C%3C%2FP%3E%3CP%3EDid%20you%20ever%20resolve%20this%3F%3C%2FP%3E%3CP%3ERegards%2C%20Mark%20Leman%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214597%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214597%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%20I%20have%20the%20I2C%20version%20and%20can%20read%20the%20data%20from%20it%20using%20both%20a%20PIC%20micro%20and%20a%20NIOS%20soft%20CPU%2C%20what%26nbsp%3BI%20can't%20do%20is%20get%20the%20coeficients%20to%20work%20%3CIMG%20alt%3D%22Smiley%20Sad%22%20class%3D%22emoticon%20emoticon-smileysad%22%20id%3D%22smileysad%22%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fi%2Fsmilies%2F16x16_smiley-sad.png%22%20title%3D%22Smiley%20Sad%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EHere%20is%20the%20code%20I%20use%20(you%20will%26nbsp%3Bneed%20your%20own%20I2C%20start%2Fstop%2Fread%2Fwrite%20functions)%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%3Evoid%20Measure_ambient_presure(void)%20%7B%20unsigned%20char%20x%3B%20unsigned%20char%20MPL115A2_data%5B16%5D%3B%20printf(%22%3BRead%20MPL115A2%5Cr%22)%3B%20i2c_start()%3B%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20I2C%20Bus%20Start%20condition%20i2c_write(MPL115A2_I2C_address)%3B%20%20%20%20%20%2F%2F%20I2C%20bus%20Device%20address%20i2c_write(MPL115A2_start_both_conversion_command)%3B%20%2F%2F%20Command%20to%20Convert%20both%20Pressure%20and%20Temperature%20i2c_write(0x01)%3B%20i2c_stop()%3B%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20I2C%20Bus%20Stop%20condition%20delay_ms(5)%3B%20%20%20%20%20%20%20%20%20%20%2F%2F%20wait%20for%20A-D%20conversion%20to%20take%20place%20i2c_start()%3B%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20I2C%20Bus%20Start%20condition%20i2c_write(MPL115A2_I2C_address)%3B%20%20%20%20%20%2F%2F%20I2C%20bus%20Device%20address%20i2c_write(0x00)%3B%20%20%20%20%20%20%20%20%20%2F%2F%20address%20in%20MPL115A2%20i2c_start()%3B%20%20%20%20%20%20%20%20%20%20%2F%2F%20I2C%20Bus%20Start%20condition%20(a%20restart)%20i2c_write(MPL115A2_I2C_address%7C0x01)%3B%20%20%20%20%2F%2F%20address%20in%20MPL115A2%20%2B%20read%20bit%20MPL115A2_data%5B0%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B1%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B2%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B3%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B4%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B5%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B6%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B7%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B8%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B9%5D%20%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B10%5D%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B11%5D%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B12%5D%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B13%5D%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B14%5D%20%3D%20i2c_read(1)%3B%20%20%20%20%20%2F%2F%20read%20with%20ACK%20MPL115A2_data%5B15%5D%20%3D%20i2c_read(0)%3B%20%20%20%20%20%2F%2F%20read%20with%20noACK%20i2c_stop()%3B%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20I2C%20Bus%20Stop%20condition%20%20printf(%22%3BMPL115A2%20Data%3D%20%22)%3B%20for%20(x%3D0%3Bx%26lt%3B16%3Bx%2B%2B)%20%20%7B%20%20printf(%22%2502X%20%22%2CMPL115A2_data%5Bx%5D)%3B%20%20%7D%20printf(%22%5Cr%22)%3B%20%7D%3C%2FPRE%3E%3CBR%20%2F%3E%3CDIV%3EHere%20is%20some%20sample%20data%26nbsp%3BI%20get%20from%20it.%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3BMPL115A2%20Data%3D%2064%20C0%2075%2080%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3CBR%20%2F%3E%3BMPL115A2%20Data%3D%2065%2000%2076%2080%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3CBR%20%2F%3E%3BMPL115A2%20Data%3D%2065%2040%2076%2080%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3CBR%20%2F%3E%3BMPL115A2%20Data%3D%2065%2000%2076%20C0%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3CBR%20%2F%3E%3BMPL115A2%20Data%3D%2065%2080%2075%20C0%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3CBR%20%2F%3E%3BMPL115A2%20Data%3D%2065%2000%2075%2040%203D%209B%20B9%204A%20C7%2046%2032%20BC%2002%2020%20FD%2060%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERegards%2C%20Mark%20Leman%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-214596%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPL115A%20fixed%20point%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-214596%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHas%20anyone%20other%20then%20%22Billthe%20Biker%22%20tried%20to%20use%20the%20MPL115A%20eval%20boards.%20My%20board%26nbsp%3Bis%26nbsp%3Ban%20i2c%20version%20and%20I%20can%20talk%20to%20it%20but%20it%20doesn't%20want%20to%20read%20any%20data%20out.%20It%20just%20hangs%20and%20locks%20up%20the%20computer.%3C%2FP%3E%3CP%3EAnyone%20have%20any%20idea%3F%20I%20read%20Bill's%20posting%20about%20the%20problems%20with%20the%20math%20and%20I%20am%20concerned%20if%20I%20get%20thru%20the%20hardware%20issues%20then%20I%20will%20be%20faced%20with%20math%20issues.%20Did%20I%20buy%20a%20pig%20here%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EReading%20the%20manual%20shows%20a%20number%20of%20issues%20which%20one%20has%20to%20wonder%20if%20Freescale%20has%20made%20it%20work.%20Any%20replies%20would%20be%20appreciated.%20(I%20hope%20there%20are%20more%20the%20what%20Bill%20has%20received)%3C%2FP%3E%3C%2FLINGO-BODY%3E