1-Wire Slave

  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?

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

Part number?

I believe these are the relevant open questions...

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

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

  3. Do you have a need for multiple (virtual) 1-Wire devices on a single board?

  4. How do you plan to generate 1-Wire serial numbers?

  5. Which Arduino libraries do you intend to use?

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

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

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

If you don't mind, please reply with answers.

I was not aware of Maxim I2C 1-Wire bridge. This could work for some sensors (ones that do not need post processing such as temp compensation, linearization, etc). Thanks for the tip. Would not help for actuators of course.

On family code I do not have a plan yet and am open for suggestion.

Part number?

My weather station project uses multiple DS2423. I've already lost one to in-service failure. Family Code: "1D"

http://pdfserv.maxim-ic.com/en/ds/DS2423.pdf

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

Prefer tiny45, mega48, mega88, tiny26, tiny2313 in order of precedence (tiny45 being most preferred)

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

Absolutely, yes.

  1. Do you have a need for multiple (virtual) 1-Wire devices on a single board?

Not a requirement

  1. How do you plan to generate 1-Wire serial numbers?

Hard Coded in EEPROM is fine. Maybe an external program can be used to generate the EEPROM number data.

  1. Which Arduino libraries do you intend to use?

LCD, SPI, not sure.

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

Possibly.

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

Delay() should be avoided anyway. Though loss of accurate mS/uS timing could be problematic.

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

I would prefer to check CRC data to validate 1-wire data

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

Would be nice to make counters for RoundsPerMinute counters,

you config pulses per rotation PPR in a register and you have

PPR 16 bit?
ROTATIONS register 32 bit
POSITION register 16 bit (counter from 0..PPR)

A question for everyone...

  1. Do you use Standard mode, Overdrive mode, or both?

I am targetting overdrive mode speeds.

pwillard:
Prefer tiny45, mega48, mega88, tiny26, tiny2313 in order of precedence (tiny45 being most preferred)

Clock speed?

Crystal or oscillator?

robtillaart:
Would be nice to make counters for RoundsPerMinute counters,

you config pulses per rotation PPR in a register and you have

PPR 16 bit?
ROTATIONS register 32 bit
POSITION register 16 bit (counter from 0..PPR)

A tachometer / encoder device?

MGeo:
I am targetting overdrive mode speeds.

Bad news. Overdrive will be later. The response to a master-read has to be within 1.0 microseconds. That's about 16 machine instructions (a small overrun would probably be OK). I suspect it will work but I want to pin down the other "high risk" implementation details before tackling the complexity of an assembly language interrupt service routine.

OK thanks.

This got me wondering how Arduino OneWire lib based master could be prepared for a 1 microsecond slave response to master-read without any hardware assist. It appears that OneWire Master lib OneWire::read_bit() code has a 3 microsecond delay for driving pin low, followed by a 9 microsecond delay at float before reading pin value. So maybe Arduino OneWire Master lib allows more response time than the minimum listed in Dallas spec, and 1 uS is taking excess margin?

Arduino OneWire Master Lib Source --> OneWire Arduino Library, connecting 1-wire devices (DS18S20, etc) to Teensy

Anyway, thanks for on-going consideration.

George

MGeo:
I am targetting overdrive mode speeds.

Do you have an Overdrive master?

This got me wondering how Arduino OneWire lib based master could be prepared for a 1 microsecond slave response to master-read without any hardware assist.

It should work fairly well on the Master. Interrupts have to be disabled in advance. But 1 microsecond is 16 simple machine instructions (worst case 8 machine instructions) which I believe is enough to pulse the line low and then listen for the slave's response.

It appears that OneWire Master lib OneWire::read_bit() code has a 3 microsecond delay for driving pin low, followed by a 9 microsecond delay at float before reading pin value.

The timing in the OneWire library seems a bit odd to me. It's definitely a different than the timing Maxim documents. At first I thought the times were tweaked to compensate for the code before and after but that does not seem to be the case.

So maybe Arduino OneWire Master lib allows more response time than the minimum listed in Dallas spec, and 1 uS is taking excess margin?

I don't follow.

Arduino OneWire Master Lib Source --> OneWire Arduino Library, connecting 1-wire devices (DS18S20, etc) to Teensy

That's the Master I've been working against.

Anyway, thanks for on-going consideration.

You are welcome. But don't hold your breath. The day job will not stop interfering!