Using the 1-Wire® Link to Acquire Position Information—A Determinant

Publisher:HuanleLatest update time:2011-12-28 Keywords:Link Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Abstract: This paper describes a low-cost serial bus system based on an addressing protocol to identify the physical location of a missing component. This problem may exist in measurement or control serial buses, such as multipoint temperature measurement systems. This paper details how to obtain location information in a low-cost serial bus such as 1-Wire using the DS28EA00 with the link function. This paper was also published in Maxim Engineering Journal, Issue 60 (PDF, 848kB). A common feature of digital bus systems is sharing. With the popularization of microprocessors, parallel bus systems have become more and more popular. All components connected to the bus share data lines and address lines. The chip select signal can be decoded from the address lines and control signals. The physical address of each device connected to the bus is always known according to the hardware design and wiring. As technology progressed to low-cost serial bus systems1, the address lines were first eliminated. However, the SPI™ and MICROWIRE™ serial buses still have a chip select function. Many advanced serial bus systems have introduced protocol-based addressing, which transmits the address information as a preamble to the data. Typical of this type of bus is I²C/SMBus™, which reduces the communication interface to just the data and clock lines. To further reduce costs, the clock information can be embedded in the data stream. Typical of this type of bus is 1-Wire, LIN, and SensorPath® bus. Because of the protocol-based addressing, information about the physical location of the components is lost. This is a problem for instrumentation and control applications that use serial buses (such as measuring multiple temperature points). For the I²C bus, this problem is solved to some extent by connecting the address pins to logic 1, logic 0, SCL or SDA. With this approach, a single pin can be set to 4 different digital states, equivalent to two bits. Although this method is simple and effective, it has certain limitations because the original I²C protocol only provides 7 address bits. The 1-Wire bus has 64-bit addresses, which provides greater flexibility in this regard. In any case, each additional address pin will increase the cost, so adding address pins is not a good option. Figure 1 shows a simple, low-cost solution to re-acquire the physical location of multiple devices on a serial bus, identifying the device at the beginning of the network as position #1 and numbering the devices on the network in sequence. The circuit connections for this solution are shown in the thick blue line in the figure. At position 1, the line is grounded. Figure 1. Serial network with position detection In addition to the two pins labeled IN and OUT in Figure 1, on-chip logic is required to read the IN pin and write the OUT pin. If the protocol supports multi-drop networking, these methods can be used by the host to first identify the first device, then the next device, and so on until all devices are located. The 1-Wire bus is a serial bus system that meets this requirement. The 1-Wire bus is a simple signaling protocol that allows half-duplex, bidirectional communication between a host/master controller and one or more slaves over a common data line (Figure 2). Power and data communication with slaves can be achieved over a single 1-Wire bus. Power is provided by the internal capacitors of the slave device drawing charge from the bus when the bus is high during data transmission and using this charge to power the device when the bus is low. A typical 1-Wire master includes an open-drain I/O pin that is pulled up to a 3V to 5V supply via a resistor. This intelligent communication technique allows memory, authentication, and mixed-signal functionality to be easily and efficiently added at any time. Figure 2. Typical 1-Wire network without link functionality All 1-Wire systems have an important basic feature: Each slave device has a unique, unchangeable (ROM) 64-bit, factory-laser-engraved serial number (ID) that is never duplicated on another device. In addition to providing a unique electronic ID for the end product, the 64-bit ROM ID allows the master to select a device from many slave devices attached to the same bus. The 64-bit ROM ID includes an 8-bit family code that identifies the device type and supported functions. Typically, when the system is initialized, the 1-Wire master may not know the number of devices attached to the bus and their ROM IDs. Using the line-and feature of the bus, the host can use the process of elimination to determine the IDs of all devices attached to the bus. Using the SearchROM* function2, the host can determine the ROM ID of the devices attached to the bus. However, the Search ROM result does not provide the location of a single device. For example, for the device ROM ID shown in Figure 2, the device ID is obtained in the order shown in Table 1. Table 1. Device Search Order









Figure 1. Serial network for position detection.






Figure 2. Typical 1-Wire network without link capability.






Sequence
ROM ID (Hexadecimal)
Position in Network
1
C7000000007AD242
Location #2
2
5A00000000853E42
Location #3
3
16000000008A8142
Location #1

The concept of link function

When using the link function to determine the physical location of a device in a 1-Wire network environment, the following points apply:
  1. The physical layout of the 1-Wire network at the system level is known, i.e. who is first, who is second, etc., and the physical locations of the devices/nodes.
  2. Get the physical connection order of the devices (ROM ID), which one is the first and which one is the last.
Item a) is known system information and can be obtained from the physical layout of the 1-Wire network. Item b) is usually unknown and can be easily obtained using link function communication. The link function (Figure 3) uses two pins, an input pin (active-low EN) to enable the device to respond during the search, and an output pin (active-low DONE) to inform the next device in the chain that the previous device has completed the search. The active-low DONE signal is connected to the active-low EN input of the next device. The active-low EN input of the first device in the chain is connected to GND. The wiring to implement the link function is shown in the figure with thick blue lines. In addition to the active-low EN and active-low DONE pins, the sequential search function requires a new network function command, Conditional Read ROM. This command reports the ROM ID of the device only when certain conditions are met (described below). In contrast, Read ROM causes all devices in the network to send their ROM IDs at the same time. The DS28EA00 is the industry's first device with the new link function (see Figure 3).

Figure 3. Typical connection of a DS28EA00 with link capability in a 1-Wire network.
Figure 3. Typical connection of the DS28EA00 with link function in a 1-Wire network

. In addition to being used for sequential search, the /EN and /DONE pins can also be used as digital PIOs. To achieve this function, the link function defines three link states, OFF, ON, and DONE. The transition of link states is controlled by the Chain command. Table 2 shows the link states and the corresponding working states.

Table 2. Link states
Chain State
Device Behavior
Active-Low EN (PIOB)
Active-Low DONE (PIOA)
Conditional Read ROM
OFF (default)
PIO (high impedance)
PIO (high impedance)
Ignored
ON
Active-low EN input
Pullup on
Recognized if active-low EN is logic 0
DONE
No function
Pulldown on (active-low DONE is logic 0)
Ignored

The default power-up link state is OFF, where DONE (PIOA) and EN (PIOB) are controlled independently by PIO Access Read and PIO Access Write commands, as described in the DS28EA00 data sheet. When the link state is ON, DONE is pulled up to the internal power supply VDD of the device through a 40kΩ on-chip resistor (RCO), which in turn sends a logic '1' signal to the EN pin of the next device. If the EN pin is logic '0', only devices in the ON link state can respond to the Conditional Read ROM command. During the sequential search process, the maximum number of devices in the network should meet this condition.

To transition a device from Chain OFF to Chain ON or Chain DONE state, the host needs to use the Chain command. Figure 4 shows the various possible transitions. The host must immediately send an appropriate Chain Control byte after the Chain command code. To reduce the chance of receiving an erroneous Chain command, the control byte is first sent in original form and then in inverted form. When the host receives the AAh confirmation byte, it indicates that the link state has successfully transitioned.

Figure 4. Link state transition diagram
Figure 4. Link state transition diagram

When starting a sequential search, the host must set all devices to the Chain ON state. When the host finishes reading a device ROM ID through Conditional Read ROM, it should set the device to the Chain DONE state, allowing the next device in the chain to respond to the Conditional Read ROM command. During the sequential search process, the devices will enter the Chain DONE state one by one until all devices are searched. Finally, all devices are set to the Chain OFF state, thereby releasing the /EN and /DONE pins, turning them into PIOs and returning to the power-on default state.

Sequential Search Routine

Prerequisites The host controls the network as shown in Figure 3. All devices support the chain function. To search for the order of devices in the chain, such as the position number and the ROM ID (registration code) of the device at that location, the host needs to perform the following steps:

Initialization The host sends the Skip ROM command, followed by the Chain ON command to put all devices in the Chain ON state. For all devices except the first device in the chain, the /DONE//EN is changed to logic 1 through the RCO pull-up resistor of the /DONE pin.

In the first cycle, the host sends a Conditional Read ROM command, and the first device in the link responds to the command, which gives the first device's 64-bit ROM ID. The host stores the ROM ID and identifies it as the first device in the link. The host then sends a Chain DONE command. This command sets the /EN pin of the second device in the link to a logic 0 through the /DONE pin of device #1, and prevents device #1 from responding again.

In the second cycle, the host sends a Conditional Read ROM command. Since device #2 is the only device in the link with /EN at a logic 0 at this time, it sends its ROM ID in response. The host saves the ROM ID as the serial number '2'. (Device #1 is in the Chain DONE state and will not respond to this command.) The host then sends a Chain DONE command.

Repeat the cycle To identify the ROM IDs of the remaining devices and their physical locations, the host needs to repeat the Conditional Read ROM and Chain DONE commands. If no device responds to the Conditional Read ROM command, all devices in the link have been identified.

After the termination search process is complete, all devices in the chain are in the Chain DONE state. The host should send the Skip ROM command followed by the Chain OFF command to terminate the sequential search. This puts all devices in the Chain OFF state, and the PIO pins are controlled by the PIO Access function command. For a detailed description of the Conditional Read ROM and Chain commands, as well as a complete flowchart, refer to the DS28EA00 data sheet 4.

Assuming standard 1-Wire speeds (960µs reset/presence detect cycle, 65µs per time slot), initialization and termination take about 7ms (total time for one pass). The search and location of each device takes about 7.7ms. Under the same conditions, executing the Search ROM command takes about 14ms per device. For example, in 100ms, the host can identify and locate 12 devices if the link function is enabled, but can only identify 7 devices if the Search ROM function is used alone.

Additional Notes

Cable Capacitance Category 5 telephone wire, commonly used to build 1-Wire networks, has a capacitance of about 50 pF/m between each twisted pair. Depending on the size of the network, this can add a significant capacitive load to the line when all devices are in the Chain ON state. Active 1-Wire line pullups are sometimes necessary in parasite-powered mode to prevent the voltage from dropping below the minimum allowed value. This is not necessary when powered from the mains or local VCC supply.

Conditional Read ROM The DS2401 and its compatible DS2400 silicon serial numbers, which were discontinued in 1993, read this command as Read ROM. Therefore, do not connect a DS2401 to a network that uses the Chain function. Therefore, when using a 1-Wire port adapter, select a device without the DS2401. The DS2405 Revision A also responds to the Conditional Read ROM command code like the DS2401. The DS2405 Revision B, which was produced starting in 1998, ignores the Conditional Read ROM command code.

1-Wire Master Circuits For embedded applications, a variety of low-cost, discrete, IC-based 1-Wire masters are available. Discrete solutions include pullup resistors, unused µC port pins, and advanced drivers. 5 Integrated drivers specifically designed to drive the 1-Wire bus include the DS2480B6 (serial port, UART), DS24907 (USB port), and DS24828,9 (I²C port, Figure 5). The 8-channel version of the DS2482 has three address pins, allowing a single master to control up to 64 independent 1-Wire networks. Application Note 192, "Using the DS2480B Serial Interface 1-Wire Line Driver," 10 describes the DS2480B from a software development perspective. A similar article for the DS2482 driver is also available. 11

Figure 5. The DS2482 single-channel I²C-to-1-Wire bridge device acts as a 1-Wire master. Its active-low DONE output can also be used to drive an LED without affecting the link's functionality.
Figure 5. The DS2482 single-channel I²C-to-1-Wire bridge device acts as a 1-Wire master. Its /DONE output can also be used to drive an LED without affecting link functionality.

Power If VCC power is available, all DS28EA00s can perform temperature conversions simultaneously. A subsequent Conditional Search command can be sent to filter out devices that are generating alarm temperatures. The sequential search provides information about the device's ROM ID and location, quickly identifying where corrective action may be needed. If VCC power is not available, temperature conversions must be performed sequentially. In addition, it is important to ensure that the voltage on the 1-Wire data line does not drop too much when the sequential search begins (when all devices transition from Chain OFF to Chain ON).

The fast timing of Overdrive mode is not suitable for 1-Wire networks with many devices or over 3m; standard speed should be used instead. Depending on the number of devices on the network, even standard speed may require extended recovery time, especially when powered by parasite power12.

Troubleshooting If sequential search is not possible, watch for voltage drops on the 1-Wire line after the Chain ON command is sent. If the voltage drops below 3.0V, the command may not be executed properly. To avoid voltage drops, use a driver circuit with active pull-up or use the main power supply after Chain ON. If the active-low EN input of the first device in the chain is open, connected to the 1-Wire line, or connected to VCC, the sequence detection will fail. Make sure there is no DS2401 in the network. It is not allowed to connect two or more networks in parallel to the same 1-Wire port, because then all "first devices" will respond at the same time, which will result in a ROM ID with an invalid CRC byte.

Conclusion

The link function is a new feature that allows the host to determine the physical order of devices in a linear network under software control without human intervention. The DS28EA00 1-Wire digital thermometer is the first device to integrate the link function. In multi-point temperature measurement applications, the DS28EA00 is the most cost-effective choice compared to solutions that obtain device location through address pins.
Keywords:Link Reference address:Using the 1-Wire® Link to Acquire Position Information—A Determinant

Previous article:Thermocouple cold junction compensation
Next article:Implementing a MAX1385-Based C

Recommended ReadingLatest update time:2024-11-16 18:05

FPGA Design of AC-Link Digital Audio VHDL Encoding/Decoding
0 Introduction Digital audio processing refers to the encoding and decoding technology for audio in order to reproduce the realistic effect of sound. It is the key technology for broadband network multimedia and mobile multimedia communications. Audio Codec′97 (audio digital signal codec) is one of the tech
[Embedded]
FPGA Design of AC-Link Digital Audio VHDL Encoding/Decoding
Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号