blob: 83780660f5b1ea4b4d609f8f6785868f1c7f1401 [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'
Robert Coulsoned7c34e2013-05-23 09:22:22 -07007 Addresses scanned: none
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 Coulsoned7c34e2013-05-23 09:22:22 -070011 Prefix: 'ds1625'
12 Addresses scanned: none
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070013 Datasheet: Publicly available from www.datasheetarchive.com
14
Robert Coulson79c1cc12013-05-16 15:10:41 -070015 * Maxim Integrated DS1631
16 Prefix: 'ds1631'
Robert Coulsoned7c34e2013-05-23 09:22:22 -070017 Addresses scanned: none
Robert Coulson79c1cc12013-05-16 15:10:41 -070018 Datasheet: Publicly available from www.maximintegrated.com
19
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070020 * Maxim Integrated DS1721
21 Prefix: 'ds1721'
Robert Coulsoned7c34e2013-05-23 09:22:22 -070022 Addresses scanned: none
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070023 Datasheet: Publicly available from www.maximintegrated.com
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000024
25Authors:
26 Christian W. Zuckschwerdt <zany@triq.net>
27 valuable contributions by Jan M. Sendler <sendler@sendler.de>
28 ported to 2.6 by Aurelien Jarno <aurelien@aurel32.net>
29 with the help of Jean Delvare <khali@linux-fr.org>
30
31Module Parameters
32------------------
33
34* polarity int
35 Output's polarity: 0 = active high, 1 = active low
36
37Description
38-----------
39
40The DS1621 is a (one instance) digital thermometer and thermostat. It has
41both high and low temperature limits which can be user defined (i.e.
42programmed into non-volatile on-chip registers). Temperature range is -55
43degree Celsius to +125 in 0.5 increments. You may convert this into a
44Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity
45parameter is not provided, original value is used.
46
47As for the thermostat, behavior can also be programmed using the polarity
48toggle. On the one hand ("heater"), the thermostat output of the chip,
49Tout, will trigger when the low limit temperature is met or underrun and
50stays high until the high limit is met or exceeded. On the other hand
51("cooler"), vice versa. That way "heater" equals "active low", whereas
52"conditioner" equals "active high". Please note that the DS1621 data sheet
53is somewhat misleading in this point since setting the polarity bit does
54not simply invert Tout.
55
56A second thing is that, during extensive testing, Tout showed a tolerance
57of up to +/- 0.5 degrees even when compared against precise temperature
58readings. Be sure to have a high vs. low temperature limit gap of al least
591.0 degree Celsius to avoid Tout "bouncing", though!
60
Jean Delvare25f33112009-03-30 21:46:41 +020061The alarm bits are set when the high or low limits are met or exceeded and
62are reset by the module as soon as the respective temperature ranges are
63left.
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000064
65The alarm registers are in no way suitable to find out about the actual
66status of Tout. They will only tell you about its history, whether or not
67any of the limits have ever been met or exceeded since last power-up or
68reset. Be aware: When testing, it showed that the status of Tout can change
69with neither of the alarms set.
70
71Temperature conversion of the DS1621 takes up to 1000ms; internal access to
72non-volatile registers may last for 10ms or below.
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070073
74The DS1625 is pin compatible and functionally equivalent with the DS1621,
Robert Coulson79c1cc12013-05-16 15:10:41 -070075but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
76pin compatible with the DS1621, but provide multi-resolution support.
77
Robert Coulsoned7c34e2013-05-23 09:22:22 -070078Since there is no version or vendor identification register, there is
79no unique identification for these devices. Therefore, explicit device
80instantiation is required for correct device identification and functionality.
81
82And, for correct identification and operation, each device must be
83explicitly instantiated, one device per address, in this address
84range: 0x48..0x4f.
Robert Coulsoncd6c8a42013-05-08 22:45:53 -070085
86The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
87degree Celsius over a -10 to +85 degree range, a minimum/maximum alarm
88default setting of 75 and 80 degrees respectively, and a maximum conversion
89time of 750ms.
Robert Coulson3a8fe332013-05-08 22:45:54 -070090
91In addition, the DS1721 supports four resolution settings from 9 to 12 bits
92(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully),
Robert Coulson79c1cc12013-05-16 15:10:41 -070093that are set at device power on to the highest resolution: 12-bits.
Robert Coulson3a8fe332013-05-08 22:45:54 -070094
Robert Coulson79c1cc12013-05-16 15:10:41 -070095One additional note about the ds1721 is that although the data sheet says
96the temperature flags (THF and TLF) are used internally, these flags do
97get set and cleared as the actual temperature crosses the min or max settings.
98
99The DS1631 is also pin compatible with the DS1621 and feature compatible with
100the DS1721, however the DS1631 accuracy is +/- 0.5 degree Celsius over the
101same range.
102
103Changing the DS1631/1721 resolution mode affects the conversion time and can be
Robert Coulson3a8fe332013-05-08 22:45:54 -0700104done from userspace, via the device 'update_interval' sysfs attribute. This
105attribute will normalize range of input values to the device maximum resolution
106values defined in the datasheet as such:
107
108Resolution Conversion Time Input Range
109 (C/LSB) (msec) (msec)
110--------------------------------------------
1110.5 93.75 0....94
1120.25 187.5 95...187
1130.125 375 188..375
1140.0625 750 376..infinity
115--------------------------------------
116
117The following examples show how the 'update_interval' attribute can be
118used to change the conversion time:
119
120$ cat update_interval
121750
122$ cat temp1_input
12322062
124$
125$ echo 300 > update_interval
126$ cat update_interval
127375
128$ cat temp1_input
12922125
130$
131$ echo 150 > update_interval
132$ cat update_interval
133188
134$ cat temp1_input
13522250
136$
137$ echo 1 > update_interval
138$ cat update_interval
13994
140$ cat temp1_input
14122000
142$
143$ echo 1000 > update_interval
144$ cat update_interval
145750
146$ cat temp1_input
14722062
148$
149
150As shown, the ds1621 driver automatically adjusts the 'update_interval'
151user input, via a step function. Reading back the 'update_interval' value
152after a write operation provides the conversion time used by the device.
153
154Mathematically, the resolution can be derived from the conversion time
155via the following function:
156
157 g(x) = 0.5 * [minimum_conversion_time/x]
158
159where:
160 -> 'x' = the output from 'update_interval'
161 -> 'g(x)' = the resolution in degrees C per LSB.
162 -> 93.75ms = minimum conversion time