Discrepancy between AN4519 and MPL3115A Datasheet?

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

Discrepancy between AN4519 and MPL3115A Datasheet?

Jump to solution
4,371 Views
overdamped
Contributor II

I'm having trouble deciding how I should convert the value stored in the fractional part (bits 4-5) of the OUT_P_LSB for CTRL_REG_1 & ALT == 0 (a.k.a. the output pressure should be in pascals). The datasheet states that the value of the OUT_P is in unsigned Q18.2 format which should mean that bit 5 of the OUT_P_LSB would represent 2^-1 (a.k.a. 0.5) place while bit 4 of OUT_P_LSB would represent the 2^-2 place (a.k.a. 0.25)? However, it seems that Table 3 in AN4519 shows the exact opposite.

Is this a problem with the table, or am I completely wrong in my understanding of Q number formats?

0 Kudos
1 Solution
3,941 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

You are right. In barometer mode (ALT bit = 0), bit 5 of the OUT_P_LSB register represents 0.5 Pa while bit 4 corresponds to 0.25 Pa. Table 3 indeed shows the exact opposite and I have already asked the responsible team for correction. Sorry for any inconvenience this may caused.

You might find useful my example code where I illustrate, among others, how to convert the 20-bit data from registers 0x01 – 0x03 to real values in Pascals.


I hope it helps.


Regards,

Tomas


PS: If my answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.

View solution in original post

0 Kudos
4 Replies
3,942 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

You are right. In barometer mode (ALT bit = 0), bit 5 of the OUT_P_LSB register represents 0.5 Pa while bit 4 corresponds to 0.25 Pa. Table 3 indeed shows the exact opposite and I have already asked the responsible team for correction. Sorry for any inconvenience this may caused.

You might find useful my example code where I illustrate, among others, how to convert the 20-bit data from registers 0x01 – 0x03 to real values in Pascals.


I hope it helps.


Regards,

Tomas


PS: If my answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.

0 Kudos
3,941 Views
overdamped
Contributor II

Also, in section 7.1.3 of the datasheet, it states that the temperature is in signed Q12.4 format. However, there are only 8-bits specifying the non-fractional part in the OUT_T_MSB. Is this too a mistake? I think it should be signed Q8.4 if this is using Q number formats?

0 Kudos
3,941 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

You are right again, thanks for pointing it out, it will be corrected in the next data sheet revision.

The 12-bit temperature measurement in degrees Celsius is comprised of a signed integer component and a fractional component. The signed 8-bit integer component is located in the OUT_T_MSB register (0x04) and the fractional component in bits 7-4 of the OUT_T_LSB register (0x05). It obviously corresponds to the Q8.4 format.


Regards,

Tomas

0 Kudos
3,941 Views
overdamped
Contributor II

Thanks for the link and quick response!

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-380010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDiscrepancy%20between%20AN4519%20and%20MPL3115A%20Datasheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20having%20trouble%20deciding%20how%20I%20should%20convert%20the%20value%20stored%20in%20the%20fractional%20part%20(bits%204-5)%20of%20the%20OUT_P_LSB%20for%20CTRL_REG_1%20%26amp%3B%20ALT%20%3D%3D%200%20(a.k.a.%20the%20output%20pressure%20should%20be%20in%20pascals).%20The%20datasheet%20states%20that%20the%20value%20of%20the%20OUT_P%20is%20in%20unsigned%20Q18.2%20format%20which%20should%20mean%20that%20bit%205%20of%20the%20OUT_P_LSB%20would%20represent%202%5E-1%20(a.k.a.%200.5)%20place%20while%20bit%204%20of%20OUT_P_LSB%20would%20represent%20the%202%5E-2%20place%20(a.k.a.%200.25)%3F%20However%2C%20it%20seems%20that%20%3CA%20href%3D%22http%3A%2F%2Fcache.freescale.com%2Ffiles%2Fsensors%2Fdoc%2Fapp_note%2FAN4519.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ETable%203%20in%20AN4519%3C%2FA%3E%20shows%20the%20exact%20opposite.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIs%20this%20a%20problem%20with%20the%20table%2C%20or%20am%20I%20completely%20wrong%20in%20my%20understanding%20of%20Q%20number%20formats%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-380014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Discrepancy%20between%20AN4519%20and%20MPL3115A%20Datasheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3EYou%20are%20right%20again%2C%20thanks%20for%20pointing%20it%20out%2C%20it%20will%20be%20corrected%20in%20the%20next%20data%20sheet%20revision.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3EThe%2012-bit%20temperature%20measurement%20in%20degrees%20Celsius%20is%20comprised%20of%20a%20signed%20integer%20component%20and%20a%20fractional%20component.%20The%20signed%208-bit%20integer%20component%20is%20located%20in%20the%20OUT_T_MSB%20register%20(0x04)%20and%20the%20fractional%20component%20in%20bits%207-4%20of%20the%20OUT_T_LSB%20register%20(0x05).%20It%20obviously%20corresponds%20to%20the%20Q8.4%20format.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20'Arial'%2C'sans-serif'%3B%22%3ETomas%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-380013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Discrepancy%20between%20AN4519%20and%20MPL3115A%20Datasheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAlso%2C%20in%20section%207.1.3%20of%20the%20datasheet%2C%20it%20states%20that%20the%20temperature%20is%20in%20signed%20Q12.4%20format.%20However%2C%20there%20are%20only%208-bits%20specifying%20the%20non-fractional%20part%20in%20the%20OUT_T_MSB.%20Is%20this%20too%20a%20mistake%3F%20I%20think%20it%20should%20be%20signed%20Q8.4%20if%20this%20is%20using%20%3CA%20href%3D%22http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FQ_%2528number_format%2529%23Characteristics%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EQ%20number%20formats%3F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-380012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Discrepancy%20between%20AN4519%20and%20MPL3115A%20Datasheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20for%20the%20link%20and%20quick%20response!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-380011%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Discrepancy%20between%20AN4519%20and%20MPL3115A%20Datasheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380011%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EYou%20are%20right.%20In%20barometer%20mode%20(ALT%20bit%20%3D%200)%2C%20bit%205%20of%20the%20OUT_P_LSB%20register%20represents%200.5%20Pa%20while%20bit%204%20corresponds%20to%200.25%20Pa.%20Table%203%20indeed%20shows%20the%20exact%20opposite%20and%20I%20have%20already%20asked%20the%20responsible%20team%20for%20correction.%20Sorry%20for%20any%20inconvenience%20this%20may%20caused.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EYou%20might%20find%20useful%20my%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-101371%22%20target%3D%22_blank%22%3Eexample%20code%3C%2FA%3E%20where%20I%20illustrate%2C%20among%20others%2C%20how%20to%20convert%20%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3Ethe%2020-bit%20data%20from%20registers%200x01%20%E2%80%93%200x03%20to%20real%20values%20in%20Pascals.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3EI%20hope%20it%20helps.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3ETomas%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%20font-family%3A%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20'Lucida%20Grande'%2C%20sans-serif%3B%22%3E%3CEM%20style%3D%22font-family%3A%20Arial%2C%20sans-serif%3B%20color%3A%20%23333333%3B%22%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011px%3B%20font-family%3A%20inherit%3B%20color%3A%20%233d3d3d%3B%22%3E%3CEM%20style%3D%22font-family%3A%20inherit%3B%22%3EPS%3A%3CSPAN%20class%3D%22Apple-converted-space%22%20style%3D%22font-style%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CSPAN%20class%3D%22Apple-converted-space%22%3E%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-style%3A%20inherit%3B%20font-size%3A%2011px%3B%20font-family%3A%20inherit%3B%20color%3A%20%233d3d3d%3B%22%3EIf%20my%20answer%20helps%20to%20solve%20your%20question%2C%20please%20mark%20it%20as%20%22Correct%22%20or%20%E2%80%9CHelpful%E2%80%9D.%20Thank%20you.%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E