1-Wire serial protocol decoding

Wiring

As implied by the protocol name, 1-Wire requires just one line, plus ground return, for data signaling. When idle the 1-Wire line is resistively pulled up to a high state. Most 1-Wire devices are parasitically powered, so do not need an external supply voltage. Power for device operation is derived from an internal power storage capacitor that parasitically stores charge when the 1-Wire line is in the high-idle state. For operation below 2.8 V some 1-Wire devices come with an external VCC pin and so do not support parasitic power mode.

Signaling

The master device communicates with the slaves using controlled short pulses or time slots. A time slot is the time during which a logic zero or a logic one is written or read.

A Standard mode time slot is 60 µs duration and an Overdrive mode time slot is 8 µs. 1-Wire devices have an internal timebase that is synchronized to the falling edge of the master-generated timing. Logic one is transmitted as a short, negative-going pulse at the beginning of the time slot, while logic zero is transmitted as a longer negative-going pulse. The receiving device samples at a defined point in the time slot and so senses either a one or a zero.

1-Wire protocol is a three-phase transaction, beginning with a master-initiated reset which is followed by device detection and then by device function commands.

In Standard mode the master issues a reset command by holding the line 1-Wire line low for more than 480 µs. After reset the bus master releases the line, then goes into receive mode and waits for a period of 15 µs to 60 µs, during which time the 1-Wire line goes into the high idle state. After the reset pulse, each and every connected slave device acknowledges the master by pulling the line low for a period of 60 µs to 240 µs, termed the presence pulse. By the end of the 240 µs presence pulse detection time all slave devices will have released the line and it will return to idle high. At this point all slave devices on the 1-Wire line are synchronized to a known state.

If multiple slave devices are connected they will all pull the line low simultaneously, so the master knows only that at least one slave device is connected.

PicoScope 7 displaying time rulers on a 480 us reset pulse from a 1-Wire master

1-Wire reset command (>480 us)


Once the slave devices are synchronized to a known state, the bus master can start communicating with the slave devices. 

Each slave device has a unique factory-programmed 64-bit ROM ID, consisting of an 8-bit family code, 48-bit serial number and 8-bit CRC. Resolution of the individual slave devices connected to the 1-Wire bus is done with a device detection sequence.

The master selects a particular slave device, based on its unique ID, with the ROM command sequence.

With a particular slave device selected the remaining slave devices drop off the line. The master then executes a device function sequence command such as a write to, or a read from, the slave memory. 

Rulers displaying a 60 us pulse from a 1-Wire interface

1-Wire data bit (>60 us)


Capturing and analyzing 1-Wire communications with PicoScope

The first step is to acquire the 1-Wire signal of interest using the PicoScope advanced trigger. Then select Serial decoding on the left, or under the More... menu.

Next, select 1-Wire from the list of available protocols.

In the Configuration tab, select the corresponding PicoScope input channel for Data and provide the appropriate values for the relevant 1-Wire fields.

In the Display tab, select the desired Graph and Table display format options to display 1-Wire packets in the appropriate locations. 

You can navigate serial packets in the graph display using the standard PicoScope zoom tool. Alternatively, double-clicking a packet in the table display will highlight the same packet in the graph to easily correlate packet data with the source waveforms.

Fully decoded 1-Wire packet in a hexidecimal format

1-Wire trace decoded in PicoScope 7