Use the 1-Wire® link function to obtain position information-a definite device

Abstract: This article introduces a low-cost serial bus system based on the addressing protocol to identify the physical location of missing components. There may be such problems in measuring or controlling the serial bus, for example: a multi-point temperature measurement system. This article describes in detail how to use the DS28EA00 with link function to obtain position information in a low-cost serial bus, such as 1-Wire.

This article was also published in Maxim Engineering Journal, Issue 60 (PDF, 848kB).

The common feature of digital bus systems is sharing. With the promotion of microprocessors, parallel bus systems are becoming more and more widely used, and all components connected to the bus share data lines and address lines. The chip select signal can be decoded by the address line and the control signal. According to hardware design and wiring, the physical address of each device connected to the bus is always known. With the development of technology to a low-cost serial bus system1, the address line was first omitted. However, the SPI ™ and MICROWIRE ™ serial buses still have a chip select function. Many advanced serial bus systems introduce protocol-based addressing, which transmits address information to the data as a preamble. The typical representative of this type of bus is I²C / SMBus ™, and this type of communication interface is reduced to only data lines and clock lines. To further reduce costs, clock information can be embedded into the data stream. Typical representatives of this type of bus are 1-Wire, LIN and SensorPath® buses.

Due to the use of protocol-based addressing, information about the physical location of components will be missing. For instrumentation and control applications that use a serial bus (such as measuring multiple points of temperature), this will be a problem. For the I²C bus, address pins are connected to logic 1, logic 0, SCL, or SDA, which solves this problem to some extent. In this way, a single pin can be set to 4 different digital states, equivalent to two bits. Although this method is simple and effective, the original I²C protocol only provided 7 address bits, so it had certain limitations. 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 an address pin is not a good choice.

Figure 1 shows a simple, low-cost solution that can reacquire the physical locations of multiple devices attached to the serial bus, identify the device at the beginning of the network as position # 1, and in turn list the devices The connected device number. The circuit connection of this scheme is shown by the thick blue line in the figure. At position 1, the line is simply grounded.

Figure 1. Serial network with position detection
Figure 1. Serial network with position detection

In addition to the two pins labeled IN and OUT in Figure 1, you also need to read the IN pin and write the OUT pin through on-chip logic. If the protocol supports multipoint network functions, then with the help of these methods, the host can first identify the first device, then the next device, and so on, until the positioning of all devices is completed. 1-Wire bus can meet this requirement of the serial bus system.

The 1-Wire bus is a simple signaling protocol that can achieve half-duplex, bidirectional communication between the master / master controller and one or more slaves through a common data line (Figure 2). Can realize power supply and data communication with the slave through a single 1-Wire bus. The power supply is implemented in the following manner: During the data transmission process, the internal capacitance of the slave device obtains charge from the bus when the bus state is high, and uses the charge to power the device when the bus state is low. A typical 1-Wire master includes an open-drain I / O pin and is pulled up to a 3V to 5V power supply through a resistor. Using this intelligent communication technology, you can easily and efficiently add memory, authentication, and mixed-signal functions at any time.

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

All 1-Wire systems have an important basic feature: each slave has a unique, unchangeable (ROM) 64-bit, factory laser engraved serial number (ID), which will never be related to Repeat for other devices. In addition to providing unique electronic IDs for end products, the 64-bit ROM ID also allows the host to select a device from many slave devices attached to the same bus. The 64-bit ROM ID contains an 8-bit family code that is used to identify the device type and supported functions.

Normally, when the system starts to initialize, the 1-Wire master may not know the number of devices attached to the bus and their ROM ID. Using the line and characteristics of the bus, the host can use the elimination method to determine the ID of all devices attached to the bus. With SearchROM * function 2, the host can determine the ROM ID of the device attached to the bus. However, Search ROM results cannot provide the location of individual devices. For example, as shown in the device ROM ID in Figure 2, the device ID is obtained in the order shown in Table 1.

Table 1. Device search order
Sequence ROM ID (Hexadecimal) PosiTIon in Network
1 C7000000007AD242 LocaTIon # 2
2 5A00000000853E42 LocaTIon # 3
3 16000000008A8142 LocaTIon # 1

The concept of the link function When using the link function to determine the physical location of the device in the 1-Wire network environment, the following points are followed: The physical distribution of the system-level 1-Wire network is known, such as the first one, who is the second Etc. and the physical location of the device / node. Get the physical connection order of the device (ROM ID), which is the first and which is the last. Where a) known system information can be obtained from the physical layout of the 1-Wire network. b) The item is usually unknown, and this information can be easily obtained by using link function communication. The link function (Figure 3) uses two pins, the input pin (/ EN) enables device response during the search, and the output pin (/ DONE) informs the next device in the link that its previous device has completed search for. The / DONE signal is connected to the / EN input of the next device. The / EN input of the first device in the chain is connected to GND. The connection line that realizes the link function is shown by the thick blue line in the figure. In addition to the / EN and / DONE pins, the sequential search function also requires a new network function command, Conditional Read ROM. This command only reports the device's ROM ID when certain conditions are met (described below). In contrast, Read ROM allows all devices on the network to send their ROM IDs at the same time. DS28EA00 is the industry's first device with a new link function (as shown in Figure 3).

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

In addition to the 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. Control the link state transition through the Chain command. Table 2 gives the link status and corresponding working status.

Table 2. Link status
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 link state at power-on is OFF. At this time, / DONE (PIOA) and / EN (PIOB) are individually controlled by the PIO Access Read and PIO Access Write commands, as described in the DS28EA00 data sheet3. When the link status is ON, / DONE is pulled up to the device's internal power supply VDD 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 Conditional Read ROM commands. In the sequential search process, the maximum value of devices in the network should meet this condition.

To switch the 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 conversions. After the Chain command code, the host must immediately send an appropriate Chain Control byte. In order to reduce the chance of receiving the wrong Chain command, the control byte is first sent in the original code, and then sent in the reverse code. 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 sequential search, the host must put all devices into Chain ON state. After the host reads a device ROM ID through Conditional Read ROM, it should put the device into the Chain DONE state to allow the next device in the link to respond to the Conditional Read ROM command. In the process of sequential search, the devices will enter the Chain DONE state in turn until all devices are searched. Finally, all devices are set to the Chain OFF state, thereby releasing the / EN and / DONE pins, making them PIO, and returning to the power-on default state.

The sequence search routine assumes that the host control network is shown in Figure 3. All devices support the link function. To search the order of devices in the link, such as the location number and the ROM ID of the device at that location (ie, the registration code), the host needs to perform the following steps:

The initialization host sends the Skip ROM command, followed by the Chain ON command to put all devices in the Chain ON state. Except for the first device in the chain, for all other devices, / DONE // EN is changed to logic 1 through the RCO pull-up resistor on 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 to obtain the 64-bit ROM ID of the first device. The host stores this ROM ID and determines it as the first device in the link. Subsequently, the host sends the 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, while preventing 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 whose / EN is logic 0 at this time, the device sends its ROM ID as a response. The host computer saves the ROM ID as the serial code '2'. (Device # 1 is in Chain DONE state, so it will not respond to this command.) Subsequently, the host sends the Chain DONE command.

To identify the ROM ID and physical location of the remaining devices during the repetition period, the host needs to repeatedly send 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 of the search process, all devices in the link are in Chain DONE state. The host should send the Skip ROM command followed by the Chain OFF command to terminate the sequential search. In this way, all devices can be put into the Chain OFF state and become PIO pins controlled by PIO Access function commands. For a detailed description of Conditional Read ROM and Chain commands, and a complete flowchart, please refer to DS28EA00 data sheet 4.

Assuming a standard 1-Wire rate (reset / online detection cycle of 960µs and 65µs per time slot), it takes about 7ms to initialize and complete (a total time taken at a time). The search and position detection of each device takes about 7.7ms. Under the same conditions, when executing the Search ROM command, each device takes about 14ms. For example, within 100ms, if it has a link function, the host can identify and locate 12 devices, but if only relying on the Search ROM function, the host can only identify 7 devices.

Supplementary note: Cable capacitors are commonly used to construct a 1-Wire network of Category 5 telephone lines. Each twisted pair has a capacitance of approximately 50pF / m. According to the scale of the network, when all devices are in the Chain ON state, a very large capacitive load will be added to the line. In parasitic power supply mode, it is sometimes necessary to use active 1-Wire line pull-ups to avoid voltage drops below the minimum allowable value. This measure is not necessary when using the main power supply or local VCC power supply.

Conditional Read ROM DS2401 and its compatible DS2400 silicon serial number discontinued in 1993, read this command as Read ROM. Therefore, do not connect the DS2401 to a network that uses link functions. Therefore, when using the 1-Wire port adapter, the device without DS2401 should be selected. DS2405 version A can also respond to Conditional Read ROM command codes like the DS2401. Version B of the DS2405, which began production in 1998, ignores the Conditional Read ROM command code.

The 1-Wire master controller circuit can use a variety of low-cost, discrete, IC-based 1-Wire master controllers in an embedded application environment. Discrete solutions include pull-up resistors, idle µC port pins, and advanced drivers5. Integrated drivers specifically for driving 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 3 address pins, allowing a single host controller to control up to 64 independent 1-Wire networks. Application Note 192, "Use of the DS2480B Serial Interface 1-Wire Line Driver" 10, describes the DS2480B from a software development perspective. A similar article for DS2482 driver is also available for reference 11.

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

If the power supply provides VCC power, all DS28EA00 can carry out temperature conversion at the same time. Then send the Conditional Search command, you can filter out those devices that send alarm temperature. Through sequential search, the ROM ID of the device and its location information can be obtained, and it is possible to quickly know where to take corrective measures. If there is no VCC power supply, temperature conversion must be performed in sequence. In addition, when starting a sequential search (all devices transition from the Chain OFF state to the Chain ON state), you must ensure that the voltage on the 1-Wire data line does not drop too much.

Fast timing in rate high-speed mode is not suitable for 1-Wire networks that contain multiple devices or exceed 3m; in this case, standard rate should be used instead. Depending on the number of devices in the network, even at the standard rate, the recovery time needs to be extended, especially when powered by parasitic power sources12.

If it is not possible to perform sequential search for fault diagnosis, after sending the Chain ON command, check the voltage drop on the 1-Wire line. If the voltage drops below 3.0V, the command may not be executed normally. In order to avoid voltage drop, after Chain ON, you can use a drive circuit with source pull-up, or use the main power supply. If the / EN input of the first device in the link is open, or connected to a 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, so at this time all "first devices" will respond at the same time, so you will get a ROM ID with an invalid CRC byte.

Conclusion The link function is a new feature. The host can determine the physical order of the devices in the linear network under software control without manual involvement. DS28EA00 1-Wire digital thermometer is the first device with integrated link function. In multi-point temperature measurement applications, the DS28EA00 is the most cost-effective option compared to solutions that use the address pins to obtain device location.

Housed in compact packages with profiles as low as 0.95 mm, our range of electret condenser Microphones and MEMS microphones offers a variety of performance options to meet the voice capture and audio recording needs of your next design. Our microphones are available with omnidirectional, unidirectional, and Noise Cancelling directivity, while featuring sensitivity ratings from -54 up to -24 dB and signal to noise ratios from 56 up to 72 dBA.

Microphones

Mic Wireless,Wireless Microphone,Bluetooth Microphone,Condenser Microphone

NINGBO SANCO ELECTRONICS CO., LTD. , https://www.sancobuzzer.com