Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 1 | Kernel driver lm73 |
| 2 | ================== |
| 3 | |
| 4 | Supported chips: |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 5 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 6 | * Texas Instruments LM73 |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 7 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 8 | Prefix: 'lm73' |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 9 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 10 | Addresses scanned: I2C 0x48, 0x49, 0x4a, 0x4c, 0x4d, and 0x4e |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 11 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 12 | Datasheet: Publicly available at the Texas Instruments website |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 13 | |
| 14 | http://www.ti.com/product/lm73 |
| 15 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 16 | |
| 17 | Author: Guillaume Ligneul <guillaume.ligneul@gmail.com> |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 18 | |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 19 | Documentation: Chris Verges <kg4ysn@gmail.com> |
| 20 | |
| 21 | |
| 22 | Description |
| 23 | ----------- |
| 24 | |
| 25 | The LM73 is a digital temperature sensor. All temperature values are |
| 26 | given in degrees Celsius. |
| 27 | |
| 28 | Measurement Resolution Support |
| 29 | ------------------------------ |
| 30 | |
| 31 | The LM73 supports four resolutions, defined in terms of degrees C per |
| 32 | LSB: 0.25, 0.125, 0.0625, and 0.3125. Changing the resolution mode |
| 33 | affects the conversion time of the LM73's analog-to-digital converter. |
| 34 | From userspace, the desired resolution can be specified as a function of |
| 35 | conversion time via the 'update_interval' sysfs attribute for the |
| 36 | device. This attribute will normalize ranges of input values to the |
| 37 | maximum times defined for the resolution in the datasheet. |
| 38 | |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 39 | ============= ============= ============ |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 40 | Resolution Conv. Time Input Range |
| 41 | (C/LSB) (msec) (msec) |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 42 | ============= ============= ============ |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 43 | 0.25 14 0..14 |
| 44 | 0.125 28 15..28 |
| 45 | 0.0625 56 29..56 |
| 46 | 0.03125 112 57..infinity |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 47 | ============= ============= ============ |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 48 | |
| 49 | The following examples show how the 'update_interval' attribute can be |
Mauro Carvalho Chehab | b04f2f7 | 2019-04-17 06:46:28 -0300 | [diff] [blame] | 50 | used to change the conversion time:: |
Chris Verges | 8c14d12 | 2013-01-05 01:41:19 -0800 | [diff] [blame] | 51 | |
| 52 | $ echo 0 > update_interval |
| 53 | $ cat update_interval |
| 54 | 14 |
| 55 | $ cat temp1_input |
| 56 | 24250 |
| 57 | |
| 58 | $ echo 22 > update_interval |
| 59 | $ cat update_interval |
| 60 | 28 |
| 61 | $ cat temp1_input |
| 62 | 24125 |
| 63 | |
| 64 | $ echo 56 > update_interval |
| 65 | $ cat update_interval |
| 66 | 56 |
| 67 | $ cat temp1_input |
| 68 | 24062 |
| 69 | |
| 70 | $ echo 85 > update_interval |
| 71 | $ cat update_interval |
| 72 | 112 |
| 73 | $ cat temp1_input |
| 74 | 24031 |
| 75 | |
| 76 | As shown here, the lm73 driver automatically adjusts any user input for |
| 77 | 'update_interval' via a step function. Reading back the |
| 78 | 'update_interval' value after a write operation will confirm the |
| 79 | conversion time actively in use. |
| 80 | |
| 81 | Mathematically, the resolution can be derived from the conversion time |
| 82 | via the following function: |
| 83 | |
| 84 | g(x) = 0.250 * [log(x/14) / log(2)] |
| 85 | |
| 86 | where 'x' is the output from 'update_interval' and 'g(x)' is the |
| 87 | resolution in degrees C per LSB. |
Chris Verges | 2bf9233 | 2013-01-05 01:41:20 -0800 | [diff] [blame] | 88 | |
| 89 | Alarm Support |
| 90 | ------------- |
| 91 | |
| 92 | The LM73 features a simple over-temperature alarm mechanism. This |
| 93 | feature is exposed via the sysfs attributes. |
| 94 | |
| 95 | The attributes 'temp1_max_alarm' and 'temp1_min_alarm' are flags |
| 96 | provided by the LM73 that indicate whether the measured temperature has |
| 97 | passed the 'temp1_max' and 'temp1_min' thresholds, respectively. These |
| 98 | values _must_ be read to clear the registers on the LM73. |