Pages: 1 [2] 3 4 ... 7   Go Down
Author Topic: 1-Wire Slave  (Read 32457 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Sorry, missed that.  Yes tuned RC if needed.
Logged

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

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?

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).
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.  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.
10. I general yes, for timing on servo loops and sensor interfaces.
11. Not a problem, it is an expected concession.  I can handle delays direct.
12. Yes, I plan to.

Thanks for your consideration.
George
« Last Edit: July 14, 2011, 04:22:31 am by MGeo » Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1661
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is very interesting to me...

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

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

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...
http://www.maxim-ic.com/app-notes/index.mvp/id/3684

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


Quote
Thanks for your consideration.

Thank you for your answers.
« Last Edit: July 16, 2011, 01:59:38 am by Coding Badly » Logged

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

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?
« Last Edit: July 16, 2011, 01:59:57 am by Coding Badly » Logged

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

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?

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

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

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

9. Which Arduino 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?


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

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

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

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1661
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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



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

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

Absolutely, yes.

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

Not a requirement

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



Quote
9. Which Arduino libraries do you intend to use?
LCD, SPI, not sure.

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

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

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


« Last Edit: July 16, 2011, 09:11:24 am by pwillard » Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 227
Posts: 14028
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
10. 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)





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: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


A question for everyone...

13. Do you use Standard mode, Overdrive mode, or both?
Logged

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

I am targetting overdrive mode speeds.
Logged

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

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

Clock speed?

Crystal or oscillator?


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?


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

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

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 --> http://www.pjrc.com/teensy/td_libs_OneWire.html

Anyway, thanks for on-going consideration.

George
« Last Edit: July 26, 2011, 05:12:35 am by MGeo » Logged

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

I am targetting overdrive mode speeds.

Do you have an Overdrive master?

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

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

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

Quote
Arduino OneWire Master Lib Source --> http://www.pjrc.com/teensy/td_libs_OneWire.html

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

Quote
Anyway, thanks for on-going consideration.

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

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 227
Posts: 14028
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
Quote from: robtillaart on July 16, 2011, 03:38:44 PM
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?
Yep, it is a recurring problem on the forum and developing a "smart encoder sensor" could be very interesting. The 1-wire slave Arduino connects the HW encoder to an IRQ line, the software on the 1-wire slave is configurable for the HW encoder details, like
* control register: start, stop, reset
* pulses per rotations (PPR)
* set IRQ edge (RISING/FALLING/CHANGE)
* rotations done since reset.
* position within current rotation.
* current direction of rotation [if supported in HW]
* angular velocity  [include array with last 10 pulse timestamps]



Logged

Rob Tillaart

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

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