blob: 1ebaa2485770adb43f4cdb9adee80f7d4e1ef734 [file] [log] [blame]
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00001Kernel driver ds1621
2====================
3
4Supported chips:
Robert Coulsoncd6c8a42013-05-08 22:45:53 -07005 * Dallas Semiconductor / Maxim Integrated DS1621
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00006 Prefix: 'ds1621'
7 Addresses scanned: I2C 0x48 - 0x4f
Robert Coulsoncd6c8a42013-05-08 22:45:53 -07008 Datasheet: Publicly available from www.maximintegrated.com
9
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000010 * Dallas Semiconductor DS1625
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070011 Prefix:
12 'ds1621' - if binding via _detect function
13 'ds1625' - explicit instantiation
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000014 Addresses scanned: I2C 0x48 - 0x4f
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070015 Datasheet: Publicly available from www.datasheetarchive.com
16
Robert Coulson79c1cc12013-05-16 15:10:41 -070017 * Maxim Integrated DS1631
18 Prefix: 'ds1631'
19 Addresses scanned: I2C 0x48 - 0x4f
20 Datasheet: Publicly available from www.maximintegrated.com
21
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070022 * Maxim Integrated DS1721
23 Prefix: 'ds1721'
24 Addresses scanned: I2C 0x48 - 0x4f
25 Datasheet: Publicly available from www.maximintegrated.com
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000026
27Authors:
28 Christian W. Zuckschwerdt <zany@triq.net>
29 valuable contributions by Jan M. Sendler <sendler@sendler.de>
30 ported to 2.6 by Aurelien Jarno <aurelien@aurel32.net>
31 with the help of Jean Delvare <khali@linux-fr.org>
32
33Module Parameters
34------------------
35
36* polarity int
37 Output's polarity: 0 = active high, 1 = active low
38
39Description
40-----------
41
42The DS1621 is a (one instance) digital thermometer and thermostat. It has
43both high and low temperature limits which can be user defined (i.e.
44programmed into non-volatile on-chip registers). Temperature range is -55
45degree Celsius to +125 in 0.5 increments. You may convert this into a
46Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity
47parameter is not provided, original value is used.
48
49As for the thermostat, behavior can also be programmed using the polarity
50toggle. On the one hand ("heater"), the thermostat output of the chip,
51Tout, will trigger when the low limit temperature is met or underrun and
52stays high until the high limit is met or exceeded. On the other hand
53("cooler"), vice versa. That way "heater" equals "active low", whereas
54"conditioner" equals "active high". Please note that the DS1621 data sheet
55is somewhat misleading in this point since setting the polarity bit does
56not simply invert Tout.
57
58A second thing is that, during extensive testing, Tout showed a tolerance
59of up to +/- 0.5 degrees even when compared against precise temperature
60readings. Be sure to have a high vs. low temperature limit gap of al least
611.0 degree Celsius to avoid Tout "bouncing", though!
62
Jean Delvare25f33112009-03-30 21:46:41 +020063The alarm bits are set when the high or low limits are met or exceeded and
64are reset by the module as soon as the respective temperature ranges are
65left.
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000066
67The alarm registers are in no way suitable to find out about the actual
68status of Tout. They will only tell you about its history, whether or not
69any of the limits have ever been met or exceeded since last power-up or
70reset. Be aware: When testing, it showed that the status of Tout can change
71with neither of the alarms set.
72
73Temperature conversion of the DS1621 takes up to 1000ms; internal access to
74non-volatile registers may last for 10ms or below.
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070075
76The DS1625 is pin compatible and functionally equivalent with the DS1621,
Robert Coulson79c1cc12013-05-16 15:10:41 -070077but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
78pin compatible with the DS1621, but provide multi-resolution support.
79
80Since there is no version register, there is no unique identification
81for these devices. In addition, the DS1631 and DS1721 will emulate a
82DS1621 device, if not explicitly instantiated (why? because the detect
83function compares the temperature register values bits and checks for a
849-bit resolution). Therefore, for correct device identification and
85functionality, explicit device instantiation is required.
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070086
87The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
88degree Celsius over a -10 to +85 degree range, a minimum/maximum alarm
89default setting of 75 and 80 degrees respectively, and a maximum conversion
90time of 750ms.
Robert Coulson3a8fe332013-05-08 22:45:54 -070091
92In addition, the DS1721 supports four resolution settings from 9 to 12 bits
93(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully),
Robert Coulson79c1cc12013-05-16 15:10:41 -070094that are set at device power on to the highest resolution: 12-bits.
Robert Coulson3a8fe332013-05-08 22:45:54 -070095
Robert Coulson79c1cc12013-05-16 15:10:41 -070096One additional note about the ds1721 is that although the data sheet says
97the temperature flags (THF and TLF) are used internally, these flags do
98get set and cleared as the actual temperature crosses the min or max settings.
99
100The DS1631 is also pin compatible with the DS1621 and feature compatible with
101the DS1721, however the DS1631 accuracy is +/- 0.5 degree Celsius over the
102same range.
103
104Changing the DS1631/1721 resolution mode affects the conversion time and can be
Robert Coulson3a8fe332013-05-08 22:45:54 -0700105done from userspace, via the device 'update_interval' sysfs attribute. This
106attribute will normalize range of input values to the device maximum resolution
107values defined in the datasheet as such:
108
109Resolution Conversion Time Input Range
110 (C/LSB) (msec) (msec)
111--------------------------------------------
1120.5 93.75 0....94
1130.25 187.5 95...187
1140.125 375 188..375
1150.0625 750 376..infinity
116--------------------------------------
117
118The following examples show how the 'update_interval' attribute can be
119used to change the conversion time:
120
121$ cat update_interval
122750
123$ cat temp1_input
12422062
125$
126$ echo 300 > update_interval
127$ cat update_interval
128375
129$ cat temp1_input
13022125
131$
132$ echo 150 > update_interval
133$ cat update_interval
134188
135$ cat temp1_input
13622250
137$
138$ echo 1 > update_interval
139$ cat update_interval
14094
141$ cat temp1_input
14222000
143$
144$ echo 1000 > update_interval
145$ cat update_interval
146750
147$ cat temp1_input
14822062
149$
150
151As shown, the ds1621 driver automatically adjusts the 'update_interval'
152user input, via a step function. Reading back the 'update_interval' value
153after a write operation provides the conversion time used by the device.
154
155Mathematically, the resolution can be derived from the conversion time
156via the following function:
157
158 g(x) = 0.5 * [minimum_conversion_time/x]
159
160where:
161 -> 'x' = the output from 'update_interval'
162 -> 'g(x)' = the resolution in degrees C per LSB.
163 -> 93.75ms = minimum conversion time