1-Wire

From Wikipedia, the free encyclopedia

(Redirected from IButton)
Jump to: navigation, search
An I-button in a plastic fob. Probably for use as a "key".
An I-button in a plastic fob. Probably for use as a "key".

1-Wire is a device communications bus system designed by Dallas Semiconductor that provides low-speed data, signaling and power over a single wire (a Ground wire is also needed). 1-Wire is similar in concept to I²C, but with lower data rates, longer range and a much lower cost. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments.

One of the attractive features of the bus is that a device only needs two wires, data and ground. To accomplish this, the integrated circuit includes an 800pF capacitor to power it from the data line. Some of the devices are available in tiny cans that look like small capacitors or watch batteries, in which packaging they are called iButtons.

1-Wire devices are also found mounted on printed circuit boards, with or without a 1-Wire controller. Sometimes the PCB is only there to support the 1-wire device, but in many commercial applications, the 1-Wire device is just one of the chips creating the solution to some need. They are sometimes present in laptop and cellphone battery packs, for instance.

Some laboratory systems and other data acquisition and control systems connect to 1-wire devices using cords with modular connectors or with CAT-5 cable, with the devices themselves mounted in a socket, incorporated in a small pcb, or attached to the object being monitored. In such systems, RJ11 (6P2C or 6P4C modular plugs, commonly used for telephones) are popular.

Systems of sensors can be built by wiring together 1-Wire components, each including all of the logic needed to operate on the 1-Wire bus. Such circuits are called MicroLans, a trademarked name. Examples include temperature loggers, timers, voltage and current sensors, battery monitors, and memory. These can be connected to a PC using a bus converter. USB, RS-232 Serial, and parallel port interfaces are popular solutions for connecting the MicroLan to the host PC. MicroLans also interface to microcontrollers, such as the Parallax BASIC Stamp or the Microchip PIC family.

The iButton is a mechanical packaging standard that places a 1-Wire component inside a small stainless steel "button" similar to a disk-shaped battery. iButtons are connected to 1-Wire bus systems by means of a socket with contacts which touch the "lid" and "base" of the canister. The connection can be fleeting, similar to swiping a credit card through a reader. Semi-permanent connections are possible with a different socket type. (The iButton clips into it, but is easily removed.)

The JavaRing, an ring-mounted iButton with a Java Virtual Machine (compatible with the Java Card 2.0 specification) within was presented to the attendants of the JavaOne 1998 conference[1].

Each individual 1-Wire chip has a unique code buried within it. Every chip has a different number. This feature makes the chips, especially in an iButton package, ideal as "keys", in sense of the device that opens a lock. There are iButton solutions to securing premises, arming and deactivating burglar alarms, etc. There are also systems for "unlocking" less obvious "secure areas". For example, iButtons can be used to authenticate computer system users, or with "time clock" systems.

Contents

In any MicroLan, there is always one (and only one) master in overall charge. That may be a PC, or a microcontroller. The master acts like a controller allowing only one of the slaves on the bus to talk at one time in order to prevent collisions on the bus.

The hardware level of the protocol is often performed by special software in the bus master and a resistor. The resistor pulls the wire up to five volts, and incidentally provides the power to the network of devices. Specific 1-Wire driver and bridge chips are also available.

The master starts a sequence of bits with a "reset" pulse, which pulls the wire to zero volts for 480 microseconds. This resets every slave device on the bus, probably by depriving them all of power. After that, any slave device, if present, shows that it exists with a "presence" pulse: it holds the wire at ground for at least 60 microseconds after the master releases the bus.

To send a 1 bit, the software of the bus master sends a very brief (one to fifteen microsecond) low pulse. To send a 0, the software sends a sixty microsecond low pulse. The falling edge of the pulse is used to start a monostable multivibrator in the slave device. The multivibrator in the slave clocks to read the data line about thirty microseconds after the falling edge. The slave's multivibrator unavoidably has analog tolerances that affect its timing accuracy, which is why the output pulses have to be sixty microseconds long, and the starting pulse can't be longer than fifteen.

If a parallel port is inconvenient or the operating system interferes with the timing, a UART running at 100 kbaud with a few resistors and special software can produce and sense acceptable 1-wire pulses. Serial or USB "bridge" chips are also available that handle the timing and waveform requirements of the 1-Wire bus, and are particularly useful in utilizing long (greater than 100 m) cables effectively.

When receiving data, the master sends a one to fifteen microsecond zero-volt pulse to start each bit. If the transmitting slave unit wants to send a one, it does nothing, and the wire goes immediately up to the pulled-up voltage. If the transmitting slave wants to send a zero, it pulls the data line to ground for sixty microseconds.

The basic sequence is a reset pulse followed by an 8-bit command, and then data is sent or received in groups of eight bits.

When a sequence of data is being transferred, errors can be detected with an 8-bit CRC.

Many devices can share the same bus. Each device on the bus has a unique 64-bit serial number. The most significant byte of the serial number is an 8-bit number that tells the type of the device. The least-significant byte is a standard (for the 1-wire bus) 8-bit CRC.

There are several standard broadcast commands, and commands addressed to particular devices. The master can send a selection command, and then the address of a particular device, and then the next command is executed only by the selected device.

The bus also has an algorithm to recover the address of every device on the bus. Since the address includes the device type and a CRC, recovering the address roster also produces a reliable inventory of the devices on the bus.

To find the devices, the master broadcasts an enumeration command, and then an address, "listening" after each bit of an address. If a slave has all the address bits so far, it returns a 0. The master uses this simple behavior to search systematically for valid sequences of address bits. The process is much faster than a brute force search of all possible 64-bit numbers because as soon as an invalid bit is detected, all subsequent address bits are known to be invalid. An enumeration of ten or fifteen devices finishes very quickly. The location of devices on the bus is sometimes important as well. For these situations, the manufacturer has a special device that either passes through the bus, or switches it off. Software can therefore explore sequential "bus domains."

The following signals were generated by an FPGA, which was the master for the communication with a DS2432 (EEPROM) chip, and measured with a logic analyzer. High on the 1-wire output means that the output of the FPGA is in tri-state mode and the 1-wire device can pull down the bus. Low means that the FPGA pulls down the bus. The 1-wire input is the measured bus signal. On input sample time high, the FPGA samples the input for detecting the device response and receiving bits.

Image:1wire.png

  1. ^ An introduction to the Java Ring, by Stephen M. Curry, JavaWorld.com, April 1st, 1998.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.