• Evaluation of the 1-Wire Driver on a 22' bus

    Dana Myers04/24/2020 at 15:55 0 comments

    This two-transistor driver was built using the strongest 1k5 pull-up allowed for 1-Wire:

    Note that D1/R4 are contained in the DS9503 used (pins 2 and 5 are grounded and thus don't appear in the combined schematic above).

    A couple of 1-Wire devices are connected (a DS276x temperature probe and DS2413 switch) via a relatively long cable made of 18ga zip wire (speaker wire) and the bus is monitored for regular scan activity:

    As expected, the bus levels are 0V and 5V. Let's zoom in and look at a specific 1-Wire transaction - this is called a Reset/Presence pulse. The 1-Wire Master generates a very long (520uS) low pulse to reset all 1-Wire slaves; they respond by generating a 120uS 'Presence' pulse:

    In the above capture, you see a small amount of undershoot from the 1-Wire Slave Presence pulse; this is unavoidable on a longer cable like the 22' line here. Fortunately, the DS9503 clamps the negative pulse before it can damage the UART RxD line.

    Let's zoom in even closer and look at a single data bit on the bus - this is a 'Read 1' transaction:

    Note the timebase is 1uS/division. The master pulls the bus low for ~8uS, which signals the sensor it is ready to receive a bit - here, the sensor sends a '1' bit by allowing the bus to charge back up to 5V. Because the 1-Wire Master uses a 1k5 resistor, the charge follows an RC curve, rising above the RxD threshold in ~400nS and above 4V in ~1uS. The bus is sampled at ~4uS (which is off the right of the trace). We see that data integrity on the 22' cable is excellent. Of course, the 22' 1-Wire bus will have reflections of data pulses - these are visible as small squiggles on the rising RC curve for about 400nS if we zoom further in:

    Because the RxD pin isn't sampled until ~4uS later, these (expected) reflections do not compromise the integrity of the data.

    This experiment shows a simple 1-Wire Master driver works well with cables longer than 20'; while I haven't tested it, this probably would work up to 50'.

    DO NOT try this with a single-pin SoC interface on a Raspberry Pi without a proper 3V ESD clamp.