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.
Photo

What's the status of Onewire?


  • Please log in to reply
15 replies to this topic

#1 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 29 November 2010 - 11:23 PM

Hello! I ordered some DS18B20 temperature sensors, before I realized I had no idea how to interface them with the netduino -- what's the status of onewire? What do i need to do to support onewire and interface with the DS18B20? Thanks!

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 November 2010 - 12:20 AM

Hi bill, CW2 has been working on a OneWire driver, and we're hoping to incorporate support into an upcoming firmware release. Today, you could use an external OneWire support chip (via SPI/I2C/UART)... Chris

#3 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 30 November 2010 - 01:20 AM

Any suggestions on a chip? I'm having trouble finding anything. Closest I could find was this: DS2480B but DIP would be much easier for me. Thanks!

#4 segu

segu

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationLima - Peru

Posted 01 December 2010 - 11:07 PM

Hi I pass you my "investigation" (at least my findings until now :) ) (Also waiting SecretLabs 1Wire :P ) http://www.embeddedd...r-SIP_p_23.html http://eds.supportce...ure-sensor.html It receives "ASCII commands" via RS232 that traslate to 1Wire "jargon pulses" and receive the answer from the 1Wire device and then translate to ASCII characters that are sent out via RS232. So, you write ASCII in a terminal (ugly Hyper Terminal, TeraTerm, Bray Terminal, etc) and receive ASCII characters with the data demanded. (I am here) No reason why you can not send ASCII via TxRx with Netduino and process the result, I think ;) Hope helped you (and understood me) Regards :)

#5 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 02 December 2010 - 01:48 AM

Thank you, that is very good information, and I understand you perfectly. I ordered one of these: http://www.phanderso...mp/onewire.html It seems similar to your suggestions. I will let you know how it goes!

#6 segu

segu

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationLima - Peru

Posted 02 December 2010 - 07:46 PM

I will let you know how it goes!


Ok, when ready post your solution, so the community can have a way to 1Wire :)

I looked Prof Anderson site, but the shipping & handling to here is $200!!! :( (Can you believe that?)
Also it is "limited" to 6 devices and needs one wire for each one. A little tricky if you have multiple sensors. BUT it is a VERY GOOD solution.

Regards

#7 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 02 December 2010 - 08:12 PM

No reason why you can not send ASCII via TxRx with Netduino and process the result

Actually, it should be possible for Netduino to communicate with 1-Wire device directly over the serial port - you'd just need a few components (two transistors and three resistors) to wire Rx and Tx together as an open-drain line. For more details, the schematic and code that can be easily ported to C# please have a look at Atmel application note AVR318: Dallas 1-Wire® master (pdf). It's been on my to-do list for a while...

#8 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 02 December 2010 - 08:18 PM

My chips should come today, my sensor is due tomorrow, so i should have some news soon. I bet if you email him directly and ask him to just mail them, it should be much cheaper... otherwise, I can mail you one of mine once I get it going.

#9 segu

segu

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationLima - Peru

Posted 05 December 2010 - 04:16 AM

My chips should come today, my sensor is due tomorrow, so i should have some news soon.

I bet if you email him directly and ask him to just mail them, it should be much cheaper... otherwise, I can mail you one of mine once I get it going.


Hi Bill, I apologize for the delay, but I was I am and I will be busy next 2 weeks and thank you for the ideas.
I know Prof Anderson site for some time now. I think he wants not to send to LatinAmerica (maybe some trouble in the past) so the high charges (so pay premier courrier with all the insurances, etc.)
Maybe I can accept your offer if I can send you money via PayPal. I did this a few times, but the other person must know and agree. Anyway your offer is very much preciated :)

Hector

#10 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 10 December 2010 - 03:17 AM

Got it working! http://forums.netdui...-using-onewire/

#11 MattEric

MattEric

    New Member

  • Members
  • Pip
  • 7 posts

Posted 14 December 2010 - 02:58 AM

Very newbie here. I've got some DS18B20's that i plan to hook up to a Netduino as soon as i can get a Netduino. I've got them working successfully on an Arduino board using the Dallas Temp Control library (for Arduino) (http://milesburton.c...Control_Library) and Jim Studts's one-wire library (for Arduino) (http://homepage.mac....leSharing7.html). Wouldn't the most straightforward way to go be to port these two libraries of C++ open-source to C#? Or was that already suggested?

#12 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 14 December 2010 - 01:02 PM

It is difficult/impossible to get the precise timing needed for onewire running in managed c# code. Someone wrote a low level onewire driver, but it's not integrated into the netduino firmware yet, and since I'm not ready to compile my own firmware, I needed another solution. Some might look at this as some sort of disadvantage of the netduino, but I think it illustrates the power of the device, since I have been able to create and debug my "business logic" and "network logic" very easily in c# on the netduino, with the precise timing stuff offloaded to dedicated devices. This is a paradigm that works well for me.

#13 MattEric

MattEric

    New Member

  • Members
  • Pip
  • 7 posts

Posted 14 December 2010 - 11:19 PM

Thanks for the explanation. i see past posts explained this as well. Certainly distributed processing has advantages. i'll continue to read past posts and MS micro framework documentation. Any suggestions on where to find explanations of how C# managed code is executed by Netduino is appreciated.

#14 segu

segu

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationLima - Peru

Posted 15 December 2010 - 12:47 AM

Got it working! http://forums.netdui...-using-onewire/

Hi
Again sorry for the delay. Almost a week I do not read the forum. Thank you for posting your code. For sure I will try your "method/way" with my device. At the end it is the "same" device only different syntax, change the content of the strings.

Thank you :) :)

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 December 2010 - 01:35 AM

Thanks for the explanation. i see past posts explained this as well. Certainly distributed processing has advantages. i'll continue to read past posts and MS micro framework documentation. Any suggestions on where to find explanations of how C# managed code is executed by Netduino is appreciated.


Hi MattEric,

Visual Studio's C# compiler compiles the C# code into MSIL. Then it uses "MetaDataProcessor" to compress the standard .NET assemblies to fit well on the Netduino. Finally, it deploys the compressed assemblies to the Netduino.

The .NET Micro Framework on the Netduino parses the compressed MSIL and interprets it. It manages threading, application domains, events, etc. Managed code can call down to native code, etc.

Is that a good overview?

Chris

#16 Edward

Edward

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon, UK

Posted 17 March 2011 - 11:44 PM

I'm having success using the DS2482-100 I2C 1-Wire master. Successfully talking to 4 temperature sensors and an RTC. It was very straightforward. Will post some code in showcase once it's tidied up.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.