meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
com:basic_1wire [2024/11/15 19:56] – [Sources] vamsan | com:basic_1wire [2025/05/31 21:56] (current) – vamsan | ||
---|---|---|---|
Line 2: | Line 2: | ||
1-Wire is a device communications bus system designed by Dallas Semiconductor that provides low-speed (16.3 kbit/s) data, signaling, and power over a single conductor.\\ | 1-Wire is a device communications bus system designed by Dallas Semiconductor that provides low-speed (16.3 kbit/s) data, signaling, and power over a single conductor.\\ | ||
\\ | \\ | ||
- | 1-Wire is similar in concept to [[com: | + | 1-Wire is similar in concept to [[com: |
\\ | \\ | ||
One distinctive feature of the bus is the possibility of using only two wires — data and ground. To accomplish this, 1-Wire devices include an 800 pF capacitor to store charge and power the device during periods when the data line is active.\\ | One distinctive feature of the bus is the possibility of using only two wires — data and ground. To accomplish this, 1-Wire devices include an 800 pF capacitor to store charge and power the device during periods when the data line is active.\\ | ||
- | The 1-Wire devices are specifically designed and optimized to read and write efficiently to 1-Wire devices and networks. | + | The 1-Wire devices are specifically designed and optimized to read and write efficiently to 1-Wire devices and networks. |
===== Features of the 1-wire bus ===== | ===== Features of the 1-wire bus ===== | ||
- | * In addition to 64-bit addressing, the bus can query a maximum of 75 sub-units per second. | + | * Besides |
* The transmission speed is approximately 16.3 kbit/s. | * The transmission speed is approximately 16.3 kbit/s. | ||
- | * Two main modes: Parasitic / normal | + | * Two main modes: Parasitic/ |
* A cable with a cross-section of at least 0.6 mm must be used. A shielded, twisted-pair cable is required for longer distances. The maximum length of the cable is 6 meters. | * A cable with a cross-section of at least 0.6 mm must be used. A shielded, twisted-pair cable is required for longer distances. The maximum length of the cable is 6 meters. | ||
* Each 1-Wire chip has a unique identifier code. | * Each 1-Wire chip has a unique identifier code. | ||
- | * A 1-Wire network | + | * A 1-wire network |
- | * Most UART/USARTs are perfectly capable of sustained speeds well in excess of the 15.4kbps required of the 1-Wire bus in standard mode | + | * Most UART/USARTs are perfectly capable of sustained speeds well above the 15.4kbps required of the 1-Wire bus in standard mode |
- | ===== Parasitic / normal mode by 1-wire bus ===== | + | ===== Parasitic/ |
|< 100% 50% 50% >| | |< 100% 50% 50% >| | ||
^Normal mode^Parasitic mode| | ^Normal mode^Parasitic mode| | ||
|{{: | |{{: | ||
- | |With an external supply, three wires are required: the bus wire, ground, and power. The 4.7k pull-up resistor is still required on the bus wire. As the bus is free for data transfer, the microcontroller can continually poll the state of a device doing a conversion. This way, a conversion request can finish as soon as the device reports being done, as opposed to having to wait for conversion time (dependent on device function and resolution) in " | + | |With an external supply, three wires are required: the bus wire, ground, and power. The 4.7k pull-up resistor is still required on the bus wire. As the bus is free for data transfer, the microcontroller can continually poll the state of a device doing a conversion. This way, a conversion request can finish as soon as the device reports being done, as opposed to having to wait for conversion time (dependent on device function and resolution) in " |
- | The example above shows the application of the DS18B20 digital temperature sensor in parasitic / normal mode. | + | The example above shows the application of the DS18B20 digital temperature sensor in parasitic/ |
===== Addressing a 1-Wire device ===== | ===== Addressing a 1-Wire device ===== | ||
Each 1-Wire device contains a unique 64-bit ' | Each 1-Wire device contains a unique 64-bit ' | ||
- | For example, the sample code, below, checks if the device being addressed is a DS18S20 temperature sensor by checking for its family code, 0x10. To use the sample code with the newer DS18B20 sensor, you would check for a family code of 0x28, instead, and for the DS1822 you would check for 0x22. | + | For example, the sample code below checks if the device being addressed is a DS18S20 temperature sensor by checking for its family code, 0x10. To use the sample code with the newer DS18B20 sensor, you would check for a family code of 0x28, instead, and for the DS1822, you would check for 0x22. |
===== Single-device commands ===== | ===== Single-device commands ===== | ||
- | Before sending a command to a single peripheral device, the controller must first select that device using its unique ROM. Subsequent commands will be responded to by the selected device, if found. | + | Before sending a command to a single peripheral device, the controller must select that device using its unique ROM. If found, |
===== Multiple-device commands ===== | ===== Multiple-device commands ===== | ||
- | Alternatively, | + | Alternatively, |
- | Sometimes, this may be intended and beneficial. For example, issuing a Skip ROM followed by a convert | + | Sometimes, this may be intended and beneficial. For example, issuing a Skip ROM followed by a Convert |
- | This can be a time-saving and efficient way of performing the operations. On the other hand, issuing a Read Scratchpad (0xBE) command would cause all devices to report Scratchpad data simultaneously. Power consumption of all devices (for example, during a temperature conversion) is also important | + | This can be a time-saving and efficient way of performing the operations. On the other hand, issuing a Read Scratchpad (0xBE) command would cause all devices to report Scratchpad data simultaneously. Power consumption of all devices (for example, during a temperature conversion) is also essential |
===== Sources ===== | ===== Sources ===== | ||
Line 50: | Line 50: | ||
\\ | \\ | ||
\\ | \\ | ||
- | {{tag> | + | {{tag> |
\\ | \\ | ||
This page has been accessed for: Today: {{counter|today}}, | This page has been accessed for: Today: {{counter|today}}, |