
The LINK™ Family Manual
Version 1.6 ©iButtonLink, LLC 2016
Page 57
A
PPENDIX
B: 1-Wire® Communications Examples
The sequence for reading a DS18B20 temperature sensor via a LINK device is:
1.
Issue a 1-Wire® reset using “ r ”
2.
Enter byte mode using “ b ” (in pull-up mode if supported by device “ p ”) and address
the ROM by sending “ 0x55 ” followed by the ROM address in reverse byte order
a.
For the LinkHub-S and the LinkHub-E,
send “ 55 ” followed by the ROM
address in reverse byte order
i.
Example: if the discovered ID is “ E60000003DA0E128 ”, you would
address it as “ 28E1A03D000000E6 ”
3.
Send the convert command “ 44 ” and exit byte mode <CR>
4.
Wait at least 900 ms for the conversion to complete, then issue a 1-Wire® reset “ r ”
5.
Enter byte mode using “ b ” and address the ROM as before
6.
Send the read command of “ BE ”
a.
For The LinkHub-S, The LinkHub-E, and The LinkOEM,
send the read
command of “ BE ”
7.
Send two read commands as “ FFFF ”. The echoed/returned data will contain the
temperature reading in Intel (little-endian) order as a 16 bit signal integer (may be
formatted as four hex characters)
8.
Exit byte mode <CR>
E
XAMPLE
:
The returned value will be in 1/16 degree Celsius increments. A return value of 5701 represents
0x0157, or 343 in decimal. Dividing by 16 gives you 21.4
°
C (70.6
°
F).
Mind the sign bit, or values below freezing will appear to be unusually warm by several
thousand degrees.
D
EBUGGING
H
INT
:
The power-up default of the 18B20 is 85
°
C (185
°
F). If you receive this value, it might indicate
that this device has never executed a convert. It is possible to address an 18B20 and NOT have
enough power available for it to execute a convert.
Содержание LINK 12
Страница 1: ......
Страница 2: ...The LINK Family Manual Version 1 6 iButtonLink LLC 2016 Page 2 ...