1-Wire Slave

There have been a few brief discussions of a 1-Wire slave library. I'd like to revisit the idea. Some topics to get us started...

  1. 1-Wire slave should be available for which processors / boards?

  2. Is there any reason to support 1 MHz processor speed?

  3. Is it possible for an AVR processor to run from "parasitic power"?

  4. Do you think you would have any use for a 1-Wire slave library?

Quick answers

  1. 1-Wire slave should be available for which processors / boards?
  • keep it as portable as possible, use "timing tables" like in NewSoftSerial.
  1. Is there any reason to support 1 MHz processor speed?
  • maybe low energy mode?
  1. Is it possible for an AVR processor to run from "parasitic power"?
  • don't know; but it could look from the outside as if it was (mimicing)
  1. Do you think you would have any use for a 1-Wire slave library?
  • Yes if I could simulate 1 Wire devices with it. I needed a simulator for a few DS18B20's a few months ago so I could test various temperature levels (solved otherwise)
  • 1-wire devices have an unique ID, which is useful for identifying a specific board.

2 cents,
Rob

As posted by robtillaart, it should be portable. If you have to choose a board to start with, Uno.

I wouldn't use it but I guess it might be interesting to some people.

I don't know if it is possible but it would be useful. Having said that I wouldn't list it as a top priority.

Yes.

Follow-up...

  1. Is there any reason to support 1 MHz processor speed? Yes but it is not possible. Atmel claims 2.17 MHz is the minimum. I have not done the math but I believe that number is based on no other interrupts occurring (no millis, no Serial).

  2. Are you willing to give up one PWM pin for a 1-Wire slave library?

  3. Is there any reason to support multiple 1-Wire devices from a single processor?

  4. How do you plan to generate serial numbers?

[quote author=Coding Badly link=topic=65706.msg481145#msg481145 date=1309853409]
There have been a few brief discussions of a 1-Wire slave library. I'd like to revisit the idea. Some topics to get us started...

  1. 1-Wire slave should be available for which processors / boards? [/quote]
    Awesome. I found this googling "AVR one wire slave". +1 on a 1-Wiire slave lib.
    My list: Same as your core list (ATTiny45/85, ATTiny2313/4313). My main issue is network comms with low pin count devices. I'm using TWI/I2C but at present I have to give up /RESET pin to use as I/O, but need to recover its use. 1 wire would be perfect, half duplex master/slave is fine and it would drop me from 4 wire to 3 wire connection which would be great. Board would be DIY as shown in your Arduino Tiny thread.
  1. Is there any reason to support 1 MHz processor speed?

Not for my applications, using 8 MHz internal or 16 MHz external.

  1. Is it possible for an AVR processor to run from "parasitic power"?

This would be cool, but not essential for my present app as I need sufficient local power to run other things anyway. May be cool for networked low power sensor apps.

  1. Do you think you would have any use for a 1-Wire slave library?

Definitely. I hope this moves forward, I think the need is there and it would compliment your work on Arduino Tiny core.

  1. Are you willing to give up one PWM pin for a 1-Wire slave library?

Yes.

  1. Is there any reason to support multiple 1-Wire devices from a single processor?

Yes, networking of multiple addressable slaves on a bus. If you mean multiple addresseable slaves on a single processor, I do not have a need at present.

  1. How do you plan to generate serial numbers?

Ideally over the 1-wire bus, else program in.

  1. Are you willing to give up one PWM pin for a 1-Wire slave library?

Yes

  1. Is there any reason to support multiple 1-Wire devices from a single processor?

I guess you mean have multiple "vitual" 1-wire devices on the same slave board. E.g. slave_device_1 and slave_device_2 on the same board connected to another board/unit that operates as a master.

It would be interesting to simulate multiple temperature sensors without using one CPU each. It would also be nice read two analog signals and make them availabe as two separate devices on the 1-wire bus even if they are on same board.

Overall, a great idea but not a high priority one.

  1. Are you willing to give up one PWM pin for a 1-Wire slave library?

yes,

  1. Is there any reason to support multiple 1-Wire devices from a single processor?

agree 5Volt's reply;

  • mapping of multiple sensors, DS18B20, or other
  • mapping of multiple 1-wire EEPROM
  • mapping of SPI devices on 1-wire
  • mapping 6 Analog lines on six 1-wire devices
  • mix of devices above
  1. How do you plan to generate serial numbers?

maybe use a UUID?? => - UUID (GUID) Generator on the WEB - as base to derive the serial number from.

Q: is 1-wire patented?

  1. How do you plan to generate serial numbers?

Ideally over the 1-wire bus, else program in.

I don't understand. Please clarify.

  1. Is there any reason to support 1 MHz processor speed?

Not for my applications, using 8 MHz internal or 16 MHz external.

Tuned 8 MHz internal oscillator?

  1. Is there any reason to support multiple 1-Wire devices from a single processor?

I guess you mean have multiple "vitual" 1-wire devices on the same slave board. E.g. slave_device_1 and slave_device_2 on the same board connected to another board/unit that operates as a master.

Exactly. Multiple "virtual" devices.

maybe use a UUID?? => - UUID (GUID) Generator on the WEB - as base to derive the serial number from.

Hmm. Interesting choice. Thanks.

Q: is 1-wire patented?

Impossible to tell from the internet what the legal ramifications are.

This is a common rumor (which has apparently been publicly refuted by a Dallas Semiconductor representative)...
http://www.buoy.com/pipermail/1-wire-software-development/2004-November/000163.html

This fellow claims the patent is indefensible due to prior art but he does not address at least one specific claim in the patent...
http://www.imagerzone.com/ForumsPro/viewtopic/t=4458/view=next.html

This is the most reference information I could find...
http://dics.voicecontrol.ro/process_mails/arata_discutia/129197/Implementing_1-wire_slaves.html

At least 1-Wire device was on the market (Apr 1, 1998) more than a year before the patent filing date (Jul 22, 1999). That alone should have prevented the patent office from granting the patent.

The PIC folks don't seem to be too concerned...
http://www.microchip.com/forums/tm.aspx?high=&m=454169&mpage=1#454678

This is claimed to be an official statement from Dallas Semiconductor...
http://www.1wire.org/index.html?target=p_142.html&lang=en-us

There are several companies selling 1-Wire slave devices that don't seem to have any association with Dallas Semiconductor.

What I do know is that each of us can do whatever we want so long as it is only for "personal use".

Not fully formed as an idea, but I was thinking along the lines of a base S/N that would be recognized as unprogrammed. The master could then query slave, recognize the base number as a new node on the network, and assign it a new S/N. I imagine this functionality could be accomplished a number of other ways, so not a hard requirement in my mind.

Not fully formed as an idea, but I was thinking along the lines of a base S/N that would be recognized as unprogrammed. The master could then query slave, recognize the base number as a new node on the network, and assign it a new S/N. I imagine this functionality could be accomplished a number of other ways, so not a hard requirement in my mind.

Think there is a bootstrap problem in this. How can the server acces the client without address. eg there are 2 or more devices without S/N which one to address.

The solution could be a "voting market". Imagine an unproggrammed(UP) client device just calls on the bus "is there any nr 12, if so let him speak or silence forever"?
if another device has nr 12 it responds, and the UP device tries another/next number.
if no device responds the device can use nr 12.

If multiple devices call on the bus, the numbers passing by will not be used (skipped) except by the original sender, so if one shouts "12?" the next UPdevice shouts "13?" etc.
To prevent devices shout at the same time a random interval is used between shouts.

@MGeo: Reply #9 was a question for you...

At 16 MHz, the worst case time in the millis interrupt service routine is 7.3125 microseconds. Because of the latency the millis ISR can introduce, occasionally a write-one will start past the end of the write synchronization pulse (6 microseconds) but the write-one should still start before the sample point (15 microseconds). Which raises a few more questions...

  1. What do you plan to turn into a 1-Wire slave device? (e.g. I want to make a servo controllable through 1-Wire)

  2. Which libraries do you intend to use?

  3. Do you plan to make use of any interrupts?

  4. On your slave device, would crippling millis / micros cause problems? Consider this question carefully. There are potentially hidden implications (like delay not working).

  5. In your 1-Wire master code, do you read and verify the CRC? Do you discard responses with an invalid CRC?

Sorry, missed that. Yes tuned RC if needed.

  1. I am trying to use a 1-Wire slave lib to communicate with actautors and sensors over a 3 wire bus (power, gnd, signal).
  2. I do not have that fully developed, but an I2C master lib running on a 1 wire slave will be needed to talk to I2C sensors so I can get them on the 1-wire bus. I think the actuators and sensors will in general make minimal use of libraries, but rather serve as a flexible way to add them to an arduino based master that would add higher level functionality.
  3. I general yes, for timing on servo loops and sensor interfaces.
  4. Not a problem, it is an expected concession. I can handle delays direct.
  5. Yes, I plan to.

Thanks for your consideration.
George

This is very interesting to me...

I'm looking to replace the obsolete 1-wire counter.

MGeo:
9. I do not have that fully developed, but an I2C master lib running on a 1 wire slave will be needed to talk to I2C sensors so I can get them on the 1-wire bus.

It appears Maxim has at least one product that may do what you want...

Have you investigated or used an I2C 1-Wire bridge like the Maxim one?

Thanks for your consideration.

Thank you for your answers.

MGeo:
8. I am trying to use a 1-Wire slave lib to communicate with actautors and sensors over a 3 wire bus (power, gnd, signal).

What value do you plan to use for the 1-Wire family code?