
Maxim > Design Support > Technical Documents > Tutorials > 1-Wire® Devices > APP 214
Maxim > Design Support > Technical Documents > Tutorials > i
Button® > APP 214
Maxim > Design Support > Technical Documents > Tutorials > UARTs > APP 214
Keywords: UART, DS9097E, 1-Wire, iButton, bus master, 1-Wire signals, microprocessor, 1wire
TUTORIAL 214
Using a UART to Implement a 1-Wire Bus Master
Sep 10, 2002
Abstract: This application note explains how to use a microprocessor's UART to implement a 1-Wire®
bus master. It includes an explanation of the required electrical interface, UART configuration, and timing
relationship between UART and 1-Wire signals. The flexibility offered in setting up UART byte timing
allows straightforward implementation of 1-Wire time slots as well as the reset and presence detect
pulses. With the inclusion of deep transmit and receive FIFOs, several byte values can be transferred on
the 1-Wire bus with just a few clock cycles per bit required from the main processor.
Introduction
1-Wire devices provide economical solutions for identification, memory, time keeping, measurement and
control. The 1-Wire data interface is reduced to the absolute minimum, i.e., a single data line plus a
ground reference. As most 1-Wire devices provide relatively small amounts of data, the typical data rate
of 16kbps is more than sufficient for the intended tasks. It is often convenient to use a generalpurpose
input/output (GPIO) pin of an 8-bit or 16-bit microcontroller in a "bit banging" manner to act as the bus
master.
However, in 32-bit systems, processor clock frequencies routinely exceed 100MHz and using a GPIO pin
as the 1-Wire bus master consumes an enormous number of clock cycles per 1-Wire bit. In 32-bit
portable systems, precious battery power is consumed while timing the 1-Wire read- and write-time slots.
A few systems off load the burden of bit timing and byte framing operations from the main processor by
including the DS1WM Synthesizable 1-Wire Bus Master* hardware block in their chipset. If the DS1WM
or other hardware 1-Wire master port is not available, communication with 1-Wire devices can be
accomplished easily if a Universal Asynchronous Receiver Transmitter (UART) channel is available.
This application note includes an explanation of the required electrical interface, UART configuration, and
timing relationship between UART and 1-Wire signals. A general understanding of 1-Wire
communications is assumed. Typical timing and logic levels are used in the following discussion and the
reader should refer to particular 1-Wire device data sheets for specific timing and voltage specifications
and tolerances.
Conceptual Overview
Properly configured with respect to baud rate, data bits per character, parity and number of stop bits, a
115,200 bit per second capable UART provides the input and output timing necessary to implement a 1-
Wire master. The UART produces the 1-Wire reset pulse, as well as read- and write-time slots. The