Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 26th December 2008, 10:09 PM   #1
Default DIY Dallas 1 Wire Slave discussion.

For a while I have been thinking it would be interesting to write the uC code for a Dallas 1 Wire slave.

Either it is an unpopular idea, or it has been discouraged by the Maxim Dallas people. About 2 weeks ago I found a vendor document stating that they have not allocated any device addresses/types for 3rd party use. About the same time I saw what was untested BASIC code.

3v0
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)

Last edited by 3v0; 26th December 2008 at 10:12 PM.
3v0 is offline  
Old 26th December 2008, 10:10 PM   #2
Default

There's tons of 1 wire code. Search for iButton.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Old 26th December 2008, 10:14 PM   #3
Default

Quote:
Originally Posted by blueroomelectronics View Post
There's tons of 1 wire code. Search for iButton.
We have all written or used code to talk to slaves. I do not see code to create a slave.
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 26th December 2008, 10:17 PM   #4
Default

Ahh you want to emulate an ibutton. Nope I've not seen any code for that.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Old 26th December 2008, 10:23 PM   #5
Default

Quote:
Originally Posted by blueroomelectronics View Post
Ahh you want to emulate an ibutton. Nope I've not seen any code for that.
Morning Bill. LOL

EDIT: I was looking for a bit of chat about the merits of creating a custom slave.
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)

Last edited by 3v0; 26th December 2008 at 10:26 PM.
3v0 is offline  
Old 26th December 2008, 10:26 PM   #6
Default

I admit I've never thought of using the Maxim/Dallas 1-wire protocol.

I have however implemented a much higher speed Icom 1-wire (open-drain) CI-V protocol on a 12F683 based Ham radio accessory. The CI-V protocol uses standard serial data (8/1/N) at 5 volt TTL levels which necessarily limits the 1-wire bus length to relatively short distances. The packet protocol includes two header bytes ($FE, $FE), "To" and "From" address bytes, variable number of data bytes, and an $FD end-of-record byte.

Ekki DF4OR's CI-V Info' Pages

Regards, Mike

Last edited by Mike, K8LH; 26th December 2008 at 10:27 PM.
Mike, K8LH is offline  
Old 26th December 2008, 10:34 PM   #7
Default

I have been using 1 wire sensing (mostly temperature) for over two years and find them to be very durable. I have them outside, in the greenhouse and garage, and koi ponds.

In time I would like to create a monitoring, control, and security network. Speed is not important but not having to make repairs is.

There are some functions that the available 1 wire products do not address. A DIY slave based on a uC would fill the void.
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 27th December 2008, 02:19 AM   #8
Default

I have thought of doing this a few times. You could just make your slave look like a DS18x20 but return an invalid temperature (+127) when queried so you know it is your slave and you can then send it any custom commands you like. I thought of programming a 509 to act as a slave so I²C/SPI devices could be added to a OW bus. An obvious omission in OW devices is a humidity sensor.

<edit>Implementing the searchrom algorithm would be fun. I have managed to implement the searchrom and send RS232 on a 10f200! Fitting that into 256 words was a challenge.</edit>

Mike.

Last edited by Pommie; 27th December 2008 at 02:42 AM.
Pommie is online now  
Old 27th December 2008, 02:53 AM   #9
Default

They have discontinued the DS2423 counter which was popular for building tip bucket type rain gauges.

I doubt one could put together a setup using parasite power but it is worth looking at. If not you will need a 3rd conductor or provide local power for the custom devices, maybe solar. Would be interesting.
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)

Last edited by 3v0; 27th December 2008 at 02:54 AM.
3v0 is offline  
Old 27th December 2008, 03:42 AM   #10
Default

I think the parasitic power would be the easy bit. The protection diodes would conduct and so you would just need capacitors on the supply pins.

I might have a play with this in the new year.

Mike.
Pommie is online now  
Old 28th December 2008, 02:05 PM   #11
Default

Here are 1-wire slave routines in asm:
Koders Code Search: 1wslave.asm - Assembler
__________________
"The only thing worse than getting an error message is not getting an error message." - Allen Downey
qratman is offline  
Old 28th December 2008, 02:32 PM   #12
Default

Thank you. That looks like a very comprehensive (and impressive) sub-system...
Mike, K8LH is offline  
Old 28th December 2008, 02:38 PM   #13
Default

I have never seen this search engine. Cool.
Now to find it in C
Quote:
Originally Posted by qratman View Post
Here are 1-wire slave routines in asm:
Koders Code Search: 1wslave.asm - Assembler
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 28th December 2008, 03:10 PM   #14
Default

That is very impressive code. I'm looking forward to studying it (not now though - 1AM here).

Mike.
Pommie is online now  
Old 7th January 2009, 10:15 PM   #15
Default

Hi,
I goggled 1wire slave and found three addresses.

First one has C code.
www.alres.pl/pub/emul_1W.zip
www.alres.pl/glowna/pomoce/emul.html
or in English Translated version

Second one, only hex code home.hetnet.nl/~thomas_7/1Wire/1-WireIOPort.html

Last one, no source code www.louisswart.co.za/1-Wire_Overview.html

Regards,
Mustafa
Mustafa is offline  
Reply

Tags
dallas, discussion, diy, slave, wire

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
where is the discussion about how electionrejection Alternative Energy 1 16th March 2008 12:26 AM
H Bridge... Design, Discussion. Ayne Micro Controllers 5 18th February 2007 11:41 PM
Dallas DS18B20 Characteristics? Mike, K8LH Micro Controllers 8 16th September 2006 01:22 AM
Dallas 80C323 crowinu Micro Controllers 3 13th April 2006 06:40 PM
Very basic question for discussion Ravi General Electronics Chat 3 29th August 2003 03:20 AM



All times are GMT. The time now is 01:44 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker