Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1-wire is pretty slow (kbps max in normal mode) and very tolerant of devices with a wide range of timing skew.


I wouldn't call it very tolerant. Some timings are pretty tight, like 1 to 15 microseconds, and every microsecond can count. And I am not talking about the overdrive mode where the timings are much tighter.


One of the datasheets I have here says:

----- During the initialization sequence the bus master trans- mits (TX) the reset pulse by pulling the 1-Wire bus low for a minimum of 480µs. -----

There is no maximum time limit for the reset pulse.

----- The bus master then releases the bus and goes into receive mode (RX). When the bus is released, the 5kΩ pullup resistor pulls the 1-Wire bus high. When the DS18B20 detects this rising edge, it waits 15µs to 60µs and then transmits a presence pulse by pull- ing the 1-Wire bus low for 60µs to 240µs. -----

A tolerance of 15uS to 60uS on the device side and 60uS to 240uS on the driver side seems pretty wide to me.

Now, it's hard to actually get a good figure for these specifications because different datasheets give different values, which further suggests the tolerances are large.

Another datasheet that I have here says that the presence pulse should be sampled after 72uS. This leaves at least 12uS slack for rise times, long wires, etc.

To give an idea of whether 10uS is very long or not, remember that the cycle time on, for example, an 8MHz AVR as you might find in an Arduino, is 125nS. That gives you 80 instructions every 10uS (at the AVR8's advertised 1MIPS/MHz). This is plenty of time to implement the 1-Wire driver in software.


It seems that you didn't reach the part of the spec that describes how to read and transmit data bits.

Also, even for simplest slaves there is still a need to keep track of time which requires additional hardware (an oscillator or some such).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: