Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DIY Dallas 1 Wire Slave discussion.

Status
Not open for further replies.

3v0

Coop Build Coordinator
Forum Supporter
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
 
Last edited:
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:
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.
 
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.:D</edit>

Mike.
 
Last edited:
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.
 
Last edited:
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.
 
Here are 1-wire slave routines in asm:
**broken link removed**
 
That is very impressive code. I'm looking forward to studying it (not now though - 1AM here).

Mike.
 
It is doable, I've done a ds2408 slave emulation for ir21w project.

the microcontroler was a pic 12f675 an you need a diode and a capacitor for parasite power to work.
I've done it in asm and it uses some 800 words.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top