Lines Matching +full:adc +full:- +full:diff +full:- +full:channels

1 .. SPDX-License-Identifier: GPL-2.0-only
12 device drivers. This documentation describes common ADC features and explains
15 1. ADC Channel Types
19 in a slightly different way. An ADC digitizes the analog input voltage over a
21 the input polarity. The input range allowed to an ADC channel is needed to
23 real-world units (millivolts for voltage measurement, milliamps for current
28 to derive the allowed input range for an ADC. For clarity, the sections below
32 There are three general types of ADC inputs (single-ended, differential,
33 pseudo-differential) and two possible polarities (unipolar, bipolar). The input
34 type (single-ended, differential, pseudo-differential) is one channel
36 bipolar) aspect. A comprehensive article about ADC input types (on which this
38 https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html.
40 1.1 Single-ended channels
41 -------------------------
43 Single-ended channels digitize the analog input voltage relative to ground and
46 1.1.1 Single-ended Unipolar Channels
51 ---------- VREF -------------
54 / \ / \ --- < IN ADC |
56 `-´ `-´ \ VREF |
57 -------- GND (0V) ----------- +-----------+
62 The input voltage to a **single-ended unipolar** channel is allowed to swing
65 (Voltage input Full-Scale), with VFS being determined by VREF. The voltage
69 A single-ended unipolar channel could be described in device tree like the
72 adc@0 {
74 #address-cells = <1>;
75 #size-cells = <0>;
82 One is always allowed to include ADC channel nodes in the device tree. Though,
83 if the device has a uniform set of inputs (e.g. all inputs are single-ended),
86 One caveat for devices that support mixed single-ended and differential channels
87 is that single-ended channel nodes also need to provide a ``single-channel``
91 See ``Documentation/devicetree/bindings/iio/adc/adc.yaml`` for the complete
92 documentation of ADC specific device tree properties.
95 1.1.2 Single-ended Bipolar Channels
100 ---------- +VREF ------------
103 / \ / \ --- < IN ADC |
105 `-´ `-´ \ +VREF -VREF |
106 ---------- -VREF ------------ +-------------------+
109 External +VREF ------+ External -VREF
111 For a **single-ended bipolar** channel, the analog voltage input can go from
112 -VREF to +VREF (where -VREF is the voltage reference that has the lower
113 electrical potential while +VREF is the reference with the higher one). Some ADC
115 input. Often, +VREF and -VREF are symmetric but they don't need to be so. When
116 -VREF is lower than system ground, these inputs are also called single-ended
121 Here's an example device tree description of a single-ended bipolar channel::
123 adc@0 {
125 #address-cells = <1>;
126 #size-cells = <0>;
134 1.2 Differential channels
135 -------------------------
138 input (IN+) relative to the negative input (IN-) over the -VREF to +VREF span.
140 IN+ and IN-, which is often denoted by the IN+ - IN- formula.
142 1.2.1 Differential Bipolar Channels
147 -------- +VREF ------ +-------------------+
149 / \ / \ / --- < IN+ |
150 `-´ `-´ | |
151 -------- -VREF ------ | |
152 | ADC |
153 -------- +VREF ------ | |
155 \ / \ / \ --- < IN- |
156 `-´ `-´ \ +VREF -VREF |
157 -------- -VREF ------ +-------------------+
159 | +---- External -VREF
163 from -VREF to +VREF. The bipolar part of the name means that the resulting value
164 of the difference (IN+ - IN-) can be positive or negative. If -VREF is below
169 adc@0 {
171 #address-cells = <1>;
172 #size-cells = <0>;
177 diff-channels = <0 1>;
181 In the ADC driver, ``differential = 1`` is set into ``struct iio_chan_spec`` for
183 is only used to distinguish between differential and non-differential (either
184 single-ended or pseudo-differential) input types. See
187 1.2.2 Differential Unipolar Channels
190 For **differential unipolar** channels, the analog voltage at the positive input
192 input range allowed to a differential unipolar channel is IN- to +VREF. Because
194 guarantee IN+ will not go below IN- (nor IN- will raise above IN+), most
195 differential unipolar channel setups have IN- fixed to a known voltage that does
197 to a setup that is equivalent to a pseudo-differential channel. Thus,
198 differential unipolar setups can often be supported as pseudo-differential
199 unipolar channels.
201 1.3 Pseudo-differential Channels
202 --------------------------------
204 There is a third ADC input type which is called pseudo-differential or
205 single-ended to differential configuration. A pseudo-differential channel is
206 similar to a differential channel in that it also measures IN+ relative to IN-.
207 However, unlike bipolar differential channels, the negative input is limited to
209 to swing. A pseudo-differential channel can be made out from a differential pair
211 only the positive input to swing. Sometimes, the input provided to IN- is called
212 common-mode voltage. Besides, some parts have a COM pin that allows single-ended
213 inputs to be referenced to a common-mode voltage, making them
214 pseudo-differential channels. Often, the common mode input voltage can be
215 described in the device tree as a voltage regulator (e.g. ``com-supply``) since
218 1.3.1 Pseudo-differential Unipolar Channels argument
223 -------- +VREF ------ +-------------------+
225 / \ / \ / --- < IN+ |
226 `-´ `-´ | |
227 --------- IN- ------- | ADC |
229 Common-mode voltage --> --- < IN- |
230 \ +VREF -VREF |
231 +-------------------+
233 | +---- External -VREF
236 A **pseudo-differential unipolar** input has the limitations a differential
238 IN+ must stay within IN- to +VREF. The fixed voltage to IN- is often called
239 common-mode voltage and it must be within -VREF to +VREF as would be expected
242 The voltage measured from IN+ is relative to IN- but, unlike differential
243 channels, pseudo-differential setups are intended to gauge single-ended input
246 to ADC output when converting raw data to voltage units. In many setups, the
247 common-mode voltage input is at GND level and the ``_offset`` attribute is
250 Device tree example for pseudo-differential unipolar channel::
252 adc@0 {
254 #address-cells = <1>;
255 #size-cells = <0>;
259 single-channel = <0>;
260 common-mode-channel = <1>;
265 pseudo-differential channels.
267 1.3.2 Pseudo-differential Bipolar Channels argument
272 -------- +VREF ------ +-------------------+
274 / \ / \ / --- < IN+ |
275 `-´ `-´ | |
276 -------- -VREF ------ | ADC |
278 Common-mode voltage --> --- < IN- |
279 \ +VREF -VREF |
280 +-------------------+
282 | +---- External -VREF
285 A **pseudo-differential bipolar** input is not limited by the level at IN- but
286 it will be limited to -VREF or to GND on the lower end of the input range
287 depending on the particular ADC. Similar to their unipolar counter parts,
288 pseudo-differential bipolar channels ought to declare an ``_offset`` attribute
289 to enable the conversion of raw ADC data to voltage units. For the setup with
290 IN- connected to GND, ``_offset`` is often omitted.
292 Device tree example for pseudo-differential bipolar channel::
294 adc@0 {
296 #address-cells = <1>;
297 #size-cells = <0>;
302 single-channel = <0>;
303 common-mode-channel = <1>;