Electronic Components Datasheet Search
  English  ▼

X  

AN4159 Datasheet(PDF) 11 Page - STMicroelectronics

Part # AN4159
Description  Hardware and software guidelines for use of the LPS331AP
PDF  27 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4159 Datasheet(HTML) 11 Page - STMicroelectronics

Back Button AN4159 Datasheet HTML 7Page - STMicroelectronics AN4159 Datasheet HTML 8Page - STMicroelectronics AN4159 Datasheet HTML 9Page - STMicroelectronics AN4159 Datasheet HTML 10Page - STMicroelectronics AN4159 Datasheet HTML 11Page - STMicroelectronics AN4159 Datasheet HTML 12Page - STMicroelectronics AN4159 Datasheet HTML 13Page - STMicroelectronics AN4159 Datasheet HTML 14Page - STMicroelectronics AN4159 Datasheet HTML 15Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 11 / 27 page
background image
AN4159
Using the device step-by-step, from basic to advanced
Doc ID 023639 Rev 3
11/27
5
Using the device step-by-step, from basic to
advanced
5.1
First time bring-up
1.
Start by using the same supply for VDD_IO and VDD to check the device functionality.
2.
Make sure of the supply impedances and check all the pins voltages in static condition.
3.
The device is a simple slave with 1 byte sub-address which bit 7 should always be '1'
(bit 7 = 1 enables I2C sub-address multi-byte auto-increment = use it always!)
Use an oscilloscope to check that the device acknowledge its slave address.
Use a normal I2C bus speed (<400 kHz)
Make sure there are no other slaves with same address on the I2C bus lines.
The maximum I2C speed is driven by the slowest slave on the same I2C bus.
4.
Read the Chip ID (sub address 0x8F [=0x0F]) byte: 0xBB should be read
5.1.1
One shot mode measurement sequence
5.
Power down the device (clean start)
–
LPS331AP_WriteByte(LPS331AP_CTRL_REG1_ADDR,0x00); // @0x20=0x00
6.
Set the pressure sensor to higher-precision
–
LPS331AP_WriteByte(LPS331AP_RES_ADDR,0x7A);// @0x10=0x7A
–
Please note that 0x7A is forbidden in auto-mode (25Hz,25Hz): use 0x79 instead.
7.
Turn on the pressure sensor analog front end in single shot mode
–
LPS331AP_WriteByte(LPS331AP_CTRL_REG1_ADDR,0x84); // @0x20=0x84
8.
Run one shot measurement (Temperature and Pressure), self clearing bit when done.
–
LPS331AP_WriteByte(LPS331AP_CTRL_REG2_ADDR,0x01); // @0x21=0x01
9.
Wait until the measurement is completed: Wait that reading (@0x21=0x00)
10. Read the Temperature measurement (2 bytes to read)
–
LPS331AP_Read((u8*)pu8, LPS331AP_TEMP_OUT_ADDR, 2); // @0x2B~2C
–
Temp_Reg_s16 = ((u16) pu8[1]<<8) | pu8[0]; // make a SIGNED 16 bit variable
–
Temperature_DegC = 42.5 + Temp_Ref_s16 / (120*4); // scale and offset
●
Read the Temperature-compensated Pressure measurement
–
LPS331AP_Read((u8*) pu8, LPS331AP_PRESS_OUT_ADDR, 3); // reading
auto-incremented @0x28/29/2A
–
LPS331AP_pressure_hw_reg_u32 = ((u32)pu8[2]<<16)|((u32)pu8[1]<<8)|pu8[0];
// make a unsigned 32 bit variable
–
LPS331AP_pressure_mb = LPS331AP_pressure_hw_reg_u32 / 4096; // scale
11. Check the temperature and pressure values make sense
–
Reading fixed 760 mb, means the sensing element is damaged.
Example of register measurements and conversion:
P = 0x3FF58D means 1023.347 mb
T = 0xE07C means 42.5 + (-8068/120) = -25.7 °C



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com