![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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. | |
| |
| | #2 |
|
There's tons of 1 wire code. Search for iButton.
| |
| |
| | #3 |
| 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) | |
| |
| | #4 |
|
Ahh you want to emulate an ibutton. Nope I've not seen any code for that.
| |
| |
| | #5 | |
| Quote:
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. | ||
| |
| | #6 |
|
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. | |
| |
| | #7 |
|
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) | |
| |
| | #8 |
|
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. | |
| |
| | #9 |
|
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. | |
| |
| | #10 |
|
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. | |
| |
| | #11 |
|
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 | |
| |
| | #12 |
|
Thank you. That looks like a very comprehensive (and impressive) sub-system...
| |
| |
| | #13 | |
|
I have never seen this search engine. Cool. Now to find it in C ![]() Quote:
__________________ 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) | ||
| |
| | #14 |
|
That is very impressive code. I'm looking forward to studying it (not now though - 1AM here). Mike. | |
| |
| | #15 |
|
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 | |
| |
|
| 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 |