R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 1 | Kernel driver ds1621 |
| 2 | ==================== |
| 3 | |
| 4 | Supported chips: |
Robert Coulson | cd6c8a4 | 2013-05-08 22:45:53 -0700 | [diff] [blame] | 5 | * Dallas Semiconductor / Maxim Integrated DS1621 |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 6 | Prefix: 'ds1621' |
| 7 | Addresses scanned: I2C 0x48 - 0x4f |
Robert Coulson | cd6c8a4 | 2013-05-08 22:45:53 -0700 | [diff] [blame] | 8 | Datasheet: Publicly available from www.maximintegrated.com |
| 9 | |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 10 | * Dallas Semiconductor DS1625 |
Robert Coulson | cd6c8a4 | 2013-05-08 22:45:53 -0700 | [diff] [blame] | 11 | Prefix: |
| 12 | 'ds1621' - if binding via _detect function |
| 13 | 'ds1625' - explicit instantiation |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 14 | Addresses scanned: I2C 0x48 - 0x4f |
Robert Coulson | cd6c8a4 | 2013-05-08 22:45:53 -0700 | [diff] [blame] | 15 | Datasheet: Publicly available from www.datasheetarchive.com |
| 16 | |
| 17 | * Maxim Integrated DS1721 |
| 18 | Prefix: 'ds1721' |
| 19 | Addresses scanned: I2C 0x48 - 0x4f |
| 20 | Datasheet: Publicly available from www.maximintegrated.com |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 21 | |
| 22 | Authors: |
| 23 | Christian W. Zuckschwerdt <zany@triq.net> |
| 24 | valuable contributions by Jan M. Sendler <sendler@sendler.de> |
| 25 | ported to 2.6 by Aurelien Jarno <aurelien@aurel32.net> |
| 26 | with the help of Jean Delvare <khali@linux-fr.org> |
| 27 | |
| 28 | Module Parameters |
| 29 | ------------------ |
| 30 | |
| 31 | * polarity int |
| 32 | Output's polarity: 0 = active high, 1 = active low |
| 33 | |
| 34 | Description |
| 35 | ----------- |
| 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 | |
| 44 | As for the thermostat, behavior can also be programmed using the polarity |
| 45 | toggle. On the one hand ("heater"), the thermostat output of the chip, |
| 46 | Tout, will trigger when the low limit temperature is met or underrun and |
| 47 | stays high until the high limit is met or exceeded. On the other hand |
| 48 | ("cooler"), vice versa. That way "heater" equals "active low", whereas |
| 49 | "conditioner" equals "active high". Please note that the DS1621 data sheet |
| 50 | is somewhat misleading in this point since setting the polarity bit does |
| 51 | not simply invert Tout. |
| 52 | |
| 53 | A second thing is that, during extensive testing, Tout showed a tolerance |
| 54 | of up to +/- 0.5 degrees even when compared against precise temperature |
| 55 | readings. Be sure to have a high vs. low temperature limit gap of al least |
| 56 | 1.0 degree Celsius to avoid Tout "bouncing", though! |
| 57 | |
Jean Delvare | 25f3311 | 2009-03-30 21:46:41 +0200 | [diff] [blame] | 58 | The alarm bits are set when the high or low limits are met or exceeded and |
| 59 | are reset by the module as soon as the respective temperature ranges are |
| 60 | left. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 61 | |
| 62 | The alarm registers are in no way suitable to find out about the actual |
| 63 | status of Tout. They will only tell you about its history, whether or not |
| 64 | any of the limits have ever been met or exceeded since last power-up or |
| 65 | reset. Be aware: When testing, it showed that the status of Tout can change |
| 66 | with neither of the alarms set. |
| 67 | |
| 68 | Temperature conversion of the DS1621 takes up to 1000ms; internal access to |
| 69 | non-volatile registers may last for 10ms or below. |
Robert Coulson | cd6c8a4 | 2013-05-08 22:45:53 -0700 | [diff] [blame] | 70 | |
| 71 | The DS1625 is pin compatible and functionally equivalent with the DS1621, |
| 72 | but the DS1621 is meant to replace it. |
| 73 | |
| 74 | The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0 |
| 75 | degree Celsius over a -10 to +85 degree range, a minimum/maximum alarm |
| 76 | default setting of 75 and 80 degrees respectively, and a maximum conversion |
| 77 | time of 750ms. |
Robert Coulson | 3a8fe33 | 2013-05-08 22:45:54 -0700 | [diff] [blame^] | 78 | |
| 79 | In addition, the DS1721 supports four resolution settings from 9 to 12 bits |
| 80 | (defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully), |
| 81 | that are set at device power on to the highest resolution: 12-bits (0.0625 degree C). |
| 82 | |
| 83 | Changing the DS1721 resolution mode affects the conversion time and can be |
| 84 | done from userspace, via the device 'update_interval' sysfs attribute. This |
| 85 | attribute will normalize range of input values to the device maximum resolution |
| 86 | values defined in the datasheet as such: |
| 87 | |
| 88 | Resolution Conversion Time Input Range |
| 89 | (C/LSB) (msec) (msec) |
| 90 | -------------------------------------------- |
| 91 | 0.5 93.75 0....94 |
| 92 | 0.25 187.5 95...187 |
| 93 | 0.125 375 188..375 |
| 94 | 0.0625 750 376..infinity |
| 95 | -------------------------------------- |
| 96 | |
| 97 | The following examples show how the 'update_interval' attribute can be |
| 98 | used to change the conversion time: |
| 99 | |
| 100 | $ cat update_interval |
| 101 | 750 |
| 102 | $ cat temp1_input |
| 103 | 22062 |
| 104 | $ |
| 105 | $ echo 300 > update_interval |
| 106 | $ cat update_interval |
| 107 | 375 |
| 108 | $ cat temp1_input |
| 109 | 22125 |
| 110 | $ |
| 111 | $ echo 150 > update_interval |
| 112 | $ cat update_interval |
| 113 | 188 |
| 114 | $ cat temp1_input |
| 115 | 22250 |
| 116 | $ |
| 117 | $ echo 1 > update_interval |
| 118 | $ cat update_interval |
| 119 | 94 |
| 120 | $ cat temp1_input |
| 121 | 22000 |
| 122 | $ |
| 123 | $ echo 1000 > update_interval |
| 124 | $ cat update_interval |
| 125 | 750 |
| 126 | $ cat temp1_input |
| 127 | 22062 |
| 128 | $ |
| 129 | |
| 130 | As shown, the ds1621 driver automatically adjusts the 'update_interval' |
| 131 | user input, via a step function. Reading back the 'update_interval' value |
| 132 | after a write operation provides the conversion time used by the device. |
| 133 | |
| 134 | Mathematically, the resolution can be derived from the conversion time |
| 135 | via the following function: |
| 136 | |
| 137 | g(x) = 0.5 * [minimum_conversion_time/x] |
| 138 | |
| 139 | where: |
| 140 | -> 'x' = the output from 'update_interval' |
| 141 | -> 'g(x)' = the resolution in degrees C per LSB. |
| 142 | -> 93.75ms = minimum conversion time |