Interfacing to 1-Wire LAN, especially Dallas temperature sensors?

Peter Hansen peter at engcorp.com
Fri May 31 22:16:46 EDT 2002


Christian Aastorp wrote:
> 
> I'm considering doing some temperature control and logging, both
> enviromental and inside computers. Did a google search, and found
> references to the range of temperature sensors from Dallas
> Semiconductors.
> 
> I also found schematics for interfacing with the serial port, and
> timing diagrams for implementing 1-Wire Lan using direct control of
> the port.
> 
> As I'm using  Python for my programming, these days, I would like some
> pointers to modules or techniques to use Python to read the
> temperature sensors.

Although I have not tried it with Python, and I would never say
something is impossible without more study, I am _fairly_ sure you
cannot do this reliably with Python.

The Dallas 1-Wire chips have protocol timing requirements somewhere
down in the low _tens_ of microseconds.  This requires some kind of 
real-time code and not only is Python itself unlikely to have
high enough performance on almost any current machine, but the
OS you're running it on is even less likely to support the
necessary latency.

We've been struggling just to get a 16MHz 68HC12 working with
these things, without having to disable interrupts for hundreds
of microseconds at a time.  It hasn't been easy.

It might be very instructive to try, however, and I'd be happy
to hear somebody say they'd proven me wrong (and curious what
was done to reach a solution).

-Peter



More information about the Python-list mailing list