下载
![](https://oss-datasheet.aipcba.com/html/76621C4AA9BC6E229768F002739A9298/bg1.png)
Maxim > Design Support > Technical Documents > Application Notes > iButton® > APP 159
Keywords: iButton, 1-Wire, OneWire, 1wire, ultra-reliable, communication, techniques, touch, contact,
intermittent, tear
APPLICATION NOTE 159
Software Methods to Achieve Robust 1-Wire®
Communication in iButton® Applications
Sep 22, 2008
Abstract: 1-Wire devices communicate using a single data line plus ground reference. The 1-Wire
protocol includes special provisions to handle highly intermittent ("touch") connections that are common
when using 1-Wire devices in the stainless steel iButton package. This application note explains when
special attention to data integrity is advised, and discusses techniques to achieve the most reliable
communication in i
Button applications. The reader should be familiar with the 1-Wire bus protocol and
the methods to generate 1-Wire communication using a microcontroller. Although the main focus of this
document is on applications with unreliable connections, some of the methods described can improve the
reliability in hardwired 1-Wire applications.
Introduction
1-Wire devices communicate using a single data line plus ground reference. The 1-Wire protocol
together with additional built-in features make i
Buttons suitable for applications that need to cope with
highly intermittent ("touch") connections. When i
Buttons are used for applications such as high-security
identification or monetary transactions, then highly reliable communication is most critical for successful
operation.
General 1-Wire device communication involves several functions: searching (to identify the devices
present on the bus), reading device identification number (also known as network address, registration
number, 64-bit unique ID, and 64-bit lasered ROM), reading device data or status, and writing memory
data or control information. In some cases, it is simple for the software to detect and correct
communication failures. When a failure occurs while reading, for example, the software may attempt to
read the i
Button again, or may rely on the user to remove and reconnect the iButton to start a new
transaction. Such a corrective action causes only a minor delay or annoyance to the user.
Writing to an i
Button, however, is a much more critical task. If the iButton has departed before a read
back to verify, one may not even know that the data was miswritten. If the data was written in error,
there may not be an opportunity to rewrite it. The consequences of an unsuccessful write can be quite
serious. If an i
Button contains monetary data, debits (purchases) usually include writing revised monetary
amounts to the i
Button each time that a purchase is made. Should one of these updates fail and leave
the data in an undefined state, the user may lose the entire monetary balance.
Programs that perform 1-Wire communications over intermittent connections must have a well thought-
out plan for handling retries when failures occur. The software developer must consider everything that
could have occurred during the failed attempt. Detecting errors sooner rather than later yields a faster
Page 1 of 14