1-Wire
Encyclopedia
1-Wire is a device communications bus system designed by Dallas Semiconductor Corp.
Dallas Semiconductor
Dallas Semiconductor, now a subsidiary of Maxim Integrated Products, designs and manufactures analog, digital, and mixed-signal semiconductors...

 that provides low-speed data, signaling, and power over a single signal. 1-Wire is similar in concept to I²C
I²C
I²C is a multi-master serial single-ended computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, cellphone, or other electronic device. Since the mid 1990s, several competitors I²C ("i-squared cee" or "i-two cee"; Inter-Integrated Circuit;...

, but with lower data rates and longer range. It is typically used to communicate with small inexpensive device
Electronic component
An electronic component is a basic electronic element and may be available in a discrete form having two or more electrical terminals . These are intended to be connected together, usually by soldering to a printed circuit board, in order to create an electronic circuit with a particular function...

s such as digital thermometer
Thermometer
Developed during the 16th and 17th centuries, a thermometer is a device that measures temperature or temperature gradient using a variety of different principles. A thermometer has two important elements: the temperature sensor Developed during the 16th and 17th centuries, a thermometer (from the...

s and weather instruments. A network of 1-Wire devices with an associated master device is called a MicroLan.

One distinctive feature of the bus is the possibility to use only two wires: data and ground. To accomplish this, 1-wire devices include an 800 pF
Farad
The farad is the SI unit of capacitance. The unit is named after the English physicist Michael Faraday.- Definition :A farad is the charge in coulombs which a capacitor will accept for the potential across it to change 1 volt. A coulomb is 1 ampere second...

 capacitor
Capacitor
A capacitor is a passive two-terminal electrical component used to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric ; for example, one common construction consists of metal foils separated...

 to store charge, and power the device during periods where the data line is used for data.

Dependent on function, native 1-wire devices are available as single components in integrated circuit
Integrated circuit
An integrated circuit or monolithic integrated circuit is an electronic circuit manufactured by the patterned diffusion of trace elements into the surface of a thin substrate of semiconductor material...

 and TO92
TO92
The TO-92 is a widely-used style of transistor enclosure construction. The case is often made of epoxy or plastic, and offers compact size at a very low cost.-History and origin:...

 packaging, and in some cases a portable form called an iButton that resembles a watch battery. Manufacturers also produce products that are more complex than a single component, and use the 1-wire bus to communicate.

A 1-Wire device may be just one of many components on a circuit board within a product, but are also found in isolation within devices such as a temperature sensor probe, or attached to a device being monitored. Some laboratory systems and other data acquisition and control systems connect to 1-Wire devices using cords with modular connector
Modular connector
Modular connector is the name given to a family of electrical connectors originally used in telephone wiring and now used for many other purposes. Many applications that originally used a bulkier, more expensive connector have now migrated to modular connectors...

s or with CAT-5
Category 5 cable
Category 5 cable is a twisted pair cable for carrying signals. This type of cable is used in structured cabling for computer networks such as Ethernet. It is also used to carry other signals such as telephony and video. The cable is commonly connected using punch down blocks and modular connectors...

 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
Modular connector
Modular connector is the name given to a family of electrical connectors originally used in telephone wiring and now used for many other purposes. Many applications that originally used a bulkier, more expensive connector have now migrated to modular connectors...

, commonly used for telephones) are popular.

Systems of sensors and actuators can be built by wiring together 1-Wire components, each including all of the logic needed to operate on the 1-Wire bus. Examples include temperature
Temperature
Temperature is a physical property of matter that quantitatively expresses the common notions of hot and cold. Objects of low temperature are cold, while various degrees of higher temperatures are referred to as warm or hot...

 loggers, timers, voltage
Voltage
Voltage, otherwise known as electrical potential difference or electric tension is the difference in electric potential between two points — or the difference in electric potential energy per unit charge between two points...

 and current sensors, battery monitors, and memory
Memory
In psychology, memory is an organism's ability to store, retain, and recall information and experiences. Traditional studies of memory began in the fields of philosophy, including techniques of artificially enhancing memory....

. These can be connected to a PC using a bus converter. USB
Universal Serial Bus
USB is an industry standard developed in the mid-1990s that defines the cables, connectors and protocols used in a bus for connection, communication and power supply between computers and electronic devices....

, RS-232
RS-232
In telecommunications, RS-232 is the traditional name for a series of standards for serial binary single-ended data and control signals connecting between a DTE and a DCE . It is commonly used in computer serial ports...

 serial, and parallel port
Parallel port
A parallel port is a type of interface found on computers for connecting various peripherals. In computing, a parallel port is a parallel communication physical interface. It is also known as a printer port or Centronics port...

 interfaces are popular solutions for connecting the MicroLan to the host PC. MicroLans also interface to microcontrollers, such as the Arduino
Arduino
Arduino is an open-source single-board microcontroller, descendant of the open-source Wiring platform, designed to make the process of using electronics in multidisciplinary projects more accessible. The hardware consists of a simple open hardware design for the Arduino board with an Atmel AVR...

, Parallax BASIC Stamp
BASIC Stamp
The BASIC Stamp is a microcontroller with a small, specialized BASIC interpreter built into ROM. It is made by Parallax, Inc. and has been popular with electronics hobbyists since the early 1990s because of its low threshold of learning and ease of use due to its simple to understand BASIC...

, Parallax Propeller
Parallax Propeller
The Parallax P8X32A Propeller chip, introduced in 2006, is a multi-core architecture parallel microcontroller with eight 32-bit RISC CPU cores....

, PICAXE
PICAXE
PICAXE is the name of a UK-sourced microcontroller system based on a range of Microchip PICs. There are 13 PICAXE variants of differing pin counts from 8 to 40 pins. Initially marketed for use in education and by electronics hobbyists, they are also used in commercial and technical fields,...

, the Microchip PIC family and RENESAS family.

The iButton (also known as the Dallas Key) is a mechanical packaging standard that places a 1-Wire component inside a small stainless steel
Stainless steel
In metallurgy, stainless steel, also known as inox steel or inox from French "inoxydable", is defined as a steel alloy with a minimum of 10.5 or 11% chromium content by mass....

 "button" similar to a disk-shaped battery. iButtons are connected to 1-Wire bus systems by means of sockets with contacts which touch the "lid" and "base" of the canister. Alternatively, the connection can be semi-permanent with a different socket type; the iButton clips into it, but is easily removed.

The Java Ring, a ring-mounted iButton with a Java Virtual Machine
Java Virtual Machine
A Java virtual machine is a virtual machine capable of executing Java bytecode. It is the code execution component of the Java software platform. Sun Microsystems stated that there are over 4.5 billion JVM-enabled devices.-Overview:...

 compatible with the Java Card
Java Card
Java Card refers to a technology that allows Java-dd applications to be run securely on smart cards and similar small memory footprint devices. Java Card is the tiniest of Java targeted for embedded devices. Java Card gives the user ability to program the device and make them application...

 2.0 specification within, was given to attendees of the JavaOne
JavaOne
JavaOne is an annual conference inaugurated in 1996 by Sun Microsystems to discuss Java technologies, primarily among Java developers. JavaOne is held in San Francisco, California typically running from Monday to Thursday. Technical sessions on a variety of topics are held during the day. In the...

 1998 conference.

Each 1-Wire chip has a unique code buried within it. This feature makes the chips, especially in an iButton package, suitable for use as a key to open a lock, arm and deactivate burglar alarms, authenticate computer system users, operate time clock systems, and other similar uses. iButtons are used as Akbil smart tickets for the Public transport in Istanbul
Public transport in Istanbul
Public transport in Istanbul comprises a bus network, various rail systems, funiculars, and maritime services to serve the more than 13 million inhabitants of the city spread over an area of 5712 km².-History:...

.

Use of the bus

In any MicroLan, there is always exactly one master in overall charge, which may be a PC
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

 or a microcontroller
Microcontroller
A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM...

. The master initiates activity on the bus, simplifying the avoidance of collisions on the bus. Protocols are built into the software to detect collisions. After a collision, the master tries again to effect the required communication.

The Dallas 1-Wire network is physically implemented as an open drain master device connected to one or more open drain slaves. A single pull-up resistor
Pull-up resistor
Pull-up resistors are used in electronic logic circuits to ensure that inputs to logic systems settle at expected logic levels if external devices are disconnected or high-impedance...

 is common to all devices and acts to pull the bus up to 3 or 5 volts, and may provide power to the slave devices. Communication occurs when a master or slave asserts the bus low—that is, connects the pull up resistor to ground through its output MOSFET. Specific 1-Wire driver and bridge chips are also available. Data rates of 16.3 kbit/s can be achieved. There is also an overdrive mode which speeds up the communication by a factor of 10.

The master starts a transmission with a "reset" pulse, which pulls the wire to 0 volts for at least 480 µs. 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 to ground for at least 60 µs after the master releases the bus.

To send a "1
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

", the bus master software sends a very brief low pulse. To send a "0", the software sends a 60 µs low pulse. The falling (negative) edge of the pulse is used to start a monostable multivibrator
Multivibrator
A multivibrator is an electronic circuit used to implement a variety of simple two-state systems such as oscillators, timers and flip-flops. It is characterized by two amplifying devices cross-coupled by resistors or capacitors...

 in the slave device. The multivibrator in the slave clocks to read the data line about 30 µs 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 60 µs long, and the starting pulse can't be longer than 15 µs.

If a parallel port is inconvenient or the operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 interferes with the timing, an UART
Universal asynchronous receiver/transmitter
A universal asynchronous receiver/transmitter, abbreviated UART , is a type of "asynchronous receiver/transmitter", a piece of computer hardware that translates data between parallel and serial forms. UARTs are commonly used in conjunction with communication standards such as EIA RS-232, RS-422 or...

 running at 100 kbit/s
Bit rate
In telecommunications and computing, bit rate is the number of bits that are conveyed or processed per unit of time....

 with a few resistors and special software can produce and sense acceptable 1-wire pulses. Serial or USB
Universal Serial Bus
USB is an industry standard developed in the mid-1990s that defines the cables, connectors and protocols used in a bus for connection, communication and power supply between computers and electronic devices....

 "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. Up to 300 meter long buses consisting of simple twisted pair
Twisted pair
Twisted pair cabling is a type of wiring in which two conductors are twisted together for the purposes of canceling out electromagnetic interference from external sources; for instance, electromagnetic radiation from unshielded twisted pair cables, and crosstalk between neighboring pairs...

 telephone cable has been tested by the manufacturer. It will however require adjustment of pull-up resistances from say to .

When receiving data, the master sends a pulse to start each bit. If the transmitting slave unit wants to send a "1", it does nothing, and the wire goes immediately up to the pulled-up voltage. If the transmitting slave wants to send a "0", it pulls the data line to ground for .

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

When a sequence of data is being transferred, errors can be detected with an 8-bit CRC
Cyclic redundancy check
A cyclic redundancy check is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data...

 (weak data protection).

Many devices can share the same bus. Each device on the bus has a unique 64-bit serial number. The least significant byte
Least significant bit
In computing, the least significant bit is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The lsb is sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digits...

 of the serial number is an 8-bit number that tells the type of the device. The most significant byte
Most significant bit
In computing, the most significant bit is the bit position in a binary number having the greatest value...

 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
Roster
A roster is a list of names of people involved with an organization of some kind.A roster can be a list of people and the times when they are required to work or a list of students in a classroom....

 also produces a reliable inventory of the devices on the bus. The 64-bit address space is searched as a binary tree, allowing up to 75 devices to be found per second.

To find the devices, the master broadcasts an enumeration
Enumeration
In mathematics and theoretical computer science, the broadest and most abstract definition of an enumeration of a set is an exact listing of all of its elements . The restrictions imposed on the type of list used depend on the branch of mathematics and the context in which one is working...

 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 10 or 15 devices finishes very quickly.

The location of devices on the bus is sometimes significant. 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 domain
Broadcast domain
A broadcast domain is a logical division of a computer network, in which all nodes can reach each other by broadcast at the data link layer. A broadcast domain can be within the same LAN segment or it can be bridged to other LAN segments....

s."

Example communication with a device

The following signals were generated by an FPGA
Field-programmable gate array
A field-programmable gate array is an integrated circuit designed to be configured by the customer or designer after manufacturing—hence "field-programmable"...

, which was the master for the communication with a DS2432 (EEPROM
EEPROM
EEPROM stands for Electrically Erasable Programmable Read-Only Memory and is a type of non-volatile memory used in computers and other electronic devices to store small amounts of data that must be saved when power is removed, e.g., calibration...

) 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.
For the PICAXE microcontrollers, the tutorial listed in the external links section below includes program examples for communication with many Dallas/Maxim 1-Wire devices including DS18B20, DS2406, DS2408, DS2413, DS23417, DS2433, DS2450, DS2890 and some iButton devices

Development tools

When developing and/or troubleshooting the 1-Wire bus, examination of hardware signals can be very important. Logic analyzers and bus analyzer
Bus analyzer
A bus analyzer is a computer bus analysis tool, often a combination of hardware and software, used during development of hardware or device drivers for a specific bus, for diagnosing bus or device failures, or reverse engineering....

s are tools which collect, analyze, decode, store signals so people can view the high-speed waveforms at their leisure.

See also

  • Single wire earth return
    Single wire earth return
    Single wire earth return or single wire ground return is a single-wire transmission line for supplying single-phase electrical power from an electrical grid to remote areas at low cost...

    , a technique for electric power transmission with only "1 wire" without a ground return wire path
  • Touch memory
    Touch memory
    Touch Memory is an electronic identification device packaged in a coin-shaped stainless steel container. Touch memory is accessed when a touch probe comes into contact with a memory button....


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK