Subject: Re: Dallas semiconductor "one-wire" and envsys(4)
To: Jeff Rizzo <>
From: David Laight <>
List: current-users
Date: 02/27/2006 21:42:53
On Sat, Feb 25, 2006 at 09:48:57AM -0800, Jeff Rizzo wrote:
> I'm currently working on a driver for one-wire devices (such as the
> DS18B20 temperature sensor) which attaches to gpio(4), and I'm wondering
> if anyone else would find this useful - my intended usage is to hook up
> a bunch of these devices to a soekris 4511 to monitor various stuff
> around the house.
> It's not clear to me whether this would be something appropriate to
> bring in to NetBSD or not - these devices are not commonly built into
> motherboards, and the usual usage is with microcontrollers (PIC, AVR,
> etc) - the bus protocol is such that the driver I've written has
> DELAY()s of up to 450ms, and I don't see a way to get rid of them and
> still retain the correct timing for bitbanging the protocol.  That said,
> the chips are fairly inexpensive (the DS18b20 is about US$5 in quantity
> 1, the DS1822 less than US$4), and are easy to connect up for any
> moderately competent hobbyist.

Is this the same interface as used in some of the battery gauge chips?
Where you generate a square wave with a 25%-75% duty cycle (for 0 and 1),
and where the device sends you data at its own clock speed that you have
to follow and sample the midpoint (or time the high part) to work out
whether it is sending a 0 or 1 ?

If so you need a uart to generate the data and parse the response
(or a dedicated PIC cpu to drive the gpio lines), you won't do it
reliably from within a Unix kernel without completely stuffing anything
else the system is trying to do.


David Laight: