Sunday, June 10, 2007

1-Wire Protocol

"Uses a single wire (plus ground) to accomplish both communication and power transmission. A single bus master can feed multiple slaves over a single twisted-pair cable. An important aspect of this technology is that every slave has a globally unique digital address.

What is the 1-Wire Net?The 1-Wire net is a low-cost bus based on a PC or micro-controller communicating digitally over twisted-pair cable with 1-Wire components. The network is defined with an open-drain (wired-AND) master/slave multidrop architecture that uses a resistor pull-up to a nominal 5V supply at the master. A 1-Wire net-based system consists of three main elements: 1) a bus master with controlling software such as the TMEX iButton viewer; 2) wiring and associated connectors; and 3) 1-Wire devices. The system permits tight control because no node is authorized to speak unless requested by the master, and no communication is allowed between slaves except through the master.

The 1-Wire protocol uses conventional CMOS/TTL logic levels with operation specified over a supply voltage range of 2.8V to 6V. Both master and slaves are configured as transceivers permitting bit sequential data to flow in either direction, but only one direction at a time, with data read and written least significant bit (LSB) first. An economical DS9097U COM port adapter interfaces the RS-232 to the net. A DS2480 serial 1-Wire line driver chip is also available to generate the proper signals and programmable waveforms that maximize performance.

Data on the 1-Wire net is transferred by time slots. For example, to write a logic one to a slave, the master pulls the bus low for 15µs or less. To write a logic zero, the master pulls the bus low for at least 60µs to provide timing margin for worst-case conditions. A system clock is not required, as each 1-Wire part is self-clocked by its own internal oscillator synchronized to the falling edge of the master. Power for chip operation is derived from the bus during idle communication periods when the DATA line is at 5V by including a half-wave rectifier on each slave.

Whenever the data line is pulled high, the diode in the half-wave rectifier turns on and charges an on-chip capacitor. When the voltage on the net drops below the voltage on the capacitor, the diode is reverse biased, which isolates the charge. The resulting charge provides the energy source to power the slave during the intervals when the net is pulled low. The amount of charge lost during these periods is replenished when the data line returns high. This concept of "stealing" power from the net using a half-wave rectifier is referred to as "parasite power".

When communicating, the master resets the network by holding the bus low for at least 480µs, releasing it, and then looking for a responding presence pulse from a slave connected to the line. If a presence pulse is detected, it then accesses the slave by calling its address, controlling the information transfer by generating time slots and examining the response from the slave. Once this handshake is successful, the master issues necessary device-specific commands and performs any needed data transfers between it and the slave. The master can select a single slave from many on the net because of its unique digital address.

A Unique Address for Every Part?

Within each 1-Wire slave is stored a lasered ROM section with its own guaranteed unique, 64-bit serial number that acts as its node address. This globally unique address is composed of eight bytes divided into three main sections. Starting with the LSB, the first byte stores the 8-bit family codes that identify the device type. The next six bytes store a customizable 48-bit individual address. The last byte, the most significant byte (MSB), contains a cyclic redundancy check (CRC) with a value based on the data contained in the first seven bytes. This allows the master to determine if an address was read without error. With a 248 serial number pool, conflicting or duplicate node addresses on the net are never a problem.

Because 1-Wire devices can be formatted with a file directory like a floppy disk, files can be randomly accessed and changed without disturbing other records. Information is read or written when the master addresses a device connected to the bus, or an iButton is touched to a probe somewhere along the 1-Wire net. The inclusion of up to 64k of memory in 1-Wire chips allows standard information such as employee name, ID number, and security level to be stored within the device. Maximum data security can be provided by 1-Wire chip implementation of the US government-certified Secure Hash Algorithm (SHA-1).

Historically, the 1-Wire net was envisioned as a single twisted pair routed throughout the area of interest with 1-Wire slaves daisy-chained where needed. However, if the network is heavily loaded, it may be preferable or even necessary to separate the bus into sections. This has the added benefit of providing information about the physical location of a 1-Wire device on the bus, which facilitates troubleshooting. By using one section as the main "trunk" and adding or removing segment "branches" with a DS2409 as needed, a true 1-Wire net is created. This also reduces the load seen by the bus master to that of the trunk and those segments connected to it by activated DS2409s.

Consequently, the DS2409 MicroLAN coupler is a key component for creating complex 1-Wire nets. It contains MAIN and AUX transmission-gate outputs and an open-drain output transistor (CONT), each of which can be remotely controlled by the bus master. A simple 1-Wire branch with DS2430 EEPROM connected to label the node provides tagging information specific to that particular node such as location and function. The LED attached to the CONT output provides visual indication of the specific branch being addressed and can be blinked by software for extra visual impact."Excerpt from http://www.maxim-ic.com/appnotes.cfm/appnote_number/1796

OLPC uses a DS2756 that communicates with a kb3700 via the 1 wire protocol, the DS2657 has all the info about the type,charging, battery state..etc. of the battery, the main component is the EEPROM inside the DS2756 and how to read it.

67 comments:

Anonymous
said...

top [url=http://www.001casino.com/]casino[/url] brake the latest [url=http://www.realcazinoz.com/]casino online[/url] free no consign bonus at the best [url=http://www.baywatchcasino.com/]no lay down gratuity [/url].