The 1-Wire bus is a simple signal transmission circuit that enables half-duplex bidirectional communication between the main controller and one or more slave devices via a common data line. Power and data communications are transmitted over a single data line, giving 1-Wire devices unparalleled power to reduce interconnects between systems. 1-Wire devices provide memory, mixed-signal, and secure authentication through a patented, single-contact serial interface. Typical applications for 1-Wire devices are as follows: identification of print cartridges or medical consumables; calibration and control of rack cards; identification and certification of printed circuit boards, accessories and peripherals; intellectual property protection, anti-cloning, and safety function control.
With 1-Wire technology, signals are sent through the 1-Wire master to identify and communicate with devices on the bus. There are many ways to build a 1-Wire host. This article discusses hosts for embedded applications, including small networks with a radius of no more than 1 meter and no more than three to five 1-Wire slaves. Refer to Application Note 148, "1-Wire Network Reliable Design Guide" when designing a 1-Wire large network or a large number of slaves.
1-Wire terminology
First explain the common terms in several 1-Wire documents.
Host interface
The circuits discussed in this article are 1-Wire master controllers, all of which communicate with 1-Wire slaves. However, these 1-Wire master controllers cannot be used as separate bodies and require a host (computer) to tell them how they work on the 1-Wire side. The host interface refers to the type of connection between the 1-Wire master controller and the "more advanced commander in the system" (ie, the host).
Operating Voltage
Typically, 1-Wire devices operate from 2.8V (min) to 5.25V (max). Most 1-Wire devices do not have a power supply pin. Therefore, the device draws power from the 1-Wire communication line in a parasitic power supply. The operating voltage and the 1-Wire pull-up voltage are actually synonymous. The higher the operating (pull-up) voltage, the greater the power the 1-Wire device will get. The higher the voltage, the more 1-Wire slaves can be attached to the network and the shorter the recovery time between time slots.
Strong pull up
Strong pullup refers to a method of providing additional power to a 1-Wire network between time slots. The parts that require additional power are as follows: EEPROM device (when copying data from buffer to EEPROM unit); secure memory (when SHA-1 engine is running); 1-Wire temperature sensor (during temperature conversion). Strong pull-ups are required when these 1-Wire devices are used for 3V supply; strong pull-ups are optional when the same 1-Wire slave is in a 5V environment.
1-Wire timing
The general form of the 1-Wire time slot and reset/acknowledgement detection timing waveforms, as well as the methods for generating these waveforms, are described below. Special hardware (such as a chip with its own timing generator) can be used or the waveform can be generated directly by software. For software developers, the hardware approach is easier, but requires additional chips. The software approach saves on hardware costs, but if the selected microcontroller does not have software support, it may increase software development and testing costs. If the application is written in a high-level language, special consideration is required when using software. For low-level functions that generate time slots and reset/acknowledgement detection timing, it is necessary to write in assembly language so that the number of clock cycles required to execute an instruction can be calculated.
Support high speed mode
Most 1-Wire slaves can communicate at two speeds: standard speed and high speed mode. The speed in high speed mode is about 8 times faster than the standard speed. Standard speed communication is supported on all 1-Wire slaves. All Class 2 to Class 4 hosts (mentioned below) support high speed mode. Whether a Class 1 host supports high speed mode depends on the microcontroller performance (clock rate, number of clock cycles required per instruction cycle).
Active pullup
The 1-Wire bus or network is an open-drain environment with 0V (logic 0) active. When idle, the bus is pulled high through a resistor to the pull-up voltage (resistance pull-up). Therefore, the falling edge is steep; the rising edge is quite gentle due to the effects of the resistor and the parasitic power source. Active pull-up is a method of testing the rising edge. If the specified threshold has been exceeded, the pull-up resistor is bypassed for a limited time through the low-impedance channel. Small networks or networks with only one slave generally do not require active pullups. With source pullups, the 1-Wire bus is recharged much faster than the resistor pullup, so there is no need to extend the recovery time between time slots when multiple 1-Wire slaves are supported in the network. The bypass pull-up strength (impedance) of various 1-Wire masters and the method of controlling the active pull-up time are different.
1-Wire master circuit
The different host circuits are discussed in detail below. The circuit is divided into the following four categories:
Microprocessor port - pin connection
Microcontroller with built-in 1-Wire master
Synthesized 1-Wire bus master
Serial interface protocol conversion
Each category describes one or more circuits. The circuit schematic is given, the preconditions are listed, the advantages and disadvantages are measured, and the precautions, recommended reference documents and supporting software websites are given.
Class 1. Microprocessor port - pin connection
Figure 1 shows the most basic 1-Wire master.
The only prerequisite for the circuit is the need for an alternate bidirectional port and a certain amount of program memory space. The advantage of the circuit is that its extra hardware cost is extremely low, requiring only one pull-up resistor. The downside is that 1-Wire timing is generated by software, increasing the time and cost of previous software development. Depending on the number of 1-Wire slaves and 1-Wire pull-up voltages in the application, additional port pins are required to achieve strong pullups. The maximum operating voltage of the 1-Wire bus depends on the bidirectional port characteristics (preferably with a 5V tolerance). When multiple slaves are attached to the 1-Wire bus, the RPUP value should be lower. If so, check if VOLmax is compatible with the input characteristics of the 1-Wire slave and microprocessor port. The high speed communication mode requires the microprocessor to have a high clock frequency and/or a low number of clocks per instruction cycle. For more information, see application note 3829: "Determining Recovery Time for Multi-Slave 1-Wire Networks" and Application Note 126: "I-Wire Communication with Software." See the 1-Wire Public Domain Kit for an example application.

Figure 1. Bidirectional Port Pin with Optional Strong Pullup (Dotted Line)

Wenzhou Niuniu Electric Co., Ltd. , https://www.anmuxisocket.com