Dallas Semiconductor MicroLAN

Dallas Semiconductor has developed a series of devices intended for absolutely minimum cost. The devices come in two form factors: a metal can, and a small plastic case. There are a variety of devices available; the simplest can do nothing but report its 56 bit serial number, while others are capable of memory functions, switching functions, and environmental (temperature) sensing. The network is referred to as either 1-Wire or MicroLAN, depending on which Dallas document you read.

The company emphasizes the use of the product in situations like building HVAC where a MicroLAN bus can be used to connect temperature sensors and ducts in all the rooms, or access control where a ROM in a can (with no capabilities beyond reporting its device ID) could be used as a key.

Topology

MicroLAN can be configured as a bus, though having too many devices on the bus will cause signal degradation. Consequently switching devices can be used to create a tree structure; the part of the tree that is active functions as a bus.

It's a single-master bus; a host computer drives all transactions.

Signalling and Power

Dallas refers to MicroLAN as a one-wire interface, though it is actually two. One wire serves as a ground reference, while the other carries signal and power.

The bus is normally permitted to float high through a resistor; this will supply power to the devices on the bus. The devices have a small on-board capacitor (about 800 pF) that stores power when the bus is being used for signalling.

The bus is self-synchronizing: bits are written to it by pulling the signal line to ground. To write a 1, the wire is pulled low for at least 1, and no more than 15, microseconds. To write a 0, the wire is pulled low for at least 60, and no more than 120, microseconds (notice this means the device speed varies according to what is written. If we consider as worst-case a long string of 0s, with minimum time for each, this works out to about 16 Kb). Commands and data are sent to the device with write-0 and write-1 slots. The following figure shows how a string of bits is sent on the wire:

Sending Bits on MicroLAN

To read from the bus, the master writes a command to a device which calls for a response. It then issues a series of 1 microsecond pulses (notice that these are fast write-1 slots); if the device wishes to respond with a 1 it does nothing; if it wishes to respond with a 0, it pulls the line low for 15 microseconds. The following figure shows this; the black lines show the host's behavior, and the blue lines show the responses from the device:

device response

Two more signals: to reset, the host pulls the signal line low for at least 480 microseconds. If there is a device on the bus, it will respond to this by allowing the line to go high, and then pulling it low for between 60 and 240 microseconds. These are called a Reset Pulse and Presence Pulse, respectively.

It turns out to be very easy to write data to, and read data from, the bus using a serial port and a level convertor. Just set the port to 115,200 bps, and write a 0xff for a 1 (so the character start bit turns out to be 8.7 microseconds which looks like a 1 to the device), and write a 0x00 for a 0 (that's 78 microseconds). To read data from the device write a 0x00, and then read the data from the port. If there is a 1 in the least significant bit the result is a 1; if there is a 0, the device has held the line and the result is a 0.

MicroLAN Devices

All MicroLAN devices have a unique 56-bit device ID. They are capable of recognizing their serial number, and responding with it when queried by a READ ROM or SEARCH ROM command.

MicroLAN Packets

All packets start with a Reset Pulse, with the devices on the bus responding with a Presence Pulse.

The byte following the reset sequence specifies a command. Some of the more important commands are Match ROM followed by a 56-bit device ID and an eight bit Cyclic Redundancy Check. This serves to turn off all devices but the one addressed, for the next command. Also important is Search ROM, which lets the master discover the IDs of the devices on the bus.

Commands and Data

A good example command is performing a temperature conversion using a DS1822. To accomplish this, the host

  1. Performs a RESET
  2. Sends a MATCH ROM command (hex 0x55). This informs the devices that a device ID is coming, and that only the device with the specified ID should respond.
  3. Puts the desired device's ID on the bus.
  4. Gives a CNVT TMP (0x44) command.

At this point, the thermometer begins sampling the current temperature. The host must wait 1/2 second for the conversion to complete (of course, the host can be doing other things, including sampling temperatures in other rooms, during this time).

Once the device has had time to complete its temperature conversion, the host

  1. Performs another RESET and MATCH ROM
  2. Sends the device a READ SCRATCHPAD command
  3. Reads 9 bytes from the device. The nine bytes are

It should be noted that as of this writing (April, 2003) the part capable of performing this costs $1.97 in quantity 1, direct from Dallas Semiconductor. A version that is actually accurate to 0.5 degrees Celsius (DS18B20) is $2.57.


Last modified: Mon Apr 21 09:25:22 MDT 2003