← Documents Documentation/hwmon/ds1621.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver ds1621

DS1621 compatible thermometer의 thermostat polarity, alarm 이력과 multi-resolution conversion입니다.

Source pathDocumentation/hwmon/ds1621.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

ds1621.rst:1-217

Thermostat hysteresis와 9~12-bit resolution을 conversion interval로 제어합니다.

문서 개요
항목
SourceDocumentation/hwmon/ds1621.rst
분량217 source lines
Range-55C~+125C
Addresses0x48~0x4f

원문 분량과 핵심 범위입니다.

핵심 흐름
Device 명시적 등록Polarity·limit 설정Resolution 선택Tout·alarm 감시

장치 동작의 기본 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

DS1621 계열과 polarity parameter

1-60

드라이버는 Dallas Semiconductor / Maxim Integrated DS1621(prefix `ds1621`), DS1625(`ds1625`), DS1631(`ds1631`), DS1721(`ds1721`), DS1731(`ds1731`)을 지원합니다. 어느 chip도 주소를 scan하지 않으며 datasheet는 각 제조사 또는 archive에서 공개되어 있습니다.

저자는 Christian W. Zuckschwerdt이고 Jan M. Sendler가 기여했으며 Aurelien Jarno가 Jean Delvare의 도움으로 Linux 2.6에 port했습니다.

Module parameter `polarity`는 thermostat output polarity를 정합니다. `0`은 active high, `1`은 active low입니다.

DS1621 compatible family
ChipPrefix탐지특징
DS1621ds1621명시적 등록Digital thermometer·thermostat
DS1625ds1625명시적 등록DS1621 pin·function compatible
DS1631ds1631명시적 등록Multi-resolution
DS1721ds1721명시적 등록Multi-resolution
DS1731ds1731명시적 등록Multi-resolution

Prefix와 특징을 정리합니다.

Device 등록
I2C address 0x48~0x4f 선택한 주소당 한 device instantiate정확한 chip type 지정필요하면 polarity 설정Thermometer·thermostat attribute 등록

식별 register가 없으므로 board가 정확한 type을 지정합니다.

Kernel driver ds1621
====================

Supported chips:

  * Dallas Semiconductor / Maxim Integrated DS1621

    Prefix: 'ds1621'

    Addresses scanned: none

    Datasheet: Publicly available from www.maximintegrated.com

  * Dallas Semiconductor DS1625

    Prefix: 'ds1625'

    Addresses scanned: none

    Datasheet: Publicly available from www.datasheetarchive.com

  * Maxim Integrated DS1631

    Prefix: 'ds1631'

    Addresses scanned: none

    Datasheet: Publicly available from www.maximintegrated.com

  * Maxim Integrated DS1721

    Prefix: 'ds1721'

    Addresses scanned: none

    Datasheet: Publicly available from www.maximintegrated.com

  * Maxim Integrated DS1731

    Prefix: 'ds1731'

    Addresses scanned: none

    Datasheet: Publicly available from www.maximintegrated.com

Authors:
      - Christian W. Zuckschwerdt <[email protected]>
      - valuable contributions by Jan M. Sendler <[email protected]>
      - ported to 2.6 by Aurelien Jarno <[email protected]>
        with the help of Jean Delvare <[email protected]>

Module Parameters
------------------

* polarity int
  Output's polarity:

  * 0 = active high,
  * 1 = active low

Thermostat hysteresis와 alarm 이력

61-108

DS1621은 단일 digital thermometer·thermostat입니다. 사용자 정의 high·low limit를 non-volatile on-chip register에 programming할 수 있습니다. 범위는 -55C~+125C, step은 0.5C이며 Fahrenheit로는 -67~+257도, step 0.9도입니다. `polarity`를 주지 않으면 원래 값을 유지합니다.

Thermostat 동작은 polarity로 programming합니다. Heater(active low)에서는 low limit에 도달하거나 밑돌면 `Tout`이 trigger되고 high limit에 도달하거나 넘을 때까지 high 상태를 유지합니다. Cooler 또는 conditioner(active high)에서는 반대로 동작합니다. Datasheet 표현과 달리 polarity bit는 `Tout`을 단순 반전하는 것이 아닙니다.

Extensive test에서 정확한 temperature reading과 비교해도 `Tout` tolerance가 최대 +/-0.5C였습니다. `Tout` bouncing을 피하려면 high와 low limit 사이를 최소 1.0C로 두어야 합니다.

High 또는 low limit에 도달·초과하면 alarm bit가 설정되고, 각각의 temperature range를 벗어나면 module이 reset합니다. 그러나 alarm register는 실제 `Tout` 상태를 알려주지 못합니다. 마지막 power-up 또는 reset 이후 limit에 도달한 이력만 나타내며, test에서는 alarm이 하나도 설정되지 않은 채 `Tout`이 바뀌기도 했습니다.

Version·vendor identification register가 없어 device를 고유 식별할 수 없습니다. 따라서 0x48~0x4f 범위에서 주소당 한 device를 명시적으로 instantiate해야 정확한 식별과 기능을 얻습니다.

DS1625는 DS1621과 pin-compatible·functionally equivalent지만 DS1621이 대체품입니다. DS1631, DS1721, DS1731도 pin-compatible하며 multi-resolution을 제공합니다. DS1721 datasheet는 THF·TLF flag를 internal 용도라고 하지만 실제로는 temperature가 기본 min 75C·max 80C 설정을 넘을 때 set·clear됩니다.

Thermostat mode
ModePolarityTriggerRelease
HeaterActive lowTemperature <= low limitTemperature >= high limit
Cooler/conditionerActive highTemperature >= high limitTemperature <= low limit
Tout tolerance-최대 +/-0.5CLimit gap >= 1.0C 권장
Alarm bits-Limit 도달 이력현재 Tout 상태와 다를 수 있음

Polarity가 단순 inversion이 아닌 hysteresis 방향을 정합니다.

Thermostat hysteresis
Polarity로 heater·cooler 선택Low·high limit programmingTrigger threshold crossingTout 상태 유지반대 threshold에서 release

두 limit 사이를 유지해 출력 bouncing을 줄입니다.

Description
-----------

The DS1621 is a (one instance) digital thermometer and thermostat. It has
both high and low temperature limits which can be user defined (i.e.
programmed into non-volatile on-chip registers). Temperature range is -55
degree Celsius to +125 in 0.5 increments. You may convert this into a
Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity
parameter is not provided, original value is used.

As for the thermostat, behavior can also be programmed using the polarity
toggle. On the one hand ("heater"), the thermostat output of the chip,
Tout, will trigger when the low limit temperature is met or underrun and
stays high until the high limit is met or exceeded. On the other hand
("cooler"), vice versa. That way "heater" equals "active low", whereas
"conditioner" equals "active high". Please note that the DS1621 data sheet
is somewhat misleading in this point since setting the polarity bit does
not simply invert Tout.

A second thing is that, during extensive testing, Tout showed a tolerance
of up to +/- 0.5 degrees even when compared against precise temperature
readings. Be sure to have a high vs. low temperature limit gap of al least
1.0 degree Celsius to avoid Tout "bouncing", though!

The alarm bits are set when the high or low limits are met or exceeded and
are reset by the module as soon as the respective temperature ranges are
left.

The alarm registers are in no way suitable to find out about the actual
status of Tout. They will only tell you about its history, whether or not
any of the limits have ever been met or exceeded since last power-up or
reset. Be aware: When testing, it showed that the status of Tout can change
with neither of the alarms set.

Since there is no version or vendor identification register, there is
no unique identification for these devices. Therefore, explicit device
instantiation is required for correct device identification and functionality
(one device per address in this address range: 0x48..0x4f).

The DS1625 is pin compatible and functionally equivalent with the DS1621,
but the DS1621 is meant to replace it. The DS1631, DS1721, and DS1731 are
also pin compatible with the DS1621 and provide multi-resolution support.

Additionally, the DS1721 data sheet says the temperature flags (THF and TLF)
are used internally, however, these flags do get set and cleared as the actual
temperature crosses the min or max settings (which by default are set to 75
and 80 degrees respectively).

Conversion time과 accuracy

109-134

Temperature conversion time은 DS1621 750ms(older device는 최대 1000ms), DS1625 500ms입니다. DS1631·DS1721·DS1731은 9~12-bit resolution에 따라 93ms~750ms입니다.

DS1621의 non-volatile register 내부 접근은 10ms 이하 걸릴 수 있습니다. 다른 device에서는 검증되지 않았습니다.

0~+70C 구간에서 DS1621, DS1625, DS1631 accuracy는 +/-0.5C입니다. DS1721과 DS1731은 -10~+85C에서 +/-1.0C입니다. 그 밖의 temperature accuracy는 device datasheet를 참조해야 합니다.

Conversion·accuracy
ChipConversion timeAccuracy
DS1621750ms, older 최대 1000ms+/-0.5C at 0~70C
DS1625500ms+/-0.5C at 0~70C
DS163193~750ms at 9~12 bit+/-0.5C at 0~70C
DS172193~750ms at 9~12 bit+/-1.0C at -10~85C
DS173193~750ms at 9~12 bit+/-1.0C at -10~85C

Chip별 conversion time과 보증 구간입니다.

Conversion 선택
Chip type 확인Resolution 선택해당 conversion time 대기Temperature result 읽기보증 accuracy 구간 확인

Resolution 요구에 따라 측정 지연을 감수합니다.

Temperature Conversion
----------------------

- DS1621 - 750ms (older devices may take up to 1000ms)
- DS1625 - 500ms
- DS1631 - 93ms..750ms for 9..12 bits resolution, respectively.
- DS1721 - 93ms..750ms for 9..12 bits resolution, respectively.
- DS1731 - 93ms..750ms for 9..12 bits resolution, respectively.

Note:
On the DS1621, internal access to non-volatile registers may last for 10ms
or less (unverified on the other devices).

Temperature Accuracy
--------------------

- DS1621: +/- 0.5 degree Celsius (from 0 to +70 degrees)
- DS1625: +/- 0.5 degree Celsius (from 0 to +70 degrees)
- DS1631: +/- 0.5 degree Celsius (from 0 to +70 degrees)
- DS1721: +/- 1.0 degree Celsius (from -10 to +85 degrees)
- DS1731: +/- 1.0 degree Celsius (from -10 to +85 degrees)

.. Note::

   Please refer to the device datasheets for accuracy at other temperatures.

R0·R1 resolution과 update_interval 정규화

135-170

DS1631, DS1721, DS1731은 config register의 R0·R1 bit로 multi-resolution을 제공합니다. `R0=0,R1=0`은 9-bit 0.5C, `1,0`은 10-bit 0.25C, `0,1`은 11-bit 0.125C, `1,1`은 12-bit 0.0625C입니다. 최초 power-on 기본값은 12-bit입니다.

Userspace는 `update_interval` sysfs attribute로 resolution mode를 바꿀 수 있습니다. Driver는 입력값 범위를 datasheet의 maximum-resolution conversion time 단계로 normalize합니다.

입력 0~94ms는 resolution 0.5C/LSB와 conversion 93.75ms, 95~187ms는 0.25C와 187.5ms, 188~375ms는 0.125C와 375ms, 376ms 이상은 0.0625C와 750ms를 선택합니다.

R0·R1와 interval
R0R1ResolutionConversion·input range
009 bit, 0.5C93.75ms; input 0~94
1010 bit, 0.25C187.5ms; input 95~187
0111 bit, 0.125C375ms; input 188~375
1112 bit, 0.0625C750ms; input >=376

Resolution bit와 userspace interval 단계입니다.

update_interval 정규화
Userspace interval writeInput range 판정R0·R1 mode 선택Conversion time 적용정규화된 interval readback

임의 입력을 네 hardware resolution 중 하나로 맞춥니다.

Temperature Resolution:
-----------------------
As mentioned above, the DS1631, DS1721, and DS1731 provide multi-resolution
support, which is achieved via the R0 and R1 config register bits, where:

R0..R1
------

== ==  ===============================
R0 R1
== ==  ===============================
 0  0  9 bits, 0.5 degrees Celsius
 1  0  10 bits, 0.25 degrees Celsius
 0  1  11 bits, 0.125 degrees Celsius
 1  1  12 bits, 0.0625 degrees Celsius
== ==  ===============================

.. Note::

   At initial device power-on, the default resolution is set to 12-bits.

The resolution mode for the DS1631, DS1721, or DS1731 can be changed from
userspace, via the device 'update_interval' sysfs attribute. This attribute
will normalize the range of input values to the device maximum resolution
values defined in the datasheet as follows:

============= ================== ===============
Resolution    Conversion Time    Input Range
 (C/LSB)       (msec)             (msec)
============= ================== ===============
0.5             93.75              0....94
0.25            187.5              95...187
0.125           375                188..375
0.0625          750                376..infinity
============= ================== ===============

update_interval 예제와 resolution 함수

171-217

예제에서 초기 `update_interval=750`일 때 `temp1_input=22062`입니다. `echo 300` 뒤 readback은 375이고 온도는 22125, `echo 150` 뒤 readback은 188이고 22250, `echo 1` 뒤 readback은 94이고 22000입니다. `echo 1000`은 750으로 정규화되고 22062를 반환합니다.

즉 ds1621 driver는 userspace 입력을 step function으로 자동 조정합니다. Write 뒤 `update_interval`을 다시 읽으면 device가 실제 사용하는 conversion time을 알 수 있습니다.

Conversion time에서 resolution을 구하는 원문 함수는 `g(x) = 0.5 * [minimum_conversion_time/x]`입니다. `x`는 `update_interval` 출력, `g(x)`는 degree C per LSB resolution, minimum conversion time은 93.75ms입니다.

update_interval 예제
WriteReadbacktemp1_input
초기75022062
30037522125
15018822250
19422000
100075022062

Write 값과 실제 정규화 값, 측정 예시를 보존합니다.

Resolution 계산
update_interval writeStep function 정규화실제 interval readbackg(x) 함수 적용Resolution과 temperature 해석

Readback conversion time으로 실제 LSB를 판단합니다.

The following examples show how the 'update_interval' attribute can be
used to change the conversion time::

  $ cat update_interval
  750
  $ cat temp1_input
  22062
  $
  $ echo 300 > update_interval
  $ cat update_interval
  375
  $ cat temp1_input
  22125
  $
  $ echo 150 > update_interval
  $ cat update_interval
  188
  $ cat temp1_input
  22250
  $
  $ echo 1 > update_interval
  $ cat update_interval
  94
  $ cat temp1_input
  22000
  $
  $ echo 1000 > update_interval
  $ cat update_interval
  750
  $ cat temp1_input
  22062
  $

As shown, the ds1621 driver automatically adjusts the 'update_interval'
user input, via a step function. Reading back the 'update_interval' value
after a write operation provides the conversion time used by the device.

Mathematically, the resolution can be derived from the conversion time
via the following function:

   g(x) = 0.5 * [minimum_conversion_time/x]

where:

 - 'x' = the output from 'update_interval'
 - 'g(x)' = the resolution in degrees C per LSB.
 - 93.75ms = minimum conversion time