Pages: [1] 2 3 ... 7   Go Down
Author Topic: 1-Wire Slave  (Read 29212 times)
0 Members and 2 Guests are viewing this topic.
Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quick answers

Quote
1. 1-Wire slave should be available for which processors / boards?
- keep it as portable as possible, use "timing tables" like in NewSoftSerial.

Quote
2. Is there any reason to support 1 MHz processor speed?
- maybe low energy mode?

Quote
3. 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)

Quote
4. 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
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

London (UK)
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1. 1-Wire slave should be available for which processors / boards?
As posted by robtillaart, it should be portable. If you have to choose a board to start with, Uno.

2. Is there any reason to support 1 MHz processor speed?
I wouldn't use it but I guess it might be interesting to some people.

3. Is it possible for an AVR processor to run from "parasitic power"?
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.

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Follow-up...

2. 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).

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

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

7. How do you plan to generate serial numbers?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
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.
 
Quote
2. Is there any reason to support 1 MHz processor speed?
Not for my applications, using 8 MHz internal or 16 MHz external.

Quote
3. 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.

Quote
4. 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.
« Last Edit: July 08, 2011, 09:13:53 am by MGeo » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
6. 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.

Quote
7. How do you plan to generate serial numbers?
Ideally over the 1-wire bus, else program in.
« Last Edit: July 08, 2011, 09:13:06 am by MGeo » Logged

London (UK)
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
6. 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.
« Last Edit: July 08, 2011, 05:50:41 am by 5volt » Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
6. 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

Quote
7. How do you plan to generate serial numbers?
maybe use a UUID??  => - http://www.famkruithof.net/uuid/uuidgen - as base to derive the serial number from.

Q: is 1-wire patented?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
7. How do you plan to generate serial numbers?
Ideally over the 1-wire bus, else program in.

I don't understand.  Please clarify.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
2. 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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
6. 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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
maybe use a UUID??  => - http://www.famkruithof.net/uuid/uuidgen - as base to derive the serial number from.

Hmm.  Interesting choice.  Thanks.

Quote
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
http://www.picbasic.co.uk/forum/showthread.php?t=9192&page=1
http://www.picbasic.co.uk/forum/showthread.php?t=6840&page=1
http://www.embeddedrelated.com/usenet/embedded/show/76371-1.php

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".
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
7. How do you plan to generate serial numbers?
Ideally over the 1-wire bus, else program in.

I don't understand.  Please clarify.


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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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


Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12747
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


@MGeo: Reply #9 was a question for you...
http://arduino.cc/forum/index.php/topic,65706.msg483782.html#msg483782

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

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

9. Which libraries do you intend to use?

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

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

12. In your 1-Wire master code, do you read and verify the CRC?  Do you discard responses with an invalid CRC?
« Last Edit: July 11, 2011, 01:36:10 am by Coding Badly » Logged

Pages: [1] 2 3 ... 7   Go Up
Jump to: