ds1621.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. Kernel driver ds1621
  2. ====================
  3. Supported chips:
  4. * Dallas Semiconductor / Maxim Integrated DS1621
  5. Prefix: 'ds1621'
  6. Addresses scanned: none
  7. Datasheet: Publicly available from www.maximintegrated.com
  8. * Dallas Semiconductor DS1625
  9. Prefix: 'ds1625'
  10. Addresses scanned: none
  11. Datasheet: Publicly available from www.datasheetarchive.com
  12. * Maxim Integrated DS1631
  13. Prefix: 'ds1631'
  14. Addresses scanned: none
  15. Datasheet: Publicly available from www.maximintegrated.com
  16. * Maxim Integrated DS1721
  17. Prefix: 'ds1721'
  18. Addresses scanned: none
  19. Datasheet: Publicly available from www.maximintegrated.com
  20. * Maxim Integrated DS1731
  21. Prefix: 'ds1731'
  22. Addresses scanned: none
  23. Datasheet: Publicly available from www.maximintegrated.com
  24. Authors:
  25. - Christian W. Zuckschwerdt <[email protected]>
  26. - valuable contributions by Jan M. Sendler <[email protected]>
  27. - ported to 2.6 by Aurelien Jarno <[email protected]>
  28. with the help of Jean Delvare <[email protected]>
  29. Module Parameters
  30. ------------------
  31. * polarity int
  32. Output's polarity:
  33. * 0 = active high,
  34. * 1 = active low
  35. Description
  36. -----------
  37. The DS1621 is a (one instance) digital thermometer and thermostat. It has
  38. both high and low temperature limits which can be user defined (i.e.
  39. programmed into non-volatile on-chip registers). Temperature range is -55
  40. degree Celsius to +125 in 0.5 increments. You may convert this into a
  41. Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity
  42. parameter is not provided, original value is used.
  43. As for the thermostat, behavior can also be programmed using the polarity
  44. toggle. On the one hand ("heater"), the thermostat output of the chip,
  45. Tout, will trigger when the low limit temperature is met or underrun and
  46. stays high until the high limit is met or exceeded. On the other hand
  47. ("cooler"), vice versa. That way "heater" equals "active low", whereas
  48. "conditioner" equals "active high". Please note that the DS1621 data sheet
  49. is somewhat misleading in this point since setting the polarity bit does
  50. not simply invert Tout.
  51. A second thing is that, during extensive testing, Tout showed a tolerance
  52. of up to +/- 0.5 degrees even when compared against precise temperature
  53. readings. Be sure to have a high vs. low temperature limit gap of al least
  54. 1.0 degree Celsius to avoid Tout "bouncing", though!
  55. The alarm bits are set when the high or low limits are met or exceeded and
  56. are reset by the module as soon as the respective temperature ranges are
  57. left.
  58. The alarm registers are in no way suitable to find out about the actual
  59. status of Tout. They will only tell you about its history, whether or not
  60. any of the limits have ever been met or exceeded since last power-up or
  61. reset. Be aware: When testing, it showed that the status of Tout can change
  62. with neither of the alarms set.
  63. Since there is no version or vendor identification register, there is
  64. no unique identification for these devices. Therefore, explicit device
  65. instantiation is required for correct device identification and functionality
  66. (one device per address in this address range: 0x48..0x4f).
  67. The DS1625 is pin compatible and functionally equivalent with the DS1621,
  68. but the DS1621 is meant to replace it. The DS1631, DS1721, and DS1731 are
  69. also pin compatible with the DS1621 and provide multi-resolution support.
  70. Additionally, the DS1721 data sheet says the temperature flags (THF and TLF)
  71. are used internally, however, these flags do get set and cleared as the actual
  72. temperature crosses the min or max settings (which by default are set to 75
  73. and 80 degrees respectively).
  74. Temperature Conversion
  75. ----------------------
  76. - DS1621 - 750ms (older devices may take up to 1000ms)
  77. - DS1625 - 500ms
  78. - DS1631 - 93ms..750ms for 9..12 bits resolution, respectively.
  79. - DS1721 - 93ms..750ms for 9..12 bits resolution, respectively.
  80. - DS1731 - 93ms..750ms for 9..12 bits resolution, respectively.
  81. Note:
  82. On the DS1621, internal access to non-volatile registers may last for 10ms
  83. or less (unverified on the other devices).
  84. Temperature Accuracy
  85. --------------------
  86. - DS1621: +/- 0.5 degree Celsius (from 0 to +70 degrees)
  87. - DS1625: +/- 0.5 degree Celsius (from 0 to +70 degrees)
  88. - DS1631: +/- 0.5 degree Celsius (from 0 to +70 degrees)
  89. - DS1721: +/- 1.0 degree Celsius (from -10 to +85 degrees)
  90. - DS1731: +/- 1.0 degree Celsius (from -10 to +85 degrees)
  91. .. Note::
  92. Please refer to the device datasheets for accuracy at other temperatures.
  93. Temperature Resolution:
  94. -----------------------
  95. As mentioned above, the DS1631, DS1721, and DS1731 provide multi-resolution
  96. support, which is achieved via the R0 and R1 config register bits, where:
  97. R0..R1
  98. ------
  99. == == ===============================
  100. R0 R1
  101. == == ===============================
  102. 0 0 9 bits, 0.5 degrees Celsius
  103. 1 0 10 bits, 0.25 degrees Celsius
  104. 0 1 11 bits, 0.125 degrees Celsius
  105. 1 1 12 bits, 0.0625 degrees Celsius
  106. == == ===============================
  107. .. Note::
  108. At initial device power-on, the default resolution is set to 12-bits.
  109. The resolution mode for the DS1631, DS1721, or DS1731 can be changed from
  110. userspace, via the device 'update_interval' sysfs attribute. This attribute
  111. will normalize the range of input values to the device maximum resolution
  112. values defined in the datasheet as follows:
  113. ============= ================== ===============
  114. Resolution Conversion Time Input Range
  115. (C/LSB) (msec) (msec)
  116. ============= ================== ===============
  117. 0.5 93.75 0....94
  118. 0.25 187.5 95...187
  119. 0.125 375 188..375
  120. 0.0625 750 376..infinity
  121. ============= ================== ===============
  122. The following examples show how the 'update_interval' attribute can be
  123. used to change the conversion time::
  124. $ cat update_interval
  125. 750
  126. $ cat temp1_input
  127. 22062
  128. $
  129. $ echo 300 > update_interval
  130. $ cat update_interval
  131. 375
  132. $ cat temp1_input
  133. 22125
  134. $
  135. $ echo 150 > update_interval
  136. $ cat update_interval
  137. 188
  138. $ cat temp1_input
  139. 22250
  140. $
  141. $ echo 1 > update_interval
  142. $ cat update_interval
  143. 94
  144. $ cat temp1_input
  145. 22000
  146. $
  147. $ echo 1000 > update_interval
  148. $ cat update_interval
  149. 750
  150. $ cat temp1_input
  151. 22062
  152. $
  153. As shown, the ds1621 driver automatically adjusts the 'update_interval'
  154. user input, via a step function. Reading back the 'update_interval' value
  155. after a write operation provides the conversion time used by the device.
  156. Mathematically, the resolution can be derived from the conversion time
  157. via the following function:
  158. g(x) = 0.5 * [minimum_conversion_time/x]
  159. where:
  160. - 'x' = the output from 'update_interval'
  161. - 'g(x)' = the resolution in degrees C per LSB.
  162. - 93.75ms = minimum conversion time