No changes between revisions
/Designs/Measuring_instruments/RMDS01A/pdf/UCA202_M_EN.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/Designs/Measuring_instruments/RMDS01A/pdf/UCA222_WebBrochure.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/Modules/Sensors/ALTIMET01A/SW/ARM/MPL115A1.cpp |
---|
0,0 → 1,221 |
/* mbed MPL115A1 (Barometric Pressure Sensor) Library |
* |
* This code is based on application notes and |
* Sparkfun example code, written by Jim Lindblom <jim at sparkfun.com> |
* |
* Copyright (c) 2012 Mitja Kleider |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
*/ |
// TODO: support shutdown pin |
#include "MPL115A1.h" |
MPL115A1::MPL115A1(SPI& spi, PinName ncs) : _spi(spi), _cs(ncs) |
{ |
_cs = 1; |
// sdn = 1; // sensor on |
// SCL idle low, sample data on rising edge |
_spi.format(8, 0); // 8bit, POL 0, PHA 0 |
_spi.frequency(1000000); // 1MHz |
} |
void MPL115A1::write_register(uint8_t address, char data) |
{ |
//write any data byte to any single address |
//adds a 0 to the MSB of the address byte (WRITE mode) |
address &= 0x7F; |
_cs = 0; |
wait_ms(1); |
_spi.write(address); |
wait_ms(1); |
_spi.write(data); |
wait_ms(1); |
_cs = 1; |
} |
char MPL115A1::read_register(uint8_t address) |
{ |
// returns the contents of any 1 byte register from any address |
// sets the MSB for every address byte (READ mode) |
char byte; |
address |= 0x80; |
_cs = 0; |
_spi.write(address); |
byte = _spi.write(0x00); |
_cs = 1; |
return byte; |
} |
float MPL115A1::readPressure() |
{ |
// read pressure, temperature and coefficients, calculate and return absolute pressure [kPa] |
write_register(MPL115A1_STARTBOTH, 0x00); // start temperature and pressure conversions |
wait_ms(10); // AN: data is typically ready after 3ms, DS for both: max. 1ms |
// read raw pressure |
uiPH = read_register(MPL115A1_PRESH); |
uiPL = read_register(MPL115A1_PRESL); |
uiTH = read_register(MPL115A1_TEMPH); |
uiTL = read_register(MPL115A1_TEMPL); |
uiPadc = (unsigned int) uiPH << 8; |
uiPadc += (unsigned int) uiPL & 0x00FF; |
uiTadc = (unsigned int) uiTH << 8; |
uiTadc += (unsigned int) uiTL & 0x00FF; |
// read coefficients, put into 16-bit Variables |
// a0, pressure offset coefficient |
sia0MSB = read_register(MPL115A1_A0MSB); |
sia0LSB = read_register(MPL115A1_A0LSB); |
sia0 = (signed int) sia0MSB << 8; |
sia0 += (signed int) sia0LSB & 0x00FF; |
// b1, pressure sensitivity coefficient |
sib1MSB = read_register(MPL115A1_B1MSB); |
sib1LSB = read_register(MPL115A1_B1LSB); |
sib1 = (signed int) sib1MSB << 8; |
sib1 += (signed int) sib1LSB & 0x00FF; |
// b2, 1st order temperature offset coefficient (TCO) |
sib2MSB = read_register(MPL115A1_B2MSB); |
sib2LSB = read_register(MPL115A1_B2LSB); |
sib2 = (signed int) sib2MSB << 8; |
sib2 += (signed int) sib2LSB & 0x00FF; |
// c12, temperature sensitivity coefficient (TCS) |
sic12MSB = read_register(MPL115A1_C12MSB); |
sic12LSB = read_register(MPL115A1_C12LSB); |
sic12 = (signed int) sic12MSB << 8; |
sic12 += (signed int) sic12LSB & 0x00FF; |
// c11, pressure linearity (2nd order) coefficient |
sic11MSB = read_register(MPL115A1_C11MSB); |
sic11LSB = read_register(MPL115A1_C11LSB); |
sic11 = (signed int) sic11MSB << 8; |
sic11 += (signed int) sic11LSB & 0x00FF; |
// c22, 2nd order temperature offset coefficient |
sic22MSB = read_register(MPL115A1_C22MSB); |
sic22LSB = read_register(MPL115A1_C22LSB); |
sic22 = (signed int) sic22MSB << 8; |
sic22 += (signed int) sic22LSB & 0x00FF; |
// Coefficient 9 equation compensation |
// 10bit stored in 16bit, shift right |
uiPadc = uiPadc >> 6; |
uiTadc = uiTadc >> 6; |
// Step 1: c11x1 = c11 * Padc |
lt1 = (signed long) sic11; |
lt2 = (signed long) uiPadc; |
lt3 = lt1*lt2; |
si_c11x1 = (signed long) lt3; |
// Step 2: a11 = b1 + c11x1 |
lt1 = ((signed long)sib1)<<14; |
lt2 = (signed long) si_c11x1; |
lt3 = lt1 + lt2; |
si_a11 = (signed long)(lt3>>14); |
// Step 3: c12x2 = c12 * Tadc |
lt1 = (signed long) sic12; |
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)sic22; |
lt2 = (signed long)uiTadc; |
lt3 = lt1 * lt2; |
si_c22x2 = (signed long)(lt3); |
// Step 6: a2 = b2 + c22x2 |
lt1 = ((signed long)sib2<<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)sia0<<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); |
siPcomp = lt3/8192; |
// 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 respectively |
decPcomp = ((65.0/1023.0)*siPcomp)+50; |
return decPcomp; |
} |
float MPL115A1::readTemperature() |
{ |
// read, calculate and return temperature |
write_register(MPL115A1_STARTTEMP, 0x00); // start temperature conversion |
wait_ms(10); // AN: data is typically ready after 3ms, DS for temp: max. 0.7ms |
// read raw temperature |
uiTH = read_register(MPL115A1_TEMPH); |
uiTL = read_register(MPL115A1_TEMPL); |
uiTadc = (unsigned int) uiTH << 8; |
uiTadc += (unsigned int) uiTL & 0x00FF; |
// 10bit stored in 16bit, shift right |
uiTadc = uiTadc >> 6; |
// Tadc is 472 counts at 25degC, -5.35 counts/degC |
// return ((float)uiTadc - 472.0)/(-5.35) + 25 |
return (605.75-uiTadc)*0.186916; |
} |
/Modules/Sensors/ALTIMET01A/SW/ARM/MPL115A1.h |
---|
0,0 → 1,87 |
#ifndef MPL115A1_H |
#define MPL115A1_H |
#include "mbed.h" |
/** barometric pressure and temperature sensor MPL115A1 control class, based on SPI |
* |
* Example: |
* @code |
* #include "mbed.h" |
* #include "MPL115A1.h" |
* |
* SPI spi(p11,p12,p13); |
* MPL115A1 bar(spi, p14); |
* |
* Serial pc(USBTX, USBRX); |
* |
* int main() { |
* while(1) { |
* wait(10); |
* pc.printf("Pressure is %f\n", bar.readPressure()); |
* pc.printf("Temperature is %f\n", bar.readTemperature()); |
* } |
* } |
* @endcode |
*/ |
// real addresses, in read_register: address |= 0x80 |
#define MPL115A1_PRESH 0x00 // 80 |
#define MPL115A1_PRESL 0x02 // 82 |
#define MPL115A1_TEMPH 0x04 // 84 |
#define MPL115A1_TEMPL 0x06 // 86 |
#define MPL115A1_A0MSB 0x08 // 88 |
#define MPL115A1_A0LSB 0x0A // 8A |
#define MPL115A1_B1MSB 0x0C // 8C |
#define MPL115A1_B1LSB 0x0E // 8E |
#define MPL115A1_B2MSB 0x10 // 90 |
#define MPL115A1_B2LSB 0x12 // 92 |
#define MPL115A1_C12MSB 0x14 // 94 |
#define MPL115A1_C12LSB 0x16 // 96 |
#define MPL115A1_C11MSB 0x18 // 98 |
#define MPL115A1_C11LSB 0x1A // 9A |
#define MPL115A1_C22MSB 0x1C // 9C |
#define MPL115A1_C22LSB 0x1E // 9E |
#define MPL115A1_STARTPRES 0x20 // start pressure measurement |
#define MPL115A1_STARTTEMP 0x22 // start temperature measurement |
#define MPL115A1_STARTBOTH 0x24 // start both simultaneously |
class MPL115A1 { |
private: |
SPI& _spi; |
DigitalOut _cs; // chip select, active low |
//DigitalOut sdn; // shutdown pin, high=on, low=off |
public: |
/** Create a barometer object connected to the SPI bus and specified chip select pin |
* |
* @param spi SPI master object |
* @param ncs chip select pin |
*/ |
MPL115A1(SPI& spi, PinName ncs); |
/** start measurement, read registers, calculate and return pressure */ |
float readPressure(); |
/** start measurement, read registers, calculate and return temperature */ |
float readTemperature(); |
private: |
void write_register(uint8_t address, char data); |
char read_register(uint8_t address); |
signed char sia0MSB, sia0LSB; |
signed char sib1MSB, sib1LSB; |
signed char sib2MSB, sib2LSB; |
signed char sic12MSB, sic12LSB; |
signed char sic11MSB, sic11LSB; |
signed char sic22MSB, sic22LSB; |
signed int sia0, sib1, sib2, sic12, sic11, sic22, siPcomp; |
float decPcomp; |
signed long lt1, lt2, lt3, si_c11x1, si_a11, si_c12x2; |
signed long si_a1, si_c22x2, si_a2, si_a1x1, si_y1, si_a2x2; |
unsigned int uiPadc, uiTadc; |
unsigned char uiPH, uiPL, uiTH, uiTL; |
}; |
#endif |
/Modules/Sensors/ALTIMET01A/SW/Wiring/MPL115A1/MPL115A1.ino |
---|
0,0 → 1,118 |
/* |
MPL115A1 sparkfun breakout baropressure meter |
SDN : pin 7 |
CSN : pin 10 |
SDI/MOSI : pin 11 |
SDO/MISO : pin 12 |
SCK : pin 13 |
*/ |
// the sensor communicates using SPI, so include the library: |
#include <SPI.h> |
#define PRESH 0x80 |
#define PRESL 0x82 |
#define TEMPH 0x84 |
#define TEMPL 0x86 |
#define A0MSB 0x88 |
#define A0LSB 0x8A |
#define B1MSB 0x8C |
#define B1LSB 0x8E |
#define B2MSB 0x90 |
#define B2LSB 0x92 |
#define C12MSB 0x94 |
#define C12LSB 0x96 |
#define CONVERT 0x24 |
#define chipSelectPin 10 |
#define shutDown 7 |
float A0_; |
float B1_; |
float B2_; |
float C12_; |
void setup() { |
Serial.begin(115200); |
// start the SPI library: |
SPI.begin(); |
// initalize the data ready and chip select pins: |
pinMode(shutDown, OUTPUT); |
digitalWrite(shutDown, HIGH); |
pinMode(chipSelectPin, OUTPUT); |
digitalWrite(chipSelectPin, HIGH); |
delay (10); |
// read registers that contain the chip-unique parameters to do the math |
unsigned int A0H = readRegister(A0MSB); |
unsigned int A0L = readRegister(A0LSB); |
A0_ = (A0H << 5) + (A0L >> 3) + (A0L & 0x07) / 8.0; |
unsigned int B1H = readRegister(B1MSB); |
unsigned int B1L = readRegister(B1LSB); |
B1_ = ( ( ( (B1H & 0x1F) * 0x100)+B1L) / 8192.0) - 3 ; |
unsigned int B2H = readRegister(B2MSB); |
unsigned int B2L = readRegister(B2LSB); |
B2_ = ( ( ( (B2H - 0x80) << 8) + B2L) / 16384.0 ) - 2 ; |
unsigned int C12H = readRegister(C12MSB); |
unsigned int C12L = readRegister(C12LSB); |
C12_ = ( ( ( C12H * 0x100 ) + C12L) / 16777216.0 ) ; |
} |
void loop() { |
Serial.print("de druk is : "); |
Serial.println(baropPessure()); |
delay(1000); |
} |
//Read registers |
unsigned int readRegister(byte thisRegister ) { |
unsigned int result = 0; // result to return |
digitalWrite(chipSelectPin, LOW); |
delay(10); |
SPI.transfer(thisRegister); |
result = SPI.transfer(0x00); |
digitalWrite(chipSelectPin, HIGH); |
return(result); |
} |
//read pressure |
float baropPessure(){ |
digitalWrite(chipSelectPin, LOW); |
delay(3); |
SPI.transfer(0x24); |
SPI.transfer(0x00); |
digitalWrite(chipSelectPin, HIGH); |
delay(3); |
digitalWrite(chipSelectPin, LOW); |
SPI.transfer(PRESH); |
unsigned int presH = SPI.transfer(0x00); |
delay(3); |
SPI.transfer(PRESL); |
unsigned int presL = SPI.transfer(0x00); |
delay(3); |
SPI.transfer(TEMPH); |
unsigned int tempH = SPI.transfer(0x00); |
delay(3); |
SPI.transfer(TEMPL); |
unsigned int tempL = SPI.transfer(0x00); |
delay(3); |
SPI.transfer(0x00); |
delay(3); |
digitalWrite(chipSelectPin, HIGH); |
unsigned long press = ((presH *256) + presL)/64; |
unsigned long temp = ((tempH *256) + tempL)/64; |
float pressure = A0_+(B1_+C12_*temp)*press+B2_*temp; |
float preskPa = pressure* (65.0/1023.0)+50.0; |
return(preskPa); |
} |
/Modules/Sensors/ALTIMET01A/pdf/AN3785.pdf |
---|
0,0 → 1,3841 |
%PDF-1.5 |
%âãÏÓ |
2 0 obj |
<< |
/Type /Catalog |
/Names 4 0 R |
/Pages 5 0 R |
/Threads 6 0 R |
/Metadata 7 0 R |
/Outlines 8 0 R |
/PageMode /UseOutlines |
/OpenAction [9 0 R /XYZ null null null] |
/PageLabels 10 0 R |
>> |
endobj |
7 0 obj |
<< |
/Type /Metadata |
/Length 4361 |
/Subtype /XML |
>> |
stream |
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> |
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.1.1"> |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
<rdf:Description rdf:about="" |
xmlns:dc="http://purl.org/dc/elements/1.1/"> |
<dc:format>application/pdf</dc:format> |
<dc:description> |
<rdf:Alt> |
<rdf:li xml:lang="x-default">AN3785: MPL115A is a simple barometer with digital output and high performance targeting low cost commercial applications. The device employs a MEMS PRT pressure sensor with a conditioning IC to provide accurate pressure data. The sensor output is accurate to ±1 kPa over the 50 kPa to 115 kPa pressure range. An integrated ADC provides digitized temperature and pressure sensor outputs via an I2C or SPI bus.</rdf:li> |
</rdf:Alt> |
</dc:description> |
<dc:title> |
<rdf:Alt> |
<rdf:li xml:lang="x-default">AN3785, How to Implement the Freescale MPL115A Digital Barometer - Application Notes</rdf:li> |
</rdf:Alt> |
</dc:title> |
<dc:creator> |
<rdf:Seq> |
<rdf:li>Freescale Semiconductor, Inc.</rdf:li> |
</rdf:Seq> |
</dc:creator> |
<dc:subject> |
<rdf:Bag> |
<rdf:li>AN3785, MPL115A, Digital Barometer, MEMS PRT pressure sensor, conditioning IC, ADC, digitized temperature, I2C, SPI</rdf:li> |
</rdf:Bag> |
</dc:subject> |
</rdf:Description> |
<rdf:Description rdf:about="" |
xmlns:pdf="http://ns.adobe.com/pdf/1.3/"> |
<pdf:Producer>Acrobat Distiller 9.5.1 (Windows)</pdf:Producer> |
<pdf:Keywords>AN3785, MPL115A, Digital Barometer, MEMS PRT pressure sensor, conditioning IC, ADC, digitized temperature, I2C, SPI</pdf:Keywords> |
</rdf:Description> |
<rdf:Description rdf:about="" |
xmlns:xap="http://ns.adobe.com/xap/1.0/"> |
<xap:CreatorTool>FrameMaker 7.2</xap:CreatorTool> |
<xap:ModifyDate>2012-10-09T15:47:10-05:00</xap:ModifyDate> |
<xap:CreateDate>2008-10-03T08:57:47Z</xap:CreateDate> |
<xap:MetadataDate>2012-06-21T14:12:43-07:00</xap:MetadataDate> |
</rdf:Description> |
<rdf:Description rdf:about="" |
xmlns:xapMM="http://ns.adobe.com/xap/1.0/mm/"> |
<xapMM:DocumentID>uuid:506b1fb9-ceb4-47e6-a8ae-a955bb8c09d8</xapMM:DocumentID> |
<xapMM:InstanceID>uuid:60c67c55-2ba4-4152-b8c1-d4dfe9ce0dcf</xapMM:InstanceID> |
</rdf:Description> |
</rdf:RDF> |
</x:xmpmeta> |
<?xpacket end="w"?> |
endstream |
endobj |
19 0 obj |
<< |
/Filter [/FlateDecode] |
/Length 3145 |
>> |
stream |
HWks£Èý+÷#lhÞûÍcï&ÞÚñ83Ú¤R;ù¡% `ÉëüúÜÝ Ù3)Uîû8÷ÜÓïÿòÅýQyiO)ð=á_Á aqäÅÑ<&W¶ð~»õ!í6¾çûAÛhÆ°}|üå@kä^Áö¿;_UÀÏv7±£]åeÑhø¢uÙѳ¶:S7¼7uîÛÒ{ʧç~þµýEöBæ½¢ö |
+-Ce-%6#® Õ+}æ.3£ÄG7rz4ÝEùãO¿ÀãgWùÎÖÝDüb?ð«£»Á~r¢!ÖÈÏÚ±C_ m%açÿ®¥P$Î÷·+ÎÏl`É\ô+£ºs]ÍqZäËÓPLçô8pϪP{`:£42¤;qZ.oE= |
+07Yáã#~ök@ÔÍÇÛöÕÁ¨~uÃK}iVøü»©ÍPÎB¬bl¡×©µÆ¨üü,#]+ ÝLæôâÖ½Î!Á¬är_y§ÎÐäÝ/绡â"LV|¡Á/5aôæyùôé4Boo»©+»×ª´ IZ"ðÎ-UãóAxù <7º»¯"qÈ8x$È£ui!q5·Z.T¸¼ÞÉgöH} á»_(úû ´ð®e<£ æ{ÒÆI2#à¶hا;Dàj ,²ÝiÙ\B°yê¸ |
+>ú¸ÞsA^ÌJ5ȽxisM\ ¯&mbIY¡={üßpàÇ P,$6vÞ"ú0þÐÑkÞcÓ4Î6×QïíÞ,iÎý |
+n¿ûn@ÈéÃÕnWzf¦ÿUR§âÉÛHòL3µ7--3Õ.¥Z`o+8rÄ^¬ Ò´Q1eßcØVF&z |
+Oå±hû*°náqC?Ó°PôºõÑx©+DQ±¶*g¡+ÓiæPpì#¡÷@ìgG#LE aÆó´×r> |
+}ÑÏ[ÜôýL7¤ÍÒþjiµÆÔ[zDXͪà´È7VüsÙgÇ£º S/Ýuâ6`J1ñ.#b(LÂÔvÃHl.Z(EËÌ¢G{àsg¿´=!o«^p&B?ÞX |
+/J8K¶4D{Zø ¤Uj÷*Üh"j+6`Wë¥LÝß8b.Öá¬F2Kiúrø4ËP*ïn6/c}6¯]Åzx-jIÉGàèsÝñ¹wt)¼³F#áC7¤v/ì[«[ ]ðV¥ckn£èéR# G8ȨõÌt*Ydh·J{ðXÓêSSóQÅ |
+d¦´.ÕpfõÊÿø.£Ý þÊ>¦eYBÓ'5mcÚ&Mô(%ͦ ÚÏïÌÜeEb|2*,Ãî3÷ÄOâ!çbaÞÞ£úØB-ÌQí¨`©+ï*ÖüÃÌùÁ=áTÝXÓ8ÜÑöY HT×ÙÈ©gÌwJ.Bé¹) |Â6Ô8Чý H=³D? r |
+#CNÂ-þ7ÃO¿nH¨²8¦F|ºåÉt¤ mJëä'äHÆLÓA-ºGL®"IùÀI½Íõzi¼`kë£{T¯;AÆ;½Å°Xß»â/{nIz* |
+N*ï|V«]üôREK¦t¤#LOo.Îvà´Øß«ô#9Ñ(]DM£Áp&ËO i:/xTø |
+OÉ/WeÈ8"Eps_߶÷£Ì |
+)Àêå\×Rf!?ÌÙZ{C®CédL,l[Ý{laê_ «¢m |
+endstream |
+endobj |
+22 0 obj |
+<< |
+/Type /XObject |
+/Width 260 |
+/Filter [/DCTDecode] |
+/Height 76 |
+/Length 4608 |
+/Subtype /Image |
+/ColorSpace 24 0 R |
+/BitsPerComponent 8 |
+>> |
+stream |
+ÿØÿî Adobe d ÿÛ |
+%% ## ((%%((22022;;;;;;;;;;ÿÀ L" |