1-Wire
This function performs 1-Wire communication. For additional information on how to use this function, please see the 1-Wire App Note
U3: U3 firmware v1.31 and hardware v1.30 are required for 1-Wire.
Because the EIO lines on the U3 can be configured as either digital or analog, ensure that the I/O being used for 1-Wire sensor comm is first configured as either digital input or digital output, then use the function outlined below. For additional information on how to use this function, please see the 1-Wire App Note.U6: Firmware 1.17 or higher is required to use this function.
UE9: UE9 control firmware v2.20 or later are required for 1-Wire.
Command: |
|
|
Byte |
|
|
0 | Csum8 |
|
1 | 0xF8 |
|
2 | 0x1D |
|
3 | 0x3C |
|
4 | Csum16 L |
|
5 | Csum16 H |
|
6 | Options |
|
|
| Bit 0: DPU Control Enable |
|
| Bit 1: DPU Polarity |
|
| Bit 2: DPU Idle |
7 | Reserved |
|
8 | Sense Pin |
|
9 | DPU Pin |
|
10 | Reserved |
|
11 | ROM Function |
|
12 | ROM0 (LSB) |
|
13 | ROM1 |
|
14 | ROM2 |
|
15 | ROM3 |
|
16 | ROM4 |
|
17 | ROM5 |
|
18 | ROM6 |
|
19 | ROM7 (MSB) |
|
20 | Reserved |
|
21 | Num TX |
|
22 | Reserved |
|
23 | Num RX |
|
24 | TX Byte 0 |
|
… | ... |
|
63 | TX Byte 39 |
|
|
|
|
Response: |
|
|
Byte |
|
|
0 | Csum8 |
|
1 | 0xF8 |
|
2 | 0x1D |
|
3 | 0x3C |
|
4 | Csum16 L |
|
5 | Csum16 H |
|
6 | Error Code |
|
7 | Reserved |
|
8 | Reserved |
|
9 | Warnings |
|
|
| Bit 0: No Devices Detected |
|
| Bit 1: Type 1 interrupt (Not Tested) |
|
| Bit 2: Type 2 interrupt (Not Supported) |
10 | Reserved |
|
11 | Reserved |
|
16 | Data 0 |
|
… | … |
|
63 | Data 47 |
|
Options: This byte provides control of the dynamic pull-up.
Bit 0: enables control of the DPU line.
Bit 1: sets the polarity of the switch. 1 = high on the specified DIO turns the switch on.
Bit 2: sets the idle state. 1 = DPU on while IDLE.
Sense Pin: This is the DIO on the LabJack that is connected to the data line of the 1-wire bus.
DPU Pin: This is the DIO line that will control the dynamic pull-up if enabled in the options byte.
ROM Function: This byte specifies the function to be performed on the 1-wire bus.
ROM[0:7]: This is the ROM of the target device or search path.
Num TX: This is the number of data bytes to transmit.
Num RX: This is the number of data bytes to receive.
Depending on the ROM function used the data returned can have different meanings. Refer to the following table for data definitions.
|
| Parameter | Data Returned |
|
ROM Function: | Number | ROM | Bytes 0-7 | Bytes 8-15 |
Search ROM | 0xF0 | List of branches to take. | Discovered ROM Code | 1s indicate detected branches. |
Read ROM | 0x33 | None | ROM read from device |
|
Match ROM | 0x55 | The specific ROM |
|
|
Skip ROM | 0xCC |
|
|
|
Alarm Search | 0xEC |
|
|
|
Maxim has a 1-Wire app note which covers Dynamic Pull-Ups, and another on the search algorithm. There are several kinds of 1-wire temperature sensors from Maxim(DS1820, DS1821, DS1822, DS18S20, and DS18B20). The most common part is probably the DS18B20. Note that these temperature sensors require about 750ms of time to resolve a temperature reading.