Top

Choosing the Right 1-Wire Master for the Embedded Applications

Reference Design Disclaimer See the  Important Notice and Disclaimer  covering reference designs and other Maxim resources.

Description

Introduction

The 1-Wire bus is a simple signaling scheme that performs half-duplex bidirectional communications between a master controller and one or more slaves sharing a common data line. Both power delivery and data communication take place over this single line, making 1-Wire devices unmatched in their ability to provide key functions to systems where interconnect must be minimized. The 1-Wire products provide combinations of memory, mixed-signal, and secure authentication functions through a single-contact serial interface. Typical applications of 1-Wire devices are identification of print cartridges or medical consumables, calibration and control of rack cards, identification and authentication of printed circuit boards (PCBs), accessories, and peripherals, protection of intellectual property, clone prevention, and secure feature control.

To take advantage of 1-Wire technology, one needs a 1-Wire master that generates the waveforms necessary to identify the devices on the bus and to communicate with them. There are numerous ways to implement a 1-Wire master. This application note discusses a variety of 1-Wire master implementations which help designers to choose the right solution for their embedded application. It mainly focuses on the master-end of a 1-Wire circuit. For help designing a full 1-Wire system using long lines and multiple slave devices, refer to the "Application Note 148: Guidelines for Reliable Long Line 1-Wire® Networks."

The 1-Wire masters showcased in this application note vary in terms of their operating voltage, ranging between 1.8V to 5V. If a 1-Wire master's operating voltage does not agree with that of the target slave devices (i.e., 3.3V master communicating with 1.8V slaves), a voltage-level shifter is recommended. For more details, refer to the "Application Note 7106: How To Level Shift 1-Wire Systems".

1-Wire Glossary

There are several terms commonly found in 1-Wire documents that should be explained at the outset.

Operating Voltage

Typically, 1-Wire devices function over the following voltage ranges:

  • 1.71V (min) to 1.89V (max)
  • 2.97V (min) to 3.63V (max)
  • 2.8V (min) to 5.25V (max)

The most 1-Wire devices have no pin for a power supply. Such devices are parasitically supplied with power through the 1-Wire communication line. Therefore, operating voltage and 1-Wire pullup voltage are practically synonymous. The higher the operating (pullup) voltage, the more power the 1-Wire devices can receive.

Strong Pullup

Strong pullup refers to a means for providing extra power to the 1-Wire network between time slots. Extra power is needed for several functions by the electrically erasable programmable read-only memory (EEPROM) devices, such as when copying data from a buffer to EEPROM cells, for secure memories when the crypto engine is running, or for 1-Wire temperature sensors during a temperature conversion. When such 1-Wire devices are used in a 1.8V or 3V environment, strong pullup is necessary; in a 5V environment with the same 1-Wire slaves, strong pullup may be optional. For guidance on when to use strong pullup or how to find the right pullup resistor value, refer to the "Application Note 4255: How to Power the Extended Features of 1-Wire Devices".

1-Wire Timing

This is a general expression for the shape of the 1-Wire time slots and the reset/presence detect sequence, and the means to generate these waveforms. One can use special hardware (e.g., chips with their own timing generator) or simply generate the waveforms through software. The hardware method is easier for the software developer but requires another chip. The software method saves on hardware cost but likely increases the cost of software development and testing.

Overdrive Support

The most 1-Wire slaves can communicate at two speeds: standard speed and overdrive speed. In overdrive, the timing is approximately eight times faster than at standard speed. All masters discussed in Categories 2 and 3 (see the discussion in the 1-Wire Master Circuits section) support overdrive. In Category 1, the overdrive support depends on the capabilities of the microcontroller (e.g., clock rate, number of clock cycles per instruction cycle).

Active Pullup

The 1-Wire bus or network is an open-drain environment, with 0V (logic 0) being the active state. When idle, the bus is pulled high to the pullup voltage through a resistor (resistive pullup). Falling edges, consequently, are sharp; rising edges, due to the resistor and the parasitic supply, can be quite slow. Active pullup refers to a method that tests rising edges and, if a specific threshold has been crossed, bypasses the pullup resistor for a limited time with a low-impedance path. Active pullup is generally not needed in short networks or with a single slave device. If available, active pullup recharges the 1-Wire line faster than resistive pullup and, therefore, supports multiple 1-Wire slaves in the network without having to extend the recovery time between time slots. The 1-Wire masters differ in the strength (impedance) of the bypass and the method that controls the duration of the active pullup.

1-Wire Master Circuits

This section discusses the various master circuits in detail. The circuits are grouped into three categories:

  • Microprocessor Port-Pin
  • Maxim's Hardware 1-Wire Masters
  • Synthesizable 1-Wire Bus Master (Application-Specific Integrated Circuit (ASIC)/Field Programmable Gate Array (FPGA))

Each category presents one or more circuits. It shows the schematic, lists the prerequisites, weighs upsides and downsides, hints on what to watch for, and recommends additional reading and URLs to supporting software.

Category 1. Creating a Master using a Microprocessor Port-Pin

Figure 1 shows the most basic implementation of a 1-Wire master.

Unidirectional port pins with optional circuit for strong pullupFigure 1. Unidirectional port pins with optional circuit for strong pullup (dashed lines).

 

As the only prerequisite, this circuit requires one spare bidirectional port and some spare space in the program memory. The upside of this circuit is its low hardware cost. On the downside, the 1-Wire timing is generated through software, which can increase the initial software development time and cost.

Depending on the 1-Wire slaves in the application and on the 1-Wire pullup voltage, an additional port pin may be required to implement a strong pullup. The maximum operating voltage on the 1-Wire bus is determined by the characteristics of the bidirectional port. With more than one slave on the 1-Wire bus, the value of RPUP needs to be lowered. In that case, check whether the resulting VOLMAX is compatible to the 1-Wire slaves and to the microprocessor's port input characteristics.

Communication at overdrive speed requires a microcontroller with a high clock frequency and/or a low number of clock cycles per instruction cycle. For the additional information, refer to the "Application Notes 3829: Determining the Recovery Time for Multiple-Slave 1-Wire Networks, and 126: 1-Wire Communication Through Software".

Figure 2 shows another basic circuit similar to Figure 1.

Bidirectional port pin with optional circuit for strong pullup)Figure 2. Bidirectional port pin with optional circuit for strong pullup (dashed lines).

 

As a prerequisite, this circuit requires two spare unidirectional ports, a pull-down transistor, and some spare space in the program memory. The upside of this circuit is that it does not need a bidirectional port. On the downside, the 1-Wire timing is generated through software, which can increase the initial software development time and cost.

Depending on the 1-Wire slaves in the application and on the 1-Wire pullup voltage, an additional port pin may be required to implement a strong pullup. The maximum operating voltage on the 1-Wire bus is determined by the characteristics of the input port. With more than one slave on the 1-Wire bus, the value of RPUP needs to be lowered. In that case, check whether the resulting VOLMAX is compatible with 1-Wire slaves and the microprocessor's port input characteristics.

Communication at overdrive speed requires a microcontroller with a high clock frequency and/or a low number of clock cycles per instruction cycle. For the additional information, refer to the "Application Notes 3829: Determining the Recovery Time for Multiple-Slave 1-Wire Networks, and 126: 1-Wire Communication Through Software".

Category 2. Maxim's Hardware 1-Wire Masters

Maxim produces a wide range of 1-Wire master hardware products that can also be used to reliably drive a network of 1-Wire slave devices. Such masters are most commonly referred to as "1-Wire Bridge" devices and, as the name implies, are used to "bridge" the interface between a system's host processor (e.g., microcontroller, FPGA, PC, etc.) and a 1-Wire slave. To elaborate, by integrating a bridge device between a host processor and a 1-Wire slave, the host processor no longer interfaces directly to the 1-Wire slave in order to operate it. The host processor, instead, interfaces with the bridge device via a specific communication protocol such as I2C and commands it to relay 1-Wire data to the 1-Wire slave. The benefit of this is that the 1-Wire communication is offloaded from the host processor and onto the 1-Wire bridge device, thereby relieving the host processor from generating time-critical 1-Wire waveforms. As a result, the entire software application can be developed in high-level language, and the initial software development time and cost is significantly reduced.

Apart from generating a fundamental 1-Wire protocol, a 1-Wire bridge device includes additional features that can help drive a 1-Wire line more efficiently. For example, every 1-Wire bridge device includes an internal passive pullup (i.e., RPUP) to help reduce the number of external hardware components needed. The following products introduced are some of Maxim's best 1-Wire bridge devices along with their outstanding features to help designers choose the right fit for their application. A typical application circuit for each device is provided for reference on how to setup.

DS2480B

The DS2480B 1-Wire master simplifies the design of a low-cost, universal RS-232 COM port to the 1-Wire interface. This device includes:

  • An internal active pullup (APU) that is automatically employed after crossing a threshold on the rising edges of the 1-Wire line, for effortless driving of multiple devices on the 1-Wire bus.
  • An internal strong pullup (SPU) that can optionally be enabled per the power requirements of a 1-Wire slave device.
  • A built-in 4-bit search accelerator, which makes the 1-Wire read-only memory (ROM) search sequence easier to implement in software.
  • The ability to program 1-Wire erasable programmable read-only memory (EPROM) devices using an external 12V power supply.
  • Programmable 1-Wire timing and driver characteristics to accommodate a wide range of slave device configurations at standard speed.
  • An operating voltage range over 5V +-10%.

The DS2480B interfaces directly to universal asynchronous receiver-transmitter (UART) and 5V RS232 systems and can communicate at the speed of up to 115.2kbps. The circuit in Figure 3 shows how to integrate the DS2480B into a compatible system.

DS2480B connected to a host microcontroller UART portFigure 3. DS2480B connected to a host microcontroller UART port

For the additional information, refer to the "Application Notes 192: Using the DS2480B Serial 1-Wire Line Driver, and 4104: Configurations of 1-Wire Timing of the DS2480B", as well as the DS2480B data sheet. Download the source code for the Application Note 192 from here.

DS2484

The DS2484 is an entry-level I2C to 1-Wire master that includes:

  • A built-in voltage level translator which allows the DS2484 to operate at various voltage levels on the 1-Wire side, ranging from 1.8V -5% to 5V +5%, independent of the I2C operating voltage.
  • An internal active pullup (APU) and selectable passive pullup (RPUP) values for efficient long-distance operation of 1-Wire devices.
  • An internal strong pullup (SPU) that can optionally be enabled per the power requirements of a 1-Wire slave device.
  • A built-in 1-Wire triplet command for making the 1-Wire ROM search sequence easier to implement in software.
  • Power control over the 1-Wire port to power down devices on the bus via software.
  • Low-power mode pin (SLPZ) for conserving power consumption when the DS2484 is not in use.
  • Adjustable 1-Wire timing parameters to support a wide range of 1-Wire slaves.

The DS2484 interfaces directly to an I2C master and can communicate at speeds of up to 400kHz. The circuit in Figure 4 shows how to integrate the DS2484 into a compatible system.

Figure 4. DS2484 connected to a host microcontroller I2C port.

The DS2484 is software compatible with the older DS2482. For the additional information on related software development, refer to the "Application Note 3684: How to Use the DS2482 I2C 1-Wire Master".

DS2485

The DS2485 is a comprehensive 1-Wire master that is optimized for higher throughput and offers full control over its extensive feature set. This device includes:

  • Scripting capability for executing custom sequences of 1-Wire primitive commands.
  • Built-in 1-Wire search algorithm to easily discover and fetch device ROM IDs on the 1-Wire bus on command.
  • Large 1-Wire block buffer with a size of 126 bytes for high data throughput.
  • Adjustable 1-Wire timing parameters for both standard and overdrive to support a wide range of 1-Wire slaves.
  • Three 32-byte pages of EEPROM for user data.
  • An internal selectable active pullup (APU) and selectable passive pullup (RPUP) values for efficient long-distance operation of 1-Wire devices.
  • An internal strong pullup (SPU) that can optionally be enabled per the power requirements of a 1-Wire slave device.
  • Power control over the 1-Wire port to power down devices on the bus via software.
  • A GPIO pin for application specific control features.
  • An operating voltage range over 3.3V ±10%.

The DS2485 interfaces directly to an I2C master and can communicate at the speed of up to 1MHz. The circuit in Figure 5 shows how to properly integrate the DS2485 into a compatible system.

DS2485 connected to a host microcontroller I2C portFigure 5. DS2485 connected to a host microcontroller I2C port.

DS2465

The DS2465 is a 1-Wire master and SHA-256 coprocessor designed to operate with 1-Wire SHA-256 secure authenticators. This device includes:

  • A core set of cryptographic tools including:
    • A built-in SHA-256 engine for cryptographic authentication of 1-Wire SHA-256 slave devices.
    • Two 32-byte pages of EEPROM for user data.
  • An internal active pullup (APU) and selectable passive pullup (RPUP) values for efficient long-distance operation of 1-Wire devices.
  • An internal strong pullup (SPU) that can optionally be enabled per the power requirements of a 1-Wire slave device.
  • Low-power mode pin (SLPZ) for conserving power consumption when the DS2465 is not in use.
  • A built-in 1-Wire triplet command for making the 1-Wire ROM search sequence easier to implement in software.
  • Power control over the 1-Wire port to power down devices on the bus via software.
  • Adjustable 1-Wire timing parameters for both standard and overdrive to support a wide range of 1-Wire slaves.
  • An operating voltage range over 3.3V ±10%.

The DS2465 interfaces directly to an I2C master and can communicate at the speed of up to 400kHz. The circuit in Figure 6 shows how to properly integrate the DS2465 into a compatible system.

DS2465 1-Wire master connected to multiple 1-Wire SHA-256 devicesFigure 6. DS2465 1-Wire master connected to multiple 1-Wire SHA-256 devices.

DS2477

The DS2477 is a 1-Wire master and SHA-3 coprocessor designed to operate with 1-Wire SHA3-256 secure authenticators. This device includes:

  • A core set of cryptographic tools including:
    • A built-in SHA-3 engine for cryptographic authentication of 1-Wire SHA-3 slave devices.
    • ChipDNA physically unclonable function (PUF) technology to protect device data from security attacks.
    • 2Kb of EEPROM for user data and key storage.
    • A Federal Information Processing Standard (FIPS)/National Institute of Standards and Technology (NIST) compliant true random generator (TRNG).
    • A unique and unalterable factory-programmed 64-bit identification number (ROM ID).
  • An internal active pullup (APU) and selectable passive pullup (RPUP) values for efficient long-distance operation of 1-Wire devices.
  • An internal strong pullup (SPU) that can optionally be enabled per the power requirements of a 1-Wire slave device.
  • Power control over the 1-Wire port to power down devices on the bus via software.
  • Adjustable 1-Wire timing parameters to support a wide range of 1-Wire slaves.
  • Large 1-Wire block buffer with a size of 126 bytes for high data throughput.
  • A GPIO pin for application specific control features.
  • An operating voltage range over 3.3V ±10%.

In lab tests, the DS2477 was able to successfully drive 50 DS1990 1-Wire slave devices over 1000 feet using a 333Ω pullup resistor setting. The DS2477 interfaces directly to an I2C master and can communicate at speeds of up to 1MHz. The circuit in Figure 7 shows an example application of the DS2477 driving multiple 1-Wire SHA-3 slave devices, such as the DS28E50.

Figure 7. DS2477 connected to a host microcontroller I2C port with DS28E50 slaves.

For the additional information on using the DS2477 with a SHA-3 enabled authenticator, refer to the "Application Note 6896: Why Now is a Good Time to Secure Your Embedded Systems with SHA-3".

Category 3. Synthesizable 1-Wire Bus Master (ASIC/FPGA)

The circuit in Figure 8 is very similar to that in Figure 1. The difference is that the microcontroller and 1-Wire port are embedded in an ASIC or FPGA.

Figure 8. ASIC/FPGA with optional circuit for strong pullup (dashed lines).

As the main prerequisite, this circuit requires an ASIC or FPGA with microcontroller capability, at least one spare bidirectional port pin, 3470 unused gates, and some spare space in the program memory. In this circuit, the 1-Wire timing is generated by hardware, which can reduce the initial software development time and cost. Consequently, the entire application software can be written in high-level language.

The 1-Wire operating voltage is limited by the port characteristics of the ASIC/FPGA. Depending on the 1-Wire slaves in the application and on the 1-Wire pullup voltage, an additional port pin may be required to implement a strong pullup. With more than one slave on the 1-Wire bus, the value of RPUP needs to be lowered; in this latter case, check whether the resulting VOLMAX is compatible with 1-Wire slaves and port input characteristics.

For the additional information, refer to the "Application Notes 119: Embedding the 1-Wire Master in FPGAs or ASICs, 145: Interfacing the 1-Wire Master (DS1WM) to an ARM7 Processor, and 3829: Determining the Recovery Time for Multiple-Slave 1-Wire Networks".

For a description of the DS1WM core, refer to the "Application Note 5507: Understanding the DS1WM Synthesizable 1-Wire Bus Master". To obtain the 1-Wire master Verilog®/VHDL code, submit a tech support request. Examples of application software are included in the aforementioned application note 145.

PC-Based Adapters and Evaluation Kits

Since they do not require any software development by the user, PC attachments that function as a 1-Wire masters and the device-specific evaluation kits (EV kits) are very convenient for evaluating 1-Wire devices and for prototyping.

For the adapter-based solution, besides the adapter, the 1-Wire devices to explore, and some off-the -shelf cabling, all the user needs is the evaluation software, such as the Java®-based OneWireViewer which is available for free download.

The EV kits are more convenient than using a standalone adapter as they contain everything that is needed to carry out the prototyping and exploration. The evaluation kits also include a USB-to-I2C or USB-to-I2C/1-Wire adapter.

In addition to the free evaluation software included with the EV kits, C-based free demonstration code examples are also available from Maxim upon request. Table 1 shows the details of some available evaluation platforms.

Table 1. PC-Based Adapters and EV Kits

Port Type Adapter/Kit Part Number 1-Wire Master Supported Notes
USB DS9481R-3C7+ DS2480B For iButton evaluation use: DS1402D-DR8 cable or DS1402D-DR8+ Blue Dot receptor
For other 1-Wire devices use: DS9120 socket boards
USB DS2484EVKIT# DS2484 Contains: DS2484 evaluation board, DS9400 USB-to-I2C adapter, USB cable
USB DS28E50VKIT# DS2477 Contains: 5 each of DS2477 and DS28E50 in TDFN package, 2 DS9120BQ+ evaluation boards, and 1 DS9481P-300 USB-to-I2C/1-Wire adapter
USB DS2485EVKIT# DS2485 Contains: 5 each of DS2485 and DS28E07 in TDFN package, 2 DS9120BQ+ evaluation boards, and 1 DS9481P-300 USB-to-I2C/1-Wire adapter

Conclusion

The right 1-Wire master for an embedded application is the one that meets the electrical requirements for the 1-Wire device(s) (i.e., operating voltage, strong pullup if needed) at a reasonable cost but provides the best overall functionality. The final choice depends on the spare (unused) resources in the application, which can be port pins, a UART or I2C bus, and space in program memory. Currently, the hardware 1-Wire masters provided by Maxim (Category 2) are the most versatile options available in the market at a very reasonable cost. They are feature-rich and programmable to support any and all 1-Wire systems, including the ones with high security requirements.

Trademarks

  • 1-Wire and iButton are registered trademarks of Maxim Integrated Products, Inc.
  • Blue Dot and ChipDNA are trademarks of Maxim Integrated Products, Inc.
  • Java is a registered trademark of Oracle and/or its affiliates.

Icon

Designed, Built, Tested

Board pictured here has been fully assembled and tested. Not available for sale.

 

Maxim Devices (11)

Part Number Name Product Family Order Design kits and evaluation modules
DS2482-101 Single-Channel 1-Wire® Master with Sleep Mode Controllers/Expanders Buy Now Not Available
DS2480B Serial to 1-Wire Line Driver Controllers/Expanders Buy Now Not Available
DS80C400 Network Microcontroller MCU - Microcontroller Buy Now Not Available
DS80C410 Network Microcontrollers with Ethernet and CAN MCU - Microcontroller Buy Now Not Available
DS9490 USB to 1-Wire/iButton Adapter Universal Serial Bus (USB) Buy Now Not Available
DS9097U Universal 1-Wire COM Port Adapter iButton Buy Now Not Available
DS1411 Serial Port iButton Holder iButton Buy Now Not Available
DS2490 USB to 1-Wire Bridge Chip Controllers/Expanders Buy Now Not Available
DS2482-800 8-Channel 1-Wire Master Controllers/Expanders Buy Now Not Available
DS2482-100 Single-Channel 1-Wire Master Controllers/Expanders Buy Now Not Available
DS80C411 Network Microcontrollers with Ethernet and CAN MCU - Microcontroller Buy Now Not Available

Maxim Devices (11)

Part Number Product Family
Controllers/Expanders
Single-Channel 1-Wire® Master with Sleep Mode
Not Available
Controllers/Expanders
Serial to 1-Wire Line Driver
Not Available
MCU - Microcontroller
Network Microcontroller
Not Available
MCU - Microcontroller
Network Microcontrollers with Ethernet and CAN
Not Available
Universal Serial Bus (USB)
USB to 1-Wire/iButton Adapter
Not Available
iButton
Universal 1-Wire COM Port Adapter
Not Available
iButton
Serial Port iButton Holder
Not Available
Controllers/Expanders
USB to 1-Wire Bridge Chip
Not Available
Controllers/Expanders
8-Channel 1-Wire Master
Not Available
Controllers/Expanders
Single-Channel 1-Wire Master
Not Available
MCU - Microcontroller
Network Microcontrollers with Ethernet and CAN
Not Available

Related Videos

View All Videos