1-Wire Communication

The basis of 1-Wire technology is a serial protocol using a single data line plus a ground reference for communication. The 1-Wire protocol uses CMOS/TTL logic and operates at a supply voltage ranging from 2.8V to 6V.

Overview of the 1-Wire BUS

The 1-Wire bus is a simple, low-cost communication protocol primarily designed for connecting multiple devices over a single data line and a ground line. Though the Dallas 1-Wire and MaxDetect (or DHT) 1-Wire protocols use a single data line, they operate differently and are incompatible due to timing, signaling, and data structures. Here’s an overview of each:

General Features of the 1-Wire Bus

  • Single Wire Communication: Both protocols use a single data line (plus ground) for communication, making them simple and cost-effective.
  • Master-Slave Architecture: In both protocols, a master (typically a microcontroller) initiates communication with one or more slave devices.
  • Half-Duplex Communication: The data line is shared for sending and receiving data, meaning devices communicate in only one direction at a time.


Dallas 1-Wire Protocol

Dallas 1-Wire Protocol (Used by Maxim Integrated Devices)

Overview:

The Dallas 1-Wire protocol, developed by Dallas Semiconductor (now Maxim Integrated), is the most well-known 1-Wire protocol. It is widely used in temperature sensing, data logging, and device identification applications. It is especially popular for its simplicity and ability to communicate with multiple devices on the same bus.

Key Characteristics:

  • Physical Structure: A single data line plus ground.
  • Device Addressing: Each Dallas 1-Wire device has a unique, factory-programmed 64-bit address, which allows multiple devices to coexist on the same bus.
  • Parasitic Power: Many Dallas 1-Wire devices can operate in “parasitic power” mode, drawing power from the data line itself, which reduces the need for an additional power line.
  • Timing and Protocol: Communication is managed through specific timing sequences (reset, presence detection, read, and write). Data is typically sent as bits in time slots.
  • Use Cases: Commonly used for devices such as temperature sensors (e.g., DS18B20), ID chips (e.g., DS2401), EEPROM storage (e.g., DS2431), and secure authentication.

Typical Applications:

  • Temperature Monitoring: Often used for industrial and consumer temperature monitoring.
  • Device Identification: Allows unique identification of connected devices.
  • Data Storage: Small, secure EEPROM devices.

Dallas 1-Wire Protocol

Initialization Procedure

Reset and Presence Pulses Phase

Dallas 1Wire Protocol Reset s

The Dallas 1-Wire initialization procedure is a critical part of establishing communication between the master (typically a microcontroller) and one or more slave devices (such as temperature sensors, memory chips, or ID chips) on the 1-Wire bus. The initialization procedure consists of two main steps: the Reset Pulse and the Presence Pulse. These signals ensure synchronization between the master and slave(s) and confirm that at least one slave device is on the bus and ready for communication.

Step 1: Reset Pulse

The Reset Pulse is generated by the master device to signal the beginning of communication and synchronize all devices on the bus.

Detailed Process of the Reset Pulse:

  1. Master Pulls the Bus Low:
    • The master initiates the reset procedure by pulling the 1-Wire bus line low for a specific duration. This low signal informs any slave device on the bus that a communication session is about to begin.
    • The master must hold the bus low for 480 μs or longer (typical values range from 480 μs to 960 μs).
  2. Master Releases the Bus:
    • After holding the bus low, the master releases it, allowing the line to return to a high (idle) state.
    • This high period, following the low reset pulse, allows slave devices to detect the reset signal and prepare to respond.
    • The idle high period typically lasts for 15 to 60 μs.

Purpose of the Reset Pulse:

  • The reset pulse serves as a signal to all connected devices to prepare for communication. All slaves that detect this reset pulse know that the master is requesting a presence check, and they should respond accordingly if they are functional and ready.

Step 2: Presence Pulse

After detecting the reset pulse, each slave device on the 1-Wire bus responds with a Presence Pulse to confirm its presence and readiness for communication.

Detailed Process of the Presence Pulse:

  1. Slave Detects the Reset Pulse:
    • When a slave device detects the reset pulse, it waits for a short period (usually around 15 to 60 μs) after the master releases the bus to confirm that the reset pulse has ended.
  2. Slave Pulls the Bus Low:
    • The slave device then pulls the bus low to signal its presence. This low pulse, known as the presence pulse, informs the master that one or more devices are on the bus and ready to communicate.
    • The duration of the presence pulse is typically 60 to 240 μs.
  3. Slave Releases the Bus:
    • After holding the presence pulse, the slave releases the bus, allowing it to return to the idle high state.
    • Once the bus returns to high, the master can proceed with the following communication steps: ROM or data commands.

Purpose of the Presence Pulse:

  • The presence pulse serves as an acknowledgment from the slave(s) to the master, confirming that at least one device is on the bus and ready for further commands.
  • If no slave device pulls the line low after the reset pulse, the master can assume that no devices are connected or responding.

Summary of Timing

Here’s a summary of the timing requirements for the Dallas 1-Wire initialization procedure:

StepSignalDuration
Reset Pulse Master pulls low ≥ 480 μs
Master releases 15 ~ 60 μs
Presence Pulse Slave pulls low 60 ~ 240 μs
Slave releases

Additional Notes: 

  • Timing Sensitivity: The Dallas 1-Wire protocol is highly timing-sensitive, so precise timing is crucial. If the timing is incorrect, the devices may not correctly interpret the reset and presence pulses, leading to communication errors.
  • Multiple Slaves: The presence pulse is shared on the bus, meaning that if multiple slave devices are present, they all respond with a presence pulse. The master only needs to detect the low signal and does not differentiate between multiple slaves based on the "presence pulse".

Comparison of Dallas and MaxDetect 1-Wire Protocols

FeatureDallas 1-Wire ProtocolMaxDetect (DHT) 1-Wire Protocol
Devices Supported Temperature sensors, ID chips, EEPROM, secure ICs Primarily temperature and humidity sensors
Addressing Unique 64-bit address for each device No unique address, typically single sensor per line
Communication Direction Bi-directional (half-duplex) Unidirectional (sensor to master only)
Parasitic Power Support Yes No
Data Format Custom data sequences (typically binary) Fixed 40-bit data (humidity + temperature + checksum)
Applications Multipurpose, data logging, authentication Environmental monitoring

Key Takeaways

  • Compatibility: Dallas 1-Wire devices and MaxDetect (DHT) sensors are incompatible due to protocol design, timing, and data structure differences.
  • Applications: Dallas 1-Wire is versatile and used for identification, sensing, and data storage, while MaxDetect 1-Wire is specific to certain types of sensors.
  • Device Diversity: Dallas 1-Wire supports a wider range of devices with unique addresses, allowing multiple devices on one bus, while MaxDetect 1-Wire typically supports only one sensor per data line.

© 2024 Air Supply Information Center (Air Supply BBS)