<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Working on BMP085 Pressure Sensor</title>
		<link>http://forums.leaflabs.com/topic.php?id=925</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:09:17 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=925" rel="self" type="application/rss+xml" />

		<item>
			<title>fugalster on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925&amp;page=2#post-7935</link>
			<pubDate>Sat, 28 Jan 2012 16:00:04 +0000</pubDate>
			<dc:creator>fugalster</dc:creator>
			<guid isPermaLink="false">7935@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;K, got the bmp085 working. There's an error in the Maple Native documentation: SDA and SCL are reversed for I2C channel 2 (haven't checked the other channel). Of course that doesn't matter for bitbanging, but it did serve to confuse me on which pin was doing what.&#60;/p&#62;
&#60;p&#62;I'm still having problems with an atMega as a slave. I have I2C working with an Arduino Uno as Master and an atMega as slave, but the same atMega won't respond to I2C commands from the Maple Native.&#60;/p&#62;
&#60;p&#62;Since this is no longer about the bmp085, I won't continue to fill up this thread. Go here for the continuation:&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1307#post-7934&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1307#post-7934&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fugalster on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-7931</link>
			<pubDate>Sat, 28 Jan 2012 14:24:12 +0000</pubDate>
			<dc:creator>fugalster</dc:creator>
			<guid isPermaLink="false">7931@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm trying to get I2C up an running on my Maple Native Beta. At first I wanted hardware implementation, but after struggling for quite some time I decided bitbanging would be fine. After struggling some more, I can't even get that working.&#60;/p&#62;
&#60;p&#62;I'm using the code above for my bmp085, I've changed&#60;/p&#62;
&#60;p&#62;&#60;code&#62;Wire.begin(9,5);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;p&#62;&#60;code&#62;Wire.begin(1,0);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;and&#60;/p&#62;
&#60;p&#62;&#60;code&#62;Wire.endTransmission();&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;int foo = Wire.endTrasmission();
Serial1.println(foo);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;When I run the code I get 2 returned from Wire.endTrasmission. I think that means the slave never acknowledged the address. I've tried similar things with other I2C devices and have always gotten a 2 returned.&#60;/p&#62;
&#60;p&#62;Any ideas?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Aeth on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-7818</link>
			<pubDate>Sat, 21 Jan 2012 02:55:42 +0000</pubDate>
			<dc:creator>Aeth</dc:creator>
			<guid isPermaLink="false">7818@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, sorry to bring up an old thread but I think there is a minor error in the code posted by pra.&#60;/p&#62;
&#60;p&#62;When calculating B3&#60;br /&#62;
x1 = (b2 * (b6 * b6)&#38;gt;&#38;gt;12)&#38;gt;&#38;gt;11   should instead be&#60;br /&#62;
x1 = (b2 * (b6 * b6 &#38;gt;&#38;gt; 12)) &#38;gt;&#38;gt; 11  &#60;/p&#62;
&#60;p&#62;It's a subtle difference but makes the pressure sensor give more reasonable values, closer to local met service values.  The changed line is also closer to the sample calculation on page 13 of the datasheet. The same problem is in the example sparkfun code too.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>smoothisfast on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-6099</link>
			<pubDate>Sat, 27 Aug 2011 19:55:17 +0000</pubDate>
			<dc:creator>smoothisfast</dc:creator>
			<guid isPermaLink="false">6099@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I figured it out, I had a pin in the wrong place. &#60;/p&#62;
&#60;p&#62;Code works well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>smoothisfast on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-6079</link>
			<pubDate>Thu, 25 Aug 2011 12:11:26 +0000</pubDate>
			<dc:creator>smoothisfast</dc:creator>
			<guid isPermaLink="false">6079@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;pra I'm trying to get my BMP085 to work. I tried pluging SDA in pin 9 and SCL in pin 5 and vice versa on my maple with no luck. I have the power and gnd in the right places.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pra on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5812</link>
			<pubDate>Sat, 30 Jul 2011 14:42:01 +0000</pubDate>
			<dc:creator>pra</dc:creator>
			<guid isPermaLink="false">5812@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;LuisXXVII - The following code works for me.  Mainly I changed int to int16, after including stdint.h.  Note I'm using pins 9 and 5 on wire.begin.  The Adafruit code that consists mainly of cpp library code also works once I adapted it to the Maple wire standard and changed Serial to SerialUSB etc.  If you want a copy of that, drop me an email (PeterRArcher@hotrmail.com).  By having both versions I can say with confidence they both produce the same data.&#60;/p&#62;
&#60;p&#62;/* BMP085 Extended Example Code&#60;br /&#62;
  by: Jim Lindblom&#60;br /&#62;
  SparkFun Electronics&#60;br /&#62;
  date: 1/18/11&#60;br /&#62;
  license: CC BY-SA v3.0 - &#60;a href=&#34;http://creativecommons.org/licenses/by-sa/3.0/&#34; rel=&#34;nofollow&#34;&#62;http://creativecommons.org/licenses/by-sa/3.0/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;  Get pressure and temperature from the BMP085 and calculate altitude.&#60;br /&#62;
  SerialUSB.print it out at 9600 baud to SerialUSB monitor.&#60;/p&#62;
&#60;p&#62;  Update (7/19/11): I've heard folks may be encountering issues&#60;br /&#62;
  with this code, who're running an Arduino at 8MHz. If you're&#60;br /&#62;
  using an Arduino Pro 3.3V/8MHz, or the like, you may need to&#60;br /&#62;
  increase some of the delays in the bmp085ReadUP and&#60;br /&#62;
  bmp085ReadUT functions.&#60;br /&#62;
*/&#60;/p&#62;
&#60;p&#62;#include &#38;lt;Wire.h&#38;gt;&#60;br /&#62;
#include &#38;lt;stdint.h&#38;gt;&#60;/p&#62;
&#60;p&#62;#define BMP085_ADDRESS 0x77  // I2C address of BMP085&#60;/p&#62;
&#60;p&#62;const unsigned char OSS = 0;  // Oversampling Setting&#60;/p&#62;
&#60;p&#62;// Calibration values&#60;br /&#62;
int16 ac1;&#60;br /&#62;
int16 ac2;&#60;br /&#62;
int16 ac3;&#60;br /&#62;
uint16 ac4;&#60;br /&#62;
uint16 ac5;&#60;br /&#62;
uint16 ac6;&#60;br /&#62;
int16 b1;&#60;br /&#62;
int16 b2;&#60;br /&#62;
int16 mb;&#60;br /&#62;
int16 mc;&#60;br /&#62;
int16 md;&#60;/p&#62;
&#60;p&#62;// b5 is calculated in bmp085GetTemperature(...), this variable is also used in bmp085GetPressure(...)&#60;br /&#62;
// so ...Temperature(...) must be called before ...Pressure(...).&#60;br /&#62;
long b5; &#60;/p&#62;
&#60;p&#62;short temperature;&#60;br /&#62;
long pressure;&#60;/p&#62;
&#60;p&#62;void setup()&#60;br /&#62;
{&#60;br /&#62;
//  SerialUSB.begin(9600);&#60;br /&#62;
  Wire.begin(9,5);&#60;br /&#62;
  bmp085Calibration();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void loop()&#60;br /&#62;
{&#60;br /&#62;
  temperature = bmp085GetTemperature(bmp085ReadUT());&#60;br /&#62;
  pressure = bmp085GetPressure(bmp085ReadUP());&#60;br /&#62;
  SerialUSB.print(&#34;Temperature: &#34;);&#60;br /&#62;
  SerialUSB.print(temperature, DEC);&#60;br /&#62;
  SerialUSB.println(&#34; *0.1 deg C&#34;);&#60;br /&#62;
  SerialUSB.print(&#34;Pressure: &#34;);&#60;br /&#62;
  SerialUSB.print(pressure, DEC);&#60;br /&#62;
  SerialUSB.println(&#34; Pa&#34;);&#60;br /&#62;
  SerialUSB.println();&#60;br /&#62;
  delay(1000);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Stores all of the bmp085's calibration values int16o global variables&#60;br /&#62;
// Calibration values are required to calculate temp and pressure&#60;br /&#62;
// This function should be called at the beginning of the program&#60;br /&#62;
void bmp085Calibration()&#60;br /&#62;
{&#60;br /&#62;
  ac1 = bmp085Readint(0xAA);&#60;br /&#62;
  ac2 = bmp085Readint(0xAC);&#60;br /&#62;
  ac3 = bmp085Readint(0xAE);&#60;br /&#62;
  ac4 = bmp085Readint(0xB0);&#60;br /&#62;
  ac5 = bmp085Readint(0xB2);&#60;br /&#62;
  ac6 = bmp085Readint(0xB4);&#60;br /&#62;
  b1 = bmp085Readint(0xB6);&#60;br /&#62;
  b2 = bmp085Readint(0xB8);&#60;br /&#62;
  mb = bmp085Readint(0xBA);&#60;br /&#62;
  mc = bmp085Readint(0xBC);&#60;br /&#62;
  md = bmp085Readint(0xBE);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Calculate temperature given ut.&#60;br /&#62;
// Value returned will be in units of 0.1 deg C&#60;br /&#62;
short bmp085GetTemperature(uint16 ut)&#60;br /&#62;
{&#60;br /&#62;
  long x1, x2;&#60;/p&#62;
&#60;p&#62;  x1 = (((long)ut - (long)ac6)*(long)ac5) &#38;gt;&#38;gt; 15;&#60;br /&#62;
  x2 = ((long)mc &#38;lt;&#38;lt; 11)/(x1 + md);&#60;br /&#62;
  b5 = x1 + x2;&#60;/p&#62;
&#60;p&#62;  return ((b5 + 8)&#38;gt;&#38;gt;4);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Calculate pressure given up&#60;br /&#62;
// calibration values must be known&#60;br /&#62;
// b5 is also required so bmp085GetTemperature(...) must be called first.&#60;br /&#62;
// Value returned will be pressure in units of Pa.&#60;br /&#62;
long bmp085GetPressure(unsigned long up)&#60;br /&#62;
{&#60;br /&#62;
  long x1, x2, x3, b3, b6, p;&#60;br /&#62;
  unsigned long b4, b7;&#60;/p&#62;
&#60;p&#62;  b6 = b5 - 4000;&#60;br /&#62;
  // Calculate B3&#60;br /&#62;
  x1 = (b2 * (b6 * b6)&#38;gt;&#38;gt;12)&#38;gt;&#38;gt;11;&#60;br /&#62;
  x2 = (ac2 * b6)&#38;gt;&#38;gt;11;&#60;br /&#62;
  x3 = x1 + x2;&#60;br /&#62;
  b3 = (((((long)ac1)*4 + x3)&#38;lt;&#38;lt;OSS) + 2)&#38;gt;&#38;gt;2;&#60;/p&#62;
&#60;p&#62;  // Calculate B4&#60;br /&#62;
  x1 = (ac3 * b6)&#38;gt;&#38;gt;13;&#60;br /&#62;
  x2 = (b1 * ((b6 * b6)&#38;gt;&#38;gt;12))&#38;gt;&#38;gt;16;&#60;br /&#62;
  x3 = ((x1 + x2) + 2)&#38;gt;&#38;gt;2;&#60;br /&#62;
  b4 = (ac4 * (unsigned long)(x3 + 32768))&#38;gt;&#38;gt;15;&#60;/p&#62;
&#60;p&#62;  b7 = ((unsigned long)(up - b3) * (50000&#38;gt;&#38;gt;OSS));&#60;br /&#62;
  if (b7 &#38;lt; 0x80000000)&#60;br /&#62;
    p = (b7&#38;lt;&#38;lt;1)/b4;&#60;br /&#62;
  else&#60;br /&#62;
    p = (b7/b4)&#38;lt;&#38;lt;1;&#60;/p&#62;
&#60;p&#62;  x1 = (p&#38;gt;&#38;gt;8) * (p&#38;gt;&#38;gt;8);&#60;br /&#62;
  x1 = (x1 * 3038)&#38;gt;&#38;gt;16;&#60;br /&#62;
  x2 = (-7357 * p)&#38;gt;&#38;gt;16;&#60;br /&#62;
  p += (x1 + x2 + 3791)&#38;gt;&#38;gt;4;&#60;/p&#62;
&#60;p&#62;  return p;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Read 1 byte from the BMP085 at 'address'&#60;br /&#62;
char bmp085Read(unsigned char address)&#60;br /&#62;
{&#60;br /&#62;
  unsigned char data;&#60;/p&#62;
&#60;p&#62;  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(address);&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  Wire.requestFrom(BMP085_ADDRESS, 1);&#60;br /&#62;
  while(!Wire.available())&#60;br /&#62;
    ;&#60;/p&#62;
&#60;p&#62;  return Wire.receive();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Read 2 bytes from the BMP085&#60;br /&#62;
// First byte will be from 'address'&#60;br /&#62;
// Second byte will be from 'address'+1&#60;br /&#62;
int16 bmp085Readint(unsigned char address)&#60;br /&#62;
{&#60;br /&#62;
  unsigned char msb, lsb;&#60;/p&#62;
&#60;p&#62;  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(address);&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  Wire.requestFrom(BMP085_ADDRESS, 2);&#60;br /&#62;
  while(Wire.available()&#38;lt;2)&#60;br /&#62;
    ;&#60;br /&#62;
  msb = Wire.receive();&#60;br /&#62;
  lsb = Wire.receive();&#60;/p&#62;
&#60;p&#62;  return (int16) msb&#38;lt;&#38;lt;8 &#124; lsb;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Read the uncompensated temperature value&#60;br /&#62;
uint16 bmp085ReadUT()&#60;br /&#62;
{&#60;br /&#62;
  uint16 ut;&#60;/p&#62;
&#60;p&#62;  // Write 0x2E int16o Register 0xF4&#60;br /&#62;
  // This requests a temperature reading&#60;br /&#62;
  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF4);&#60;br /&#62;
  Wire.send(0x2E);&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  // Wait at least 4.5ms&#60;br /&#62;
  delay(5);&#60;/p&#62;
&#60;p&#62;  // Read two bytes from registers 0xF6 and 0xF7&#60;br /&#62;
  ut = bmp085Readint(0xF6);&#60;br /&#62;
  return ut;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// Read the uncompensated pressure value&#60;br /&#62;
unsigned long bmp085ReadUP()&#60;br /&#62;
{&#60;br /&#62;
  unsigned char msb, lsb, xlsb;&#60;br /&#62;
  unsigned long up = 0;&#60;/p&#62;
&#60;p&#62;  // Write 0x34+(OSS&#38;lt;&#38;lt;6) int16o register 0xF4&#60;br /&#62;
  // Request a pressure reading w/ oversampling setting&#60;br /&#62;
  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF4);&#60;br /&#62;
  Wire.send(0x34 + (OSS&#38;lt;&#38;lt;6));&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  // Wait for conversion, delay time dependent on OSS&#60;br /&#62;
  delay(2 + (3&#38;lt;&#38;lt;OSS));&#60;/p&#62;
&#60;p&#62;  // Read register 0xF6 (MSB), 0xF7 (LSB), and 0xF8 (XLSB)&#60;br /&#62;
  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF6);&#60;br /&#62;
  Wire.endTransmission();&#60;br /&#62;
  Wire.requestFrom(BMP085_ADDRESS, 3);&#60;/p&#62;
&#60;p&#62;  // Wait for data to become available&#60;br /&#62;
  while(Wire.available() &#38;lt; 3)&#60;br /&#62;
    ;&#60;br /&#62;
  msb = Wire.receive();&#60;br /&#62;
  lsb = Wire.receive();&#60;br /&#62;
  xlsb = Wire.receive();&#60;/p&#62;
&#60;p&#62;  up = (((unsigned long) msb &#38;lt;&#38;lt; 16) &#124; ((unsigned long) lsb &#38;lt;&#38;lt; 8) &#124; (unsigned long) xlsb) &#38;gt;&#38;gt; (8-OSS);&#60;/p&#62;
&#60;p&#62;  return up;&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5741</link>
			<pubDate>Mon, 25 Jul 2011 11:55:28 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5741@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;perhaps try writing a simple test sketch to make sure the interface to your BMP085 chip is working properly, without worrying about all the conversion math and various program functions. &#60;/p&#62;
&#60;p&#62;Reduce your program to a simple read of one of the registers. For example register 0x2e will give you just the temperature. Try reading that register over and over and just printing it. &#60;/p&#62;
&#60;p&#62;Ostensibly, your finger should heat the chip enough to get understandable readings from the device (the number goes up and down...). Now that you know the com is good and the sensor is working, then go to work on converting all your numbers. I cant see it off the top of my head, but my guess is that your conversion from I2C reads to actual temperature is breaking somewhere because of the 32 versus 16 bit environments.&#60;/p&#62;
&#60;p&#62;For example of how being on a 32 bit system like maple change your conversion math consider this:&#60;/p&#62;
&#60;p&#62;on arduino:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;unsigned int x = 0xFFFF; // x is 16 bits and is equal to 65535 (the max)
x = x &#38;lt;&#38;lt; 4; // The first &#38;quot;F&#38;quot; get pushed on the floor since we were already at the max
Serial.print(x,HEX);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The result should be &#34;0xFFF0&#34; (3 Fs)&#60;/p&#62;
&#60;p&#62;where as on Maple, which is a 32 bit platform:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;unsigned int x = 0xFFFF; // x is 32 bits and equal to 65535
x = x &#38;lt;&#38;lt; 4; // we DONT overflow the number, just shift left by 4
SerialUSB.print(x,HEX);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The result should be &#34;0xFFFF0&#34; (4 Fs), note its different from before
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pra on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5739</link>
			<pubDate>Mon, 25 Jul 2011 11:06:55 +0000</pubDate>
			<dc:creator>pra</dc:creator>
			<guid isPermaLink="false">5739@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Yes, Adafruit cautions you to make sure this is the only device on the wire.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5736</link>
			<pubDate>Mon, 25 Jul 2011 09:30:02 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">5736@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The problem with the Arduino Wire library, is it also enables some 5V pull ups.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pra on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5734</link>
			<pubDate>Sun, 24 Jul 2011 22:13:40 +0000</pubDate>
			<dc:creator>pra</dc:creator>
			<guid isPermaLink="false">5734@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I just noticed that Adafruit is also selling this device, and they explain why its OK to run with a 5V Arduino (device uses pull-ups to V3.3 VCC supply and only ground is driven on the SDA, SCL lines.  It might be worth looking it up, the tutorial looks significantly different to the SparkFun howto, so maybe the sample code is as well??.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5732</link>
			<pubDate>Sun, 24 Jul 2011 15:11:06 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5732@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;perhaps try writing a simple test sketch to make sure the interface to your BMP085 chip is working properly, without worrying about all the conversion math and various program functions. &#60;/p&#62;
&#60;p&#62;Reduce your program to a simple read of one of the registers. For example register 0x2e will give you just the temperature. Try reading that register over and over and just printing it. &#60;/p&#62;
&#60;p&#62;Ostensibly, your finger should heat the chip enough to get understandable readings from the device (the number goes up and down...). Now that you know the com is good and the sensor is working, then go to work on converting all your numbers. I cant see it off the top of my head, but my guess is that your conversion from I2C reads to actual temperature is breaking somewhere because of the 32 versus 16 bit environments.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>LuisXXVII on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5729</link>
			<pubDate>Sun, 24 Jul 2011 11:20:58 +0000</pubDate>
			<dc:creator>LuisXXVII</dc:creator>
			<guid isPermaLink="false">5729@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey Pra! Thanks again.&#60;/p&#62;
&#60;p&#62;Well, yes, in the serial monitor of maple everything appears as expected, except the numbers of the pressure and temperature, for example temperature only appears as 117 or 119 °C and the pressure looks pretty big. Yes I know that issue about the Voltage levels from the SDA and SCL of Arduino, but everything appears to work fine, lots of trials in arduino without problems, but when changing to maple not the same beauty! :), I've tried to add some delays to let the registers from de BMP085 catch the info but something still wrong.Let me check the prints you propose and let you know if i get something new.&#60;/p&#62;
&#60;p&#62;Tahank you and stay in touch.&#60;/p&#62;
&#60;p&#62;Best
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pra on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5723</link>
			<pubDate>Sat, 23 Jul 2011 19:46:38 +0000</pubDate>
			<dc:creator>pra</dc:creator>
			<guid isPermaLink="false">5723@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Looks straightforward enough.  Do you get prints on the serial monitor, or is the program hanging on statements such as &#34;while(Wire.available() &#38;lt; 3); which it might if the Wire.send didn't take properly.  If you can't tell, try putting SerialUSB prints in at strategic places to see where it might be hanging.&#60;/p&#62;
&#60;p&#62;If you've been running this on an Arduino, you have been running a 3.3V part with 5V SDA  and SCL levels.  I guess if it still works on the Arduino its still functions OK.&#60;/p&#62;
&#60;p&#62;I've never tried the wire interface on the Maple.  Others that have may want to chime in.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>LuisXXVII on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5722</link>
			<pubDate>Sat, 23 Jul 2011 18:36:09 +0000</pubDate>
			<dc:creator>LuisXXVII</dc:creator>
			<guid isPermaLink="false">5722@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey! Thank you!&#60;/p&#62;
&#60;p&#62;Well, I don't now specifically what is the problem with the maple code but I'm using the Wire.h library, the same code as the in the Arduino environment, The code in maple compiles fine but when opening the serial monitor, I don't get the same results as in Arduino, the code used in the maple is:&#60;/p&#62;
&#60;p&#62;#include &#38;lt;Wire.h&#38;gt;&#60;/p&#62;
&#60;p&#62;#define BMP085_ADDRESS 0x77 //I2C  Address of BMPP085&#60;/p&#62;
&#60;p&#62;const unsigned char OSS = 0; //Oversampling Config&#60;br /&#62;
const double p0 = 101325; //Sea level ATM PRess&#60;br /&#62;
double altitude;&#60;br /&#62;
const double currentAltitude = 2250; //Home Altitude&#60;br /&#62;
const double ePressure = p0*pow((1-currentAltitude/44330), 5.255);&#60;br /&#62;
double weatherDiff;&#60;/p&#62;
&#60;p&#62;//Calib Val&#60;br /&#62;
int ac1;&#60;br /&#62;
int ac2;&#60;br /&#62;
int ac3;&#60;br /&#62;
unsigned int ac4;&#60;br /&#62;
unsigned int ac5;&#60;br /&#62;
unsigned int ac6;&#60;br /&#62;
int b1;&#60;br /&#62;
int b2;&#60;br /&#62;
int mb;&#60;br /&#62;
int mc;&#60;br /&#62;
int md;&#60;br /&#62;
long b5;&#60;br /&#62;
short temperature;&#60;br /&#62;
long pressure;&#60;/p&#62;
&#60;p&#62;void setup(){&#60;br /&#62;
  Wire.begin(30,29);&#60;br /&#62;
  bmp085Calibration();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void loop(){&#60;br /&#62;
  temperature = bmp085GetTemperature(bmp085ReadUT());&#60;br /&#62;
  pressure = bmp085GetPressure(bmp085ReadUP());&#60;br /&#62;
  altitude = (double)44330 * (1-pow(((double)pressure/p0), 0.190295));&#60;br /&#62;
  weatherDiff = pressure - ePressure;&#60;br /&#62;
  SerialUSB.print(&#34;Altitud: &#34;);&#60;br /&#62;
  SerialUSB.print(altitude);&#60;br /&#62;
  SerialUSB.println(&#34; [m]&#34;);&#60;br /&#62;
  SerialUSB.print(&#34;Temperatura: &#34;);&#60;br /&#62;
  SerialUSB.print((float)temperature*0.1);&#60;br /&#62;
  SerialUSB.println(&#34; [C]&#34;);&#60;br /&#62;
  SerialUSB.print(&#34;Presion ATM: &#34;);&#60;br /&#62;
  SerialUSB.print(pressure);&#60;br /&#62;
  SerialUSB.println(&#34; [Pa]&#34;);&#60;br /&#62;
  SerialUSB.println();&#60;br /&#62;
  delay(500);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void bmp085Calibration(){&#60;br /&#62;
  ac1 = bmp085ReadInt(0xAA);&#60;br /&#62;
  ac2 = bmp085ReadInt(0xAC);&#60;br /&#62;
  ac3 = bmp085ReadInt(0xAE);&#60;br /&#62;
  ac4 = bmp085ReadInt(0xB0);&#60;br /&#62;
  ac5 = bmp085ReadInt(0xB2);&#60;br /&#62;
  ac6 = bmp085ReadInt(0xB4);&#60;br /&#62;
  b1 = bmp085ReadInt(0xB6);&#60;br /&#62;
  b2 = bmp085ReadInt(0xB8);&#60;br /&#62;
  mb = bmp085ReadInt(0xBA);&#60;br /&#62;
  mc = bmp085ReadInt(0xBC);&#60;br /&#62;
  md = bmp085ReadInt(0xBE);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//*****************************************//&#60;/p&#62;
&#60;p&#62;int bmp085ReadInt(unsigned char address){&#60;br /&#62;
  unsigned char msb, lsb;&#60;/p&#62;
&#60;p&#62;  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(address);&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  Wire.requestFrom(BMP085_ADDRESS, 2);&#60;br /&#62;
  while(Wire.available()&#38;lt;2)&#60;br /&#62;
  ;&#60;br /&#62;
  msb=Wire.receive();&#60;br /&#62;
  lsb=Wire.receive();&#60;/p&#62;
&#60;p&#62;  return (int) msb&#38;lt;&#38;lt;8 &#124; lsb;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//*****************************************//&#60;/p&#62;
&#60;p&#62;unsigned int bmp085ReadUT(){&#60;br /&#62;
  unsigned int ut;&#60;br /&#62;
  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF4);&#60;br /&#62;
  Wire.send(0x2E);&#60;br /&#62;
  Wire.endTransmission();&#60;br /&#62;
  delay(25);&#60;br /&#62;
  ut=bmp085ReadInt(0xF6);&#60;br /&#62;
  return ut;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//*****************************************//&#60;/p&#62;
&#60;p&#62;short bmp085GetTemperature(unsigned int ut){&#60;br /&#62;
  long x1, x2;&#60;/p&#62;
&#60;p&#62;  x1 = (((long)ut - (long)ac6)*(long)ac5) &#38;gt;&#38;gt; 15;&#60;br /&#62;
  x2 = ((long)mc &#38;lt;&#38;lt; 11)/(x1 + md);&#60;br /&#62;
  b5 = x1 + x2;&#60;/p&#62;
&#60;p&#62;  return ((b5 + 8)&#38;gt;&#38;gt;4);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//*****************************************//&#60;/p&#62;
&#60;p&#62;unsigned long bmp085ReadUP()&#60;br /&#62;
{&#60;br /&#62;
  unsigned char msb, lsb, xlsb;&#60;br /&#62;
  unsigned long up = 0;&#60;/p&#62;
&#60;p&#62;  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF4);&#60;br /&#62;
  Wire.send(0x34 + (OSS&#38;lt;&#38;lt;6));&#60;br /&#62;
  Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;  delay((2 + (3&#38;lt;&#38;lt;OSS))*4.5);&#60;/p&#62;
&#60;p&#62;  Wire.beginTransmission(BMP085_ADDRESS);&#60;br /&#62;
  Wire.send(0xF6);&#60;br /&#62;
  Wire.endTransmission();&#60;br /&#62;
  Wire.requestFrom(BMP085_ADDRESS, 3);&#60;br /&#62;
  while(Wire.available() &#38;lt; 3)&#60;br /&#62;
  ;&#60;br /&#62;
  msb = Wire.receive();&#60;br /&#62;
  lsb = Wire.receive();&#60;br /&#62;
  xlsb = Wire.receive();&#60;/p&#62;
&#60;p&#62;  up = (((unsigned long) msb &#38;lt;&#38;lt; 16) &#124; ((unsigned long) lsb &#38;lt;&#38;lt; 8) &#124; (unsigned long) xlsb) &#38;gt;&#38;gt; (8-OSS);&#60;/p&#62;
&#60;p&#62;  return up;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//*****************************************//&#60;/p&#62;
&#60;p&#62;long bmp085GetPressure(unsigned long up)&#60;br /&#62;
{&#60;br /&#62;
  long x1, x2, x3, b3, b6, p;&#60;br /&#62;
  unsigned long b4, b7;&#60;/p&#62;
&#60;p&#62;  b6 = b5 - 4000;&#60;br /&#62;
  x1 = (b2 * (b6 * b6)&#38;gt;&#38;gt;12)&#38;gt;&#38;gt;11;&#60;br /&#62;
  x2 = (ac2 * b6)&#38;gt;&#38;gt;11;&#60;br /&#62;
  x3 = x1 + x2;&#60;br /&#62;
  b3 = (((((long)ac1)*4 + x3)&#38;lt;&#38;lt;OSS) + 2)&#38;gt;&#38;gt;2;&#60;br /&#62;
  x1 = (ac3 * b6)&#38;gt;&#38;gt;13;&#60;br /&#62;
  x2 = (b1 * ((b6 * b6)&#38;gt;&#38;gt;12))&#38;gt;&#38;gt;16;&#60;br /&#62;
  x3 = ((x1 + x2) + 2)&#38;gt;&#38;gt;2;&#60;br /&#62;
  b4 = (ac4 * (unsigned long)(x3 + 32768))&#38;gt;&#38;gt;15;&#60;br /&#62;
  b7 = ((unsigned long)(up - b3) * (50000&#38;gt;&#38;gt;OSS));&#60;/p&#62;
&#60;p&#62;  if (b7 &#38;lt; 0x80000000)&#60;br /&#62;
    p = (b7&#38;lt;&#38;lt;1)/b4;&#60;br /&#62;
  else&#60;br /&#62;
    p = (b7/b4)&#38;lt;&#38;lt;1;&#60;/p&#62;
&#60;p&#62;  x1 = (p&#38;gt;&#38;gt;8) * (p&#38;gt;&#38;gt;8);&#60;br /&#62;
  x1 = (x1 * 3038)&#38;gt;&#38;gt;16;&#60;br /&#62;
  x2 = (-7357 * p)&#38;gt;&#38;gt;16;&#60;br /&#62;
  p += (x1 + x2 + 3791)&#38;gt;&#38;gt;4;&#60;/p&#62;
&#60;p&#62;  return p;&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pra on "Working on BMP085 Pressure Sensor"</title>
			<link>http://forums.leaflabs.com/topic.php?id=925#post-5721</link>
			<pubDate>Sat, 23 Jul 2011 18:15:05 +0000</pubDate>
			<dc:creator>pra</dc:creator>
			<guid isPermaLink="false">5721@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Could you elaborate a bit more on the problem.  It seems a straight forward I2C interface with the delay of 5 milliseconds waiting for conversion to occur, and delay() doesn't vary between the processors.  What isn't working, the I2C interface, the data you are getting back, nothing back ???
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
