Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Danger's Content

There have been 10 items by Danger (Search limited from 28-April 23)


By content type

See this member's

Sort by                Order  

#53108 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 10 October 2013 - 02:18 AM in Netduino 2 (and Netduino 1)

sgraves, you totally did it!  Thanks so much for posting this workaround.

 

It's totally weird that you have to pull something like this to get it to work right, but... after this many hours of trying stuff, I'll take it!

 

Thanks, again!




#52528 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 03 September 2013 - 05:13 PM in Netduino 2 (and Netduino 1)

Hahaha.  You mean an open source platform has other bugs, too?? :D

 

I do have a Netduino Mini sitting on my shelf that I was going to tackle once I got my feet wet with this, but... Maybe I need to hook up this barometer to the mini to isolate the problem being with the Netduino 2.  At least then I would know.

 

NooM, do you have or have you ever used a Netduino 2 or +2 with i2c?  I may end up getting another one, but I don't want to go through this again.  I mean, it does work, right?




#52520 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 03 September 2013 - 08:13 AM in Netduino 2 (and Netduino 1)

So, I put everything back the way it was, only updated the firmware to 4.2.2.2.  It actually behaves the same say.  All values report 0 until I disconnect and then reconnect the SDA pin while it's running.

 

So my last question still stands, I suppose.  Has anyone ever run into this problem?  Any thoughts on what might cause this?

I'm at a total loss, and almost ready to scrap this Netduino.  

 

Thanks in advance.




#52515 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 03 September 2013 - 05:15 AM in Netduino 2 (and Netduino 1)

Hahahahahaha.  WTF did I just do??   :blink:

 

Okay.  This sounds worse than it is.  I will try out 4.2.2.2 on my original development machine and report back.

 

Thanks!




#52510 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 02 September 2013 - 11:35 PM in Netduino 2 (and Netduino 1)

Okay, I have updated to Windows 7, NETMF 4.3, Visual Studio 2012 and the Netduino Firmware 4.3 Beta.  It didn't make a difference by itself, but then I stumbled upon something that makes no sense.  I'm hoping someone can explain this to me.

 

Using the code that NooM was nice enough to provide, Visual Studio spit out this in the output window upon the Netduino booting up:

 

06/01/2011 00:00:12: pressure: 0 altitude: 0.0 free mem: 81912
06/01/2011 00:00:14: pressure: 0 altitude: 0.0 free mem: 80280
06/01/2011 00:00:16: pressure: 0 altitude: 0.0 free mem: 80472
06/01/2011 00:00:19: pressure: 0 altitude: 0.0 free mem: 80628
 
If I disconnect the SDA pin while it's running, then reconnect it, I get this output:
06/01/2011 00:00:59: pressure: 96033 altitude: 450.2 free mem: 84624
06/01/2011 00:01:01: pressure: 96029 altitude: 450.6 free mem: 84624
06/01/2011 00:01:03: pressure: 96035 altitude: 450.0 free mem: 84396
06/01/2011 00:01:05: pressure: 96041 altitude: 449.5 free mem: 84396
06/01/2011 00:01:07: pressure: 96035 altitude: 450.0 free mem: 84624
06/01/2011 00:01:09: pressure: 96045 altitude: 449.2 free mem: 84624
06/01/2011 00:01:11: pressure: 96036 altitude: 449.9 free mem: 84396
06/01/2011 00:01:13: pressure: 96042 altitude: 449.4 free mem: 84624
 
Can anyone explain why I need to disconnect the SDA pin and then reconnect it in order to get values?
This works consistently, and I haven't been able to read values any other way.



#52500 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 02 September 2013 - 03:11 PM in Netduino 2 (and Netduino 1)

Man, I do not have Windows 7 installed, but I am totally following what you're saying.

Looks like I have some work to do before I can proceed.

 

You've pointed me in the right direction, NooM!  Thank you!




#52489 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 01 September 2013 - 06:14 AM in Netduino 2 (and Netduino 1)

Okay.  I am going to assume your code is good.  Still returning 0's for all values.

 

I did not include pull-ups, because I read this one the adafruit product site:

"The sensor is soldered onto a PCB with a 3.3V regulator, I2C level shifter and pull-up resistors on the I2C pins. "

 

Are you saying I still need to add them anyway?

I will try this regardless, but...  you think it may be a misprint?  That is, did you add them yourself?

 

Thanks, Noom!  




#52484 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 31 August 2013 - 06:39 AM in Netduino 2 (and Netduino 1)

I am starting to wonder if anyone has ever gotten the Netduino 2 and the BMP085 to work over i2c.  Seems to be a weird combination out there on the web.  Hmm.




#52480 Code Storage of Netduino 2

Posted by Danger on 30 August 2013 - 09:26 PM in Netduino 2 (and Netduino 1)

Hi hongnhattl, 

 

You would probably want to look into using the System.Reflection namespace to load your assemblies dynamically.  I have done this with Windows apps and web sites, but not with the NETMF.  I did, however, find an article from someone that has.  Looks promising.

 

Hope this helps.

http://fabienroyer.w...ith-a-netduino/

 

Danger




#52479 Netduino 2 and the Adafruit BMP085 Barometer (I2C)

Posted by Danger on 30 August 2013 - 06:01 PM in Netduino 2 (and Netduino 1)

Yes, I'm a noob.  Man, I'm glad I got that off my chest.   <_<

 

This is the first time I've attempted to hook up a sensor using I2C and I decided to start with this barometer from Adafruit.com: http://www.adafruit.com/products/391

 

Anyway (11 hours later), what I thought would be simple turned out to be not so simple.  Here is what I am facing.

 

I have:

- A Netduino 2 running Firmware 4.2.2.1

- A Barometric Pressure sensor from Adafruit (BMP085)  http://www.adafruit.com/products/391  (datasheet: http://www.adafruit....85-DS000-06.pdf)

- A headache

- And the following code:

 

            byte[] Addr = new byte[2];            Addr[0] = 0xF4;            Addr[1] = 0x34;            byte[] TxBuff = new byte[4];            byte[] RxBuff = new byte[4];            I2CDevice.Configuration I2C_Configuration = new I2CDevice.Configuration(0x77, 400);            I2CDevice I2C1 = new I2CDevice(I2C_Configuration);            I2CDevice.I2CTransaction[] WriteTran = new I2CDevice.I2CTransaction[]             {                I2CDevice.CreateWriteTransaction(Addr),                I2CDevice.CreateWriteTransaction(TxBuff)            };            I2CDevice.I2CTransaction[] ReadTran = new I2CDevice.I2CTransaction[]            {                I2CDevice.CreateWriteTransaction(Addr),                I2CDevice.CreateReadTransaction(RxBuff)            };            while (true)            {                                int iWriteCount = I2C1.Execute(WriteTran, 1000);                Debug.Print("Write Count: " + iWriteCount.ToString());                Thread.Sleep(200);                int iReadCount = I2C1.Execute(ReadTran, 1000);                Debug.Print("Read Count: " + iReadCount.ToString());                string ReadOut = new string(System.Text.Encoding.UTF8.GetChars(RxBuff));                Debug.Print("EEPROM CONTENT:" + ReadOut);                                Thread.Sleep(200);            }
 
This is one version of a routine of a whole bunch that I've tried, but all result in the same thing.  "0" gets returned from the "Execute()" method whether I try to read or write.  If I set the timeout value on the execute method to Timeout.Infinite, it will just hang there forever, which explains why I'm getting nothing back.  (because it's timing out after 1000ms)
 
The sample Arduino libraries write to the address "0x77" to talk to this chip.  Sparkfun puts out a breakout board just like this one, also using the BMP085 which also refers to 0x77.  Having said that, the data sheet (from the link above) talks about a "Device and register address" on page 17, which admittedly, I don't understand how it fits in to all of this or if I even need to worry about it.  They talk about addresses 0xEE and 0xEF for reading and writing?  I'm lost here.  Forgive me if this is a irrelevant/wasted paragraph.
 
Okay, so...  as far as pins go.  Here's what I did:
Sensor Pin VIn --> Netduino Pin 5V
Sensor Pin GND --> Netduino Pin GND
Sensor Pin SDA --> Netduino Pin SDA
Sensor Pin SCL --> Netduino Pin SCL
 
Seems logical, but did I mess this up?  Arduino has analog pins for I2C, right?  Netduino is not the same way, is it?  
 
Sorry for the rant.  Just trying to get it all out there.
 
If anyone can see any red flags or anything that doesn't look right, I am all ears.
 
Thanks so much!
 

 

 





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.