1-Wire

1-Wire is a wired half-duplex serial bus designed by Dallas Semiconductor that provides low-speed (standard 16.3 kbit/s; "overdrive" at 10×[1]) data communication and supply voltage over a single conductor.[2]

1-Wire is similar in concept to I2C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments. A network of 1-Wire devices with an associated master device is called a MicroLAN. The protocol is also used in small, 16 mm electronic keys known as a Dallas key or  .

One distinctive feature of the bus is the possibility of using only two conductors — data and ground. To accomplish this, 1-Wire devices integrate a small capacitor (~800 pF) to store charge, which powers the device during periods when the data line is active.

## Contents

* 1 Usage example
* 1.1 Power supplies
* 2 Communication protocol
* 3 ROM family codes
* 4 Example communication with a device
* 5 Development tools
* 6 See also
* 7 References
* 8 External links

## Usage example

1-Wire devices are available in different packages: integrated circuits, a TO-92-style package (as typically used for transistors), and a portable form called an or Dallas key which is a small stainless-steel package that resembles a watch battery. Manufacturers also produce devices more complex than a single component that use the 1-Wire bus to communicate.

1-Wire devices can fit in different places in a system. It might be one of many components on a circuit board within a product. It also might be a single component within a device such as a temperature probe. It could be attached to a device being monitored. Some laboratory systems connect to 1-Wire devices using cables with modular connectors or CAT-5 cable. In such systems, RJ11 (6P2C or 6P4C modular plugs, commonly used for telephones) are popular.

Systems of sensors and actuators can be built by wiring together many 1-Wire components. Each 1-Wire component contains all of the logic needed to operate on the 1-Wire bus. 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 a MicroLan to the host PC. 1-Wire devices can also be interfaced directly to microcontrollers from various vendors.

are connected to 1-Wire bus systems by means of sockets with contacts that touch the "lid" and "base" of the canister. Alternatively, the connection can be semi-permanent with a socket into which the iButton it is easily removed.

Each 1-Wire chip has a unique identifier code. This feature makes the chips, especially , suitable electronic keys. Some uses include locks, burglar alarms, computer systems, manufacturer-approved accessories, time clocks and courier and maintenance keys for smart safes.

have been used as Akbil smart tickets for the public transport in Istanbul. They can also run smartcard programs such as Java Card 2.0, as exemplified by the "Java Ring" of 1998.[3]

### Power supplies

Apple MagSafe\- and MagSafe-2-connector–equipped power supplies, displays, and Mac laptops use the 1-Wire protocol to send and receive data to and from the connected Mac laptop, via the middle pin of the connector. Data include power supply model, wattage, and serial number; and laptop commands to send full power, and illuminate the red or green light-emitting diodes in the connector.[4]

Dell laptop power supplies use the 1-Wire protocol to send data via the third wire to the laptop computer about power, current and voltage ratings. The laptop will then refuse charging if the adapter does not meet requirements.[5]

## Communication protocol

In any MicroLan, there is always one master in overall charge, which may be a personal computer or a microcontroller. The master initiates activity on the bus, simplifying the avoidance of collisions on the bus. Protocols are built into the master's software to detect collisions. After a collision, the master retries the required communication.

A 1-Wire network is a single open drain wire with a single pull-up resistor. The pull-up resistor pulls the wire up to 3 or 5 volts. The master device and all the slaves each have a single open-drain connection to drive the wire, and a way to sense the state of the wire. Despite the "1-Wire" name, all devices must also have a second conductor for a ground connection to permit a return current to flow through the data wire.[6] Communication occurs when a master or slave briefly pulls the bus low, i.e., connects the pull-up resistor to ground through its output MOSFET. The data wire is high when idle, and so it can also power a limited number of slave devices. Data rates of 16.3 kbit/s can be achieved.[7]: 40 There is also an overdrive mode that speeds up the communication by a factor of 10.[7]: 39

A short 1-Wire bus can be driven from a single digital I/O pin on a microcontroller. A universal asynchronous receiver-transmitter (UART) can also be used.[8] Specific 1-Wire driver and bridge chips are available. Universal Serial Bus "bridge" chips are also available. Bridge chips are particularly useful to drive cables longer than 100 m. Up to 300-meter twisted pairs, i.e., telephone cables, have been tested by the manufacturer. These extreme lengths require adjustments to the pull-up resistances from 5 to 1 kΩ.[7]: 40–41

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. After that, any slave device, if present, shows that it exists with a "presence" pulse: it holds the bus low for at least 60 μs after the master releases the bus.

To send a binary number "1", the bus master sends a very brief (1–15 μs) low pulse. To send a binary number "0", the master sends a 60 μs low pulse. The falling (negative) edge of the pulse is used to start a monostable multivibrator in the slave device. The multivibrator in the slave reads the data line about 30 μs after the falling edge. The slave's internal timer is an inexpensive analog timer. It has analog tolerances that affect its timing accuracy. Therefore, the pulses are calculated to be within margins. Therefore, the "0" pulses have to be 60 μs long, and the "1" pulses can't be longer than 15 μs.

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

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

When a sequence of data is being transferred, errors can be detected with an eight-bit CRC (weak data protection)..

Many devices can share the same bus. Each device on the bus has a 64-bit serial number, of which eight bits are used as a checksum, thus allowing a "universe" of 256 (over 7.2 × 1016) unique device identities. The least significant byte of the serial number is an eight-bit number that tells the type of the device. The most significant byte is a standard (for the 1-Wire bus) eight-bit CRC.[7]: 14

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

The 1-Wire bus enumeration protocol, like other singulation protocols, is an algorithm the master uses to read the address of every device on the bus. Since the address includes the device type and a CRC, recovering the roster of addresses 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's address matches all the address bits sent 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 56-bit numbers, because as soon as an invalid bit is detected, all subsequent address bits are known to be invalid. The 56-bit address space is searched as a binary tree,[7]: 51 allowing up to 75 devices to be found per second.[7]: 53 The order in which device addresses are discovered by this enumeration protocol is deterministic and depends only on the device type and serial number. Bit-reversing these 56 bits yields the order of discovery for devices using Maxim's published algorithm (algorithm defined in Application Note 187[9]). The search algorithm can be implemented in an alternative form, initially searching paths with address bits equal to 1, rather than 0. In this case, inverting the 56 address bits and then reversing them yields the order of discovery.

The location of devices on the bus is sometimes significant. For these situations, a microcontroller can use several pins, or the manufacturer has a 1-Wire device that can switch the bus off or pass it on. Software can therefore explore sequential bus domains.[7]

## ROM family codes

Every 1-Wire device's 64-bit ROM ID ends with an 8-bit family code. In most cases this byte is assigned to a single part number, so reading it from the bus is usually enough to identify the device—for example, 0x10 (DS18S20 thermometer),[10] 0x01 (DS2401 silicon serial number),[11] or 0x2D (DS2431 1 kbit EEPROM).[12]

Various people have created online databases of family codes from the broad range of 1-Wire memory, authenticator, ID, and battery-monitor devices.[13]

## Example communication with a device

The following signals were generated by an FPGA, which was the master for the communication with a DS2432 (1 kbit EEPROM with SHA-1 Engine) chip, and measured with a logic analyzer. A logic high on the 1-Wire output, means the output of the FPGA is in tri-state mode and the 1-Wire device can pull the bus low. A low means 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.

File:1-Wire-Protocol.png

## Development tools

When developing and/or troubleshooting the 1-Wire bus, examination of hardware signals can be very important. Logic analyzers and bus analyzers are tools that collect, analyze, decode, and store signals to simplify viewing the high-speed waveforms.

## See also

* SDI-12, a single data wire communications scheme
* Single-wire transmission line, a technique for electric power transmission with only "1 wire" without a ground return wire path
* Touch memory

## References

1. ↑ "Reading and Writing 1-Wire Devices Through Serial Interfaces" (in en-US). https://www.analog.com/en/app-notes/reading-and-writing-1wirereg-devices-through-serial-interfaces.html.
2. ↑ "Overview of 1-Wire Technology and Its Use". https://www.analog.com/en/technical-articles/guide-to-1wire-communication.html.
3. ↑ An introduction to the Java Ring, by Stephen M. Curry, JavaWorld.com, April 1st, 1998.
4. ↑ ""Teardown and exploration of Apple's Magsafe connector"". rightTo.com. http://www.righto.com/2013/06/teardown-and-exploration-of-magsafe.html.
5. ↑ "Hacking Dell Laptop Charger Identification". hackaday.com. http://hackaday.com/2014/03/03/hacking-dell-laptop-charger-identification/.
6. ↑ "1-Wire online tutorial. This tutorial will give you an overview of the 1-Wire protocol, its device operation and application solutions.". http://www.maxim-ic.com/products/1-wire/flash/overview/index.cfm.
7. ↑ 7.0 7.1 7.2 7.3 7.4 7.5 7.6

* "Book of iButton Standards". 2002. https://www.analog.com/en/resources/technical-articles/book-of-ibuttonreg-standards.html.
* "iButton Overview" (PDF). http://www.maxim-ic.com/products/ibutton/ibuttons/standard.pdf. 081218 maxim-ic.com

8. ↑ "Using a UART to Implement a 1-Wire Bus Master". 10 September 2002. https://www.analog.com/en/resources/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html.
9. ↑ "1 Wire Search Algorithm (Application Note 187)" (PDF). https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/187.html.
10. ↑ "DS18S20 – High-Precision 1-Wire Digital Thermometer (datasheet)". https://www.analog.com/media/en/technical-documentation/data-sheets/ds18s20.pdf.
11. ↑ "DS2401 – Silicon Serial Number (datasheet)". https://www.analog.com/media/en/technical-documentation/data-sheets/ds2401.pdf.
12. ↑ "DS2431 – 1024-Bit 1-Wire EEPROM (datasheet)". https://www.analog.com/DS2431/datasheet.
13. ↑ "1-Wire Family Code Database". https://jumtee.com/1-wire-family-code-database.

## External links

* 1-Wire Device
* Accessing, Reading, and Writing to 1-Wire devices using a UART
* Using a UART to Implement a 1-Wire Bus Master
* iButton, iButtonLink
* Guidelines for Reliable Long Line 1-Wire Networks
* Choosing the Right 1-Wire Master for Embedded Applications
* OWFS — 1-Wire file system for Linux
* Guides to working with 1-Wire, for programmers and engineers
* Getting 1-Wire sensors working in Linux using OWFS
* 1-wire Arduino tutorial
* Guide to writing software for 1-Wire/ MicroLan using Lazarus, "the free Delphi".

* v
* t
* e

Technical and de facto standards for wired computer buses

General|

* System bus
* Front-side bus
* Back-side bus
* Daisy chain
* Control bus
* Address bus
* Bus contention
* Bus mastering
* Network on a chip
* Plug and play
* List of bus bandwidths

Standards|

* SS-50 bus
* S-100 bus
* Multibus
* Unibus
* VAXBI
* MBus
* STD Bus
* SMBus
* Q-Bus
* Europe Card Bus
* ISA
* STEbus
* Zorro II
* Zorro III
* CAMAC
* FASTBUS
* LPC
* HP Precision Bus
* EISA
* VME
* VXI
* VXS
* NuBus
* TURBOchannel
* MCA
* SBus
* VLB
* PCI
* PXI
* HP GSC bus
* InfiniBand
* UPA
* PCI Extended (PCI-X)
* AGP
* PCI Express (PCIe)
* Compute Express Link (CXL)
* Direct Media Interface (DMI)
* RapidIO
* Intel QuickPath Interconnect
* NVLink
* HyperTransport
* Infinity Fabric
* Intel Ultra Path Interconnect

Storage|

* ST-506
* ESDI
* IPI
* SMD
* Parallel ATA (PATA)
* SSA
* DSSI
* HIPPI
* Serial ATA (SATA)
* SCSI
* Parallel
* SAS
* Fibre Channel
* SATAe
* PCI Express (via AHCI or NVMe logical device interface)

Peripheral|

* Apple Desktop Bus
* DCB
* Commodore bus
* HP-IL
* HIL
* MIDI
* RS-232
* RS-422
* RS-423
* RS-485
* DMX512-A
* IEEE-488 (GPIB)
* IEEE-1284 (parallel port)
* UNI/O
* ACCESS.bus
* 1-Wire
* D²B
* I²C
* SPI
* I3C
* Parallel SCSI
* Profibus
* IEEE 1394 (FireWire)
* USB
* Camera Link
* External PCIe
* Thunderbolt

Audio|

* ADAT Lightpipe
* AES3
* Intel HD Audio
* I²S
* MADI
* McASP
* S/PDIF
* TOSLINK

Portable|

* PC Card
* ExpressCard

Embedded|

* Multidrop bus
* CoreConnect
* AMBA (AXI)
* Wishbone
* SLIMbus

Interfaces are listed by their speed in the (roughly) ascending order, so the interface at the end of each section should be the fastest.
Category

* v
* t
* e

Automation protocols

Process automation|

* AS-i
* BSAP
* CC-Link Industrial Networks
* CIP
* CAN bus
* CANopen
* DeviceNet
* ControlNet
* DF-1
* DirectNET
* EtherCAT
* Ethernet Global Data (EGD)
* Ethernet Powerlink
* EtherNet/IP
* Factory Instrumentation Protocol
* FINS
* FOUNDATION fieldbus
* H1
* HSE
* GE SRTP
* HART Protocol
* Honeywell SDS
* HostLink
* INTERBUS
* IO-Link
* MECHATROLINK
* MelsecNet
* Modbus
* Optomux
* PieP
* Ethernet Powerlink
* Profibus
* PROFINET IO
* RAPIEnet
* SERCOS interface
* SERCOS III
* Sinec H1
* SynqNet
* TTEthernet

Industrial control system|

* MTConnect
* OPC DA
* OPC HDA
* OPC UA

Building automation|

* 1-Wire
* BACnet
* C-Bus
* CEBus
* DALI
* DSI
* DyNet
* Factory Instrumentation Protocol
* KNX
* LonTalk
* Modbus
* oBIX
* VSCP
* X10
* xAP
* xPL
* ZigBee

Power-system automation|

* IEC 60870
* IEC 60870-5
* IEC 60870-6
* DNP3
* Factory Instrumentation Protocol
* IEC 61850
* IEC 62351
* Modbus
* Profibus

Automatic meter reading|

* ANSI C12.18
* IEC 61107
* DLMS/IEC 62056
* M-Bus
* Modbus
* ZigBee

Automobile / Vehicle|

* AFDX
* ARINC 429
* CAN bus
* ARINC 825
* SAE J1939
* NMEA 2000
* FMS
* Factory Instrumentation Protocol
* FlexRay
* IEBus
* J1587
* J1708
* Keyword Protocol 2000
* Unified Diagnostic Services
* LIN
* MOST
* VAN
* UAVCAN

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/1-Wire. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=1-Wire&oldid=3980020"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template