Application Note AN8000.08 Build a barometer using the XE8805/05A AN8000.08 Application Note Guidelines on how to build a barometer around the XE8805/05A and a piezoresistive pressure sensor Rev 1 February 2006 www.semtech.com 1 Application Note AN8000.08 Build a barometer using the XE8805/05A Introduction The aim of this application note is to describe a barometer built around a XE8805/05A microcontroller. To implement this application, the following elements are needed: • • • • • Pro-Start (Programmer and Starter-Kit for the XE8000 series) CoolRIDE (Software development environment for XE8000 series, included in the Pro-Start) XE8805/05AM (MTP version of the XE8805/05A, included in the Pro-Start) Pressure sensor (AM 5801 AV Intersema) LCD display (2 lines X 16 rows) Application bloc diagram This bloc diagram represents the connection between the XE8805/05A, the LCD display and pressure sensor. Figure 1 Microcontroller interface To build this barometer, you must interface the XE8805/05A with the pressure sensor and the LCD display. Pressure sensor overview The pressure sensor is based on micro-machined silicon with piezoresistive elements. The device produces differential output voltages proportional to the applied pressure. Most piezoresistive pressure sensors intended for OEM users are compatible for this application. Since the system is fully programmable, any other sensor can replace the model taken here. The table below presents the main parameters need to set the interface. Values have been taken from the Intersema sensor. Table 1 Parameter Pressure Range Supply current Supply Voltage Full-scale output at 10V bias Sensitivity at 10V bias Output impedance Units m Bar kPa Is V mV Typical 10.00 1.5 50.0 Min 0 0 0 0 49.5 Max 100 100 20 3-0 50.05 mV kΩ 0.5 2.5 2 3.8 © Semtech 2006 www.semtech.com 2 Application Note AN8000.08 Build a barometer using the XE8805/05A The utilized sensor is compensated and calibrated in temperature. Some sensors are smaller, yet neither of these are compensated or calibrated. Software within the XE8805/05A can be used to correct the sensor’s linearity. Pressure is applied to the top of the die and a single pressure port is provided. The optimum pressure media is nonconductive and optimally clean dry air. For a barometer application, the output of the sensor must have a linear response over the expected pressure range of 850-1050 mBar (85-105 kPa). The sensor is designed to measure pressure with respect to a sealed vacuum in the sensor cavity. The model used has a constant voltage compensated resistor network. The advantage here is that the device does not need to interface with a variable gain instrumentation amplifier Figure 2. The Piezorative Pressure Sensor Interface The following below presents the necessary guidelines to interface the sensor with the XE8000 product. Any differential resistive sensor is well suited to the XE8805/05A given that no external specific additional device is required thanks to the integrated programmable gain and offset signal-conditioning circuitry. Gain and offset compensation is executed within the XE8805/05A by programming the parameters of the analog chain. In most common systems, the output of the sensor must be converted to a ground referenced analog voltage. With the XE8805/05A the signal is treated fully differentially on the analog input chain. In order to minimize variations that could affect the accuracy of the output signal, the reference voltage of the A/D converter and the amplifiers is ratio-metric to the power supply. The voltage of the demo board operated at 2.4V provides the sensor supply voltage. The sensor’s output is ratio-metric to the supply voltage. With a sensitivity of 0.05mV/mBar (0.5 mV/kPa) at 10 V, it will result in 0.012 mV/mBar at 2.4V. © Semtech 2006 www.semtech.com 3 Application Note AN8000.08 Build a barometer using the XE8805/05A Zooming ADC In general, concepts using the maximum resolution of the A/D have the power supply as full-scale. It is advisable for a barometer to have a pressure range of 850-1050 mBar. In addition, the sensor is driven by a constant voltage supply that is usually easier to generate than constant current sources. This is the useful range that is converted to the maximum resolution of the ADC using the zoom included in the acquisition chain. Figure 3. ADC Conversion Conversion Conversion 0hFFFF 0hFFFF 0hC000 0h8000 0h0000 0h0000 850 1050 850 Sensor output Usual ADC 1050 Sensor output Zooming ADC The gain made in the amplification stage of the zooming ADC increases the signal so that the value of the LSB of the ADC referring to the input of the circuit is smaller. This enables it to detect a very small signal variation. The XE8805/05A pre-amplifier maximum gain (-1000) is such that the ADC can measure the input signal down to the noise of the pre-amplifier. In order to adapt the sensor output as well as possible to the span of the A/D, the output signal of the sensor is amplified and offset at the different stages of the zoom. © Semtech 2006 www.semtech.com 4 Application Note AN8000.08 Build a barometer using the XE8805/05A The diagram below shows the signal at the input of the XE8805/05A, and at the output of the 1st, 2nd and 3rd amplifier. Figure 4. Intermediate Analog Chain Stage Intermediate analog chain stage 1.2000 1.0000 span voltage V 0.8000 Input vd1 0.6000 vd2 vd3 0.4000 0.2000 0.0000 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 sensor output mV The signal is amplified to have a span voltage of 1.0 V at the input of the A/D converter, whereas the sensor signal is within 10 to 12.5 mV. The tables below show the calculated parameters that represent the response above. Values are in decimals. Parameter Vref Gain 1 Offset2 Gain2 Offset3 Gain3 Value 2.41 10 1 10 11 50 Table 2 © Semtech 2006 www.semtech.com 5 Application Note AN8000.08 Build a barometer using the XE8805/05A Pressure mBar 1050 1000 Vin V 0.0126 0.0120 Vd1 V 0.126 0.120 Vd2 V 0.778 0.718 Vd3 V 1.032 0.782 ADC code 28065 21269 950 900 850 0.0114 0.0108 0.0102 0.114 0.108 0.102 0.658 0.598 0.538 0.532 0.282 0.032 14474 7678 883 Table 3 The values of the registers give the correct range of the span voltage. To convert the ADC code to an exact pressure value, the RISC core capabilities provide the developer with optimal flexibility The formula below gives the equation to compute the correct value of the pressure: Pout = Phigh − Plow code high − code low . ADC _ code + code null = 1050 − 850 . ADC _ code + 844 28065 − 883 Codenull is the equivalent pressure value corresponding to a null ADC code LCD display interface The LCD display module uses a standard protocol. We have a choice between a 4 lines serial protocol and 8 lines parallel protocol. For this application we chose the 8 lines parallel protocol. To interface the LCD display we used the two parallel ports of XE8805/05A. In this case, we used the PortC to transfer the 8 bits of data, and the PortB to transfer the 3 bits of control. Figure 5. Connections between LCD Display and the XE8805/05A Pro-Start © Semtech 2006 www.semtech.com 6 Application Note AN8000.08 Build a barometer using the XE8805/05A Application program Flow chart The following flow chart describes all program implementation. Main Routine Figure 6 RESET Initialization Measurement © Semtech 2006 www.semtech.com 7 Application Note AN8000.08 Build a barometer using the XE8805/05A Initialization routine Figure 7 Initialization Initialization of global variables Initialization of I/O ports Initialization of ZOOM A/D converter Measurement © Semtech 2006 www.semtech.com 8 Application Note AN8000.08 Build a barometer using the XE8805/05A Measurement routine Figure 8 Measurement Condition 1 : While (1) this condition is always true Enable IRQ from the ZOOM A/D converter Condition 2 : PA0 is activated Start the ZOOM A/D converter Enable IRQ from PortA 0 Write Initial String to the LCD display Codition 1 YES Codition 2 NO Return to Initialization © Semtech 2006 www.semtech.com 9 Application Note AN8000.08 Build a barometer using the XE8805/05A Zoom ADC Irq handler routine Figure 9 Handler for zoom ADC IRQ Put the value converted to an array Display the value converted Condition 3 NO 1 Make the addition between each value of the Array Condition 4 NO 2 MesCount = 10 Calculate the value to be displayed Condition 5 NO Start zoom ADC for a new conversion 3 Pressure = Pressure * 0.9 2 Pressure = Pressure + Array[0] Display the value calculated MesCount = 10 Return of IRQ Calculate the value to be displayed 1 Condition 3 : MesCount = 9 Condition 4 : MesCount < 9 Display the value calculated Condition 5 : MesCount > 9 3 © Semtech 2006 www.semtech.com 10 Application Note AN8000.08 Build a barometer using the XE8805/05A © Semtech 2006 All rights reserved. Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license under patent or other industrial or intellectual property rights. Semtech. assumes no responsibility or liability whatsoever for any failure or unexpected operation resulting from misuse, neglect improper installation, repair or improper handling or unusual physical or electrical stress including, but not limited to, exposure to parameters beyond the specified maximum ratings or operation outside the specified range. SEMTECH PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. INCLUSION OF SEMTECH PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE UNDERTAKEN SOLELY AT THE CUSTOMER’S OWN RISK. Should a customer purchase or use Semtech products for any such unauthorized application, the customer shall indemnify and hold Semtech and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs damages and attorney fees which could arise. Contact Information Semtech Corporation Wireless and Sensing Products Division 200 Flynn Road, Camarillo, CA 93012 Phone (805) 498-2111 Fax : (805) 498-3804 © Semtech 2006 www.semtech.com 11