How to interpret the LPS331AP pressure and temperature readings. Main components mbar absolute barometer with digital output

Similar documents
TN1251 Technical note

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

AN2667 Application note

AN4113 Application note

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

AN2676 Application note

AN626 Application note

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

AN2672 Application note

EV-VNQ5E050AK VNQ5E050AK evaluation board

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

AN2143 Application note

AN3996 Application Note

AN2240 Application note

STTS V memory module temperature sensor. Features

AN2825 Application Note

AN2474 Application note

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter

AN2261 APPLICATION NOTE

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

UM1488 User manual. STPMC1 evaluation software. Introduction

AN3279 Application Note

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description

AN2855 Application note

AN3980 Application note

Main components USB charging controller with integrated power switch

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

AN3001 Application note

AN3354 Application note

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

STA bit single chip baseband controller for GPS and telematic applications. Features

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

AN2734 Application note S-Touch design procedure Introduction

AN3965 Application note

Obsolete Product(s) - Obsolete Product(s)

SOT23-6L ESDALCL6-2SC6

AN3154 Application note

STM8 I 2 C optimized examples

AN3250 Application note

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

AN2673 Application note

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

STMicroelectronics. STxP70-4 assembler. User manual Rev A. October

AN2592 Application note

AN2361 Application note

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view)

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

LD A very low drop adjustable positive voltage regulator. Description. Features

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents


AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction

AN4321 Application note

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards:

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits

AN4274 Application note

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

EMIF03-SIM06F3. 3-line IPAD, EMI filter including ESD protection. Description. Features. Application. Complies with the following standards:

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN4440 Application note

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

AN2557 Application note

AN2430 Application note

UM1719 User manual. The STPM3x evaluation software. Introduction

TN0189 Technical note

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN2408 Application note

AN2202 Application note

AN3099 Application note

ECMF02-3F3. Common mode filter with ESD protection. Features. Description. Applications. Complies with the following standard:

AN2594 Application note

L6460. SPI configurable stepper and DC multi motor driver. Features. Description

SMP30. Trisil for telecom equipment protection. Features. Applications. Description. Benefits

AN3991 Application note

UM1008 User manual. Demonstration kit for the ST7570 power line modem with graphical user interface. Introduction

AN2781 Application note

ST10F271B/E, ST10F272B/E Errata sheet

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512

TN0132 Technical note

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

AN4833 Application note

AN3155 Application note

AN4464 Application note

STEVAL-VNH5019A. Motor driver evaluation board based on VNH5019A. Description. Features

AN3975 Application note

AN3265 Application note

Transcription:

DT Design tip How to interpret the LPSAP pressure and temperature readings By Tom Bocchino and Boon-Nam Poh LPSAP Main components - mbar absolute barometer with digital output Purpose and benefits Description Review of two s complement notation for ease of design How to interpret pressure and temperature values in the LPSAP The LPSAP is a MEMS sensor which measures absolute pressure (P) and temperature (t) and stores the values in two s complement registers which can be read via the I C or SPI host interface. This design tip explains how to interpret the two s complement register values. Figure. LPSAP Analog to Digital Data Flow Analog Domain Digital Domain P t Sensors and Bias Low Noise Analog Front End (AFE) Analog to Digital Conversion (ADC) Digital Control Signal Processing (DSP) & Register Bank I C SPI - Pressure count Two s complement value - Temperature count Two s complement value Addr(h) h h Ah Bh Ch Byte Description PressureOut_XL (LSB) PressureOut_L (MIDDLE) PressureOut_H (MSB) TemperatureOut_L (LSB) TemperatureOut_H (MSB) July DT Rev /

The LPSAP stores pressure as a - word and temperature as a - word. Both values are stored as two s complement integers as illustrated in Figure. Why we use two s complement Measuring analog values and storing the data in a digital domain creates an interesting dilemma. How do we represent negative analog values in a digital system? How do we handle the number zero? A computing system uses two's complement to simplify the processing logic required to handle negative numbers and subtractions. A circuit designed for addition can handle negative operands by using two s complement. This minimizes the need for additional circuitry capable of subtraction or additional switching circuitry based on the sign. Most modern computers, MCU s, and DSP s use two s complement notation. If a register is defined as two s complement, typically the most significant (msb) of the most significant byte (MSB) indicates the sign as shown in Figure. If the msb of the register is, the number is negative and we use two s complement. If the is, the integer is positive and no translation is necessary. Figure. Sign indicates whether a value is positive or negative S I G N PressOut_H (xa) PressOut_L (x) PressOut_XL (x) = POS = NEG pressure magnitide How to obtain pressure values in mbar The LPSAP sensor stores the pressure value in raw counts in registers: PressOut_H, PressOut_L, and PressOut_XL. The most significant of the PressOut_H register indicates the polarity. If the sign is zero, then the value is positive and the pressure in mbar is determined by dividing the decimal value by the scaling factor of. A sign of indicates a negative value, so we first take the two s complement of the complete word and then divide by. Keep in mind that the sign determines whether we should perform the two s complement operation or not. The bytes are concatenated to form a word and the complete word is represented in two s complement (not the single bytes). When reading the pressure value, it is important to note the byte ordering. This is especially important in auto-increment mode when the address is incremented automatically. The designer should assemble the proper - endian format (pressure count = Ah & h & h). July DT Rev /

The device may be configured to report a delta pressure by using the auto-zero feature in CTRL_REG (x). When using the auto-zero feature, the PressOut() registers could contain a negative value which is the sum difference between the current pressure and the reference pressure. Negative values can also occur when a device is defective. Hence it can be used for self-test during a boot up operation and when the auto-zero feature is not used. An example of a pressure calculation when the sign is is shown in the following example. Pressure example : sign is, this is a positive value PressOut_H (xa) PressOut_L (x) PressOut_XL (x) F F D Pressure Counts = Ah & h & h = FFDh = (dec) # counts counts Pressure millibar = = =. mbar Scaling factor counts/mbar In some applications the device may be configured to report a differential pressure value in the PressOut() registers by using the auto-zero feature. In this case the PressOut() registers could contain a negative value as illustrated in the second example of a pressure calculation shown below. To obtain the pressure in mbar we first take the two s July DT Rev /

complement of the complete word and then divide by. Pressure example : negative number, two's complement PressOut_H (xa) PressOut_L (x) PressOut_XL (x) F E A + ; need to take the two's complement ; invert ; add = - DECh = - (dec) - counts Pressure in millibar = = -. mbar counts/mbar How to obtain temperature values in C The LPSAP also contains a temperature sensor which is used for compensation of the pressure sensor. The temperature data is also available for outside applications. The temperature raw count is stored in registers Temp_Out_H (Ch) and Temp_Out_L (Bh). The temperature in C can be determined by calculating the two s complement, if necessary, and perform the scaling. An example of a temperature calculation when the sign is is shown below. Temperature example : sign is, this is a positive value Temp_Out_H (xc) Temp_Out_L (xb) B D Temperature Counts = Ch & Bh = BDh = (dec) # counts counts Temperature in C = Offset + =. + = C scale counts / C July DT Rev /

Likewise, a negative value is indicated when the MSB in the temperature word is equal to. To obtain the temperature, we first take the two s complement of the complete word and then perform the scaling and offset operation. An example of a temperature calculation when the sign is is shown below. Temperature example : sign is, two s complement Temp_Out_H (xc) Temp_Out_L (xb) E C + ; need to take the 's complement ; invert ; add = - Fh = - (dec) # counts - counts Temperature in C = Offset + =. + = +. C scale counts / C As shown in Temperature example, a negative value in the raw count register does not always result in a negative a temperature value in degrees Celsius. This is because the offset and scaling factor must be applied to determine the final value in C units. When reading the temperature values it is also important to note the byte ordering. This is especially true in auto-increment mode in which case address Bh is read first, followed by address Ch. The designer should assemble the proper - endian format (temperature count = Ch & Bh). The following registers in the device are two s complement. All other registers in the device are either unsigned or wise representations (not negative). Table. LPSAP two s complement registers FUNCTION BYTES DESCRIPTION PRESS_OUT() Ah & h & h TEMP_OUT() Bh & Ch temperature data REF_P() absolute pressure data OR this contains the difference in pressure between Ref_P() and and Press_Out() when auto-zero mode is used. Ah & h & h absolute pressure in auto-zero mode. July DT Rev /

Support material Related design support material STEVAL-MKIV STEVAL-MKIV emotion Main Board which accepts several MEMS modules, including pressure sensor plug-in module LPS Pressure Module for emotion Board Datasheet: Data brief: User Manual: Data brief: Documentation LPSAP, MEMS pressure sensor: - mbar absolute digital output barometer STEVAL-MKIV, emotion: ST MEMS adapters motherboard based on the STMFRE compatible with all ST MEMS adapters V UM, Unico GUI: software guide STEVAL-MKIV, LPSAP adapter board for a standard DIL socket /sensors Revision history Date Version Changes -Jul- Initial release July DT Rev /

Please Read Carefully Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at anytime, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVEGRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America July DT Rev /