Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:iio-adc:ad7192 [16 Nov 2012 12:56] – [Reference Circuits] add missing cns Lars-Peter Clausenresources:tools-software:linux-drivers:iio-adc:ad7192 [08 Feb 2019 14:51] (current) – [Device tree support] Mircea Caprioru
Line 5: Line 5:
   * [[adi>AD7190]]   * [[adi>AD7190]]
   * [[adi>AD7192]]   * [[adi>AD7192]]
 +  * [[adi>AD7193]] (Upstream 4.6+)
   * [[adi>AD7194]]   * [[adi>AD7194]]
   * [[adi>AD7195]]   * [[adi>AD7195]]
- 
 ===== Reference Circuits ===== ===== Reference Circuits =====
  
Line 13: Line 13:
   * [[adi>CN0102]]   * [[adi>CN0102]]
   * [[adi>CN0155]]   * [[adi>CN0155]]
 +  * [[adi>CN0209]]
   * [[adi>CN0251]]   * [[adi>CN0251]]
 +  * [[adi>CN0287]]
 +  * [[adi>CN0371]]
 +
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
   * [[adi>EVAL-AD7190EBZ]]   * [[adi>EVAL-AD7190EBZ]]
   * [[adi>EVAL-AD7192EBZ]]   * [[adi>EVAL-AD7192EBZ]]
 +  * [[adi>EVAL-AD7193EBZ]]
   * [[adi>EVAL-AD7194EBZ]]   * [[adi>EVAL-AD7194EBZ]]
   * [[adi>EVAL-AD7195EBZ]]   * [[adi>EVAL-AD7195EBZ]]
Line 30: Line 35:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[git.linux.org>drivers/staging/iio/adc/ad7192.c|git]] |  [[git.linux.org>drivers/staging/iio/adc/ad7192.c|git]]  |+| [[git.linux.org>drivers/staging/iio/adc/ad7192.c|git]] | [[git.linux.org>drivers/staging/iio/adc/ad7192.c|yes]]  |
 ===== Files ===== ===== Files =====
  
Line 128: Line 133:
 </code> </code>
  
 +====== Device tree support ======
 +Device tree is the new method for describing non-discoverable hardware in Linux. This replaces former structure based method. For configuring a device using this drivers please follow the example bellow: 
 +
 +<code>
 +/dts-v1/;
 +/plugin/;
 +
 +/ {
 +
 + fragment@0 {
 + target-path = "/";
 + dvdd: fixedregulator@0 {
 + compatible = "regulator-fixed";
 + regulator-name = "fixed-supply";
 + regulator-min-microvolt = <3300000>;
 + regulator-max-microvolt = <3300000>;
 + regulator-boot-on;
 + };
 + };
 +
 + fragment@1 {
 + target-path = "/";
 + avdd: fixedregulator@1 {
 + compatible = "regulator-fixed";
 + regulator-name = "fixed-supply2";
 + regulator-min-microvolt = <3300000>;
 + regulator-max-microvolt = <3300000>;
 + regulator-boot-on;
 + };
 + };
 +
 + fragment@3 {
 + target = <&spi0>;
 + #address-cells = <1>;
 + #size-cells = <0>;
 + status = "okay";
 +
 + ad7190@0 {
 + compatible = "adi,ad7190";
 + reg = <0>;
 + spi-max-frequency = <1000000>;
 + spi-cpol;
 + spi-cpha;
 + #interrupt-cells = <2>;
 + interrupts = <25 0x2>;
 + interrupt-parent = <&gpio>;
 + dvdd-supply = <&dvdd>;
 + avdd-supply = <&avdd>;
 +
 + adi,reference-voltage-mv = /bits/ 16  <3300>;
 + adi,clock-source-select = [02];
 + adi,refin2-pins-enable;
 + adi,rejection-60-Hz-enable;
 + adi,chop-enable;
 + adi,buffer-enable;
 + adi,burnout-currents-enable;
 + adi,sinc3-filter-enable;
 + adi,unipolar-enable;
 + };
 + };
 +};
 +</code>
 +
 +<note important> Interrupt pin connection - interrupts = <25 0x2>; this line means that gpio pin 25 is used for the interrupt and it must be connect to the DOUT/RDY pin of AD7192 along with the SPI MISO.  
 + </note>
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
Line 133: Line 203:
 "make qconfig") "make qconfig")
  
-<note>+<WRAP round help>
 The AD7192 Driver depends on **CONFIG_SPI** The AD7192 Driver depends on **CONFIG_SPI**
-</note>+</WRAP>
  
 <code> <code>
Line 155: Line 225:
  
 </code> </code>
 +
  
 ====== Hardware configuration ====== ====== Hardware configuration ======
Line 163: Line 234:
 {{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}}
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/> **cd /sys/bus/iio/devices/** root:/> **cd /sys/bus/iio/devices/**
Line 194: Line 265:
 -rw-r--r--    1 root     root          4096 Jan  4 16:59 uevent -rw-r--r--    1 root     root          4096 Jan  4 16:59 uevent
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0>  root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> 
-</xterm></box>+</xterm></WRAP>
  
 === Show device name === === Show device name ===
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat name** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat name**
 ad7192 ad7192
-</xterm></box>+</xterm></WRAP>
  
 === Set sampling frequency / update rate === === Set sampling frequency / update rate ===
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat sampling_frequency** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat sampling_frequency**
Line 214: Line 285:
 50 50
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0>
-</xterm></box>+</xterm></WRAP>
  
 === Show available scales for differential input channels === === Show available scales for differential input channels ===
Line 226: Line 297:
 Setting these directly influences the ADC input range, by altering the GAIN amplifier. Setting these directly influences the ADC input range, by altering the GAIN amplifier.
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale_available** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale_available**
 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070
-</xterm></box>+</xterm></WRAP>
  
 === Show available scales for pseudo-differential input channels === === Show available scales for pseudo-differential input channels ===
Line 243: Line 314:
 Setting these directly influences the ADC input range, by altering the GAIN amplifier. Setting these directly influences the ADC input range, by altering the GAIN amplifier.
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage_scale_available** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage_scale_available**
 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070 0.000393390 0.000196690 0.000098340 0.000049170 0.000024580 0.000012290 0.000006140 0.000003070
-</xterm></box>+</xterm></WRAP>
  
 === Set scale for differential input channels === === Set scale for differential input channels ===
Line 255: Line 326:
 If the written scale differs from the current scale. The driver performs full and zero offset calibration on all differential input channels. If the written scale differs from the current scale. The driver performs full and zero offset calibration on all differential input channels.
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale**
Line 262: Line 333:
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage-in_voltage_scale**
 0.000196690 0.000196690
-</xterm></box>+</xterm></WRAP>
  
 === Show channel in_voltage1 measurement === === Show channel in_voltage1 measurement ===
Line 278: Line 349:
 | AIN4 - AINCOM | in_voltage4_raw | | AIN4 - AINCOM | in_voltage4_raw |
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in1_raw** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in1_raw**
 -1 -1
-</xterm></box>+</xterm></WRAP>
  
 **U** = //in_voltage1_raw * in_voltage_scale// = 3983772* 0.000393390 = **1567.17606708 //mV//** **U** = //in_voltage1_raw * in_voltage_scale// = 3983772* 0.000393390 = **1567.17606708 //mV//**
Line 291: Line 362:
 Raw unscaled voltage measurement on channel in_voltage1-in_voltage2 Raw unscaled voltage measurement on channel in_voltage1-in_voltage2
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage1-in_voltage2_raw** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_voltage1-in_voltage2_raw**
 -1 -1
-</xterm></box>+</xterm></WRAP>
  
 **U** = //in_voltage1-in_voltage3_raw * in_voltage-in_voltage_scale// = -1 * 0.000393390 = **-0.000393390 //mV//** **U** = //in_voltage1-in_voltage3_raw * in_voltage-in_voltage_scale// = -1 * 0.000393390 = **-0.000393390 //mV//**
Line 305: Line 376:
  
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_temp0_raw** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat in_temp0_raw**
 -175 -175
-</xterm></box>+</xterm></WRAP>
  
 === Bride power-down switch control === === Bride power-down switch control ===
Line 316: Line 387:
 Writing 1 closes the bridge switch. Writing 1 closes the bridge switch.
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 1 > bridge_switch_en** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 1 > bridge_switch_en**
Line 322: Line 393:
 1 1
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 0 > bridge_switch_en** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 0 > bridge_switch_en**
-</xterm></box>+</xterm></WRAP>
  
 === AC excitation control (AD7195 only) === === AC excitation control (AD7195 only) ===
Line 329: Line 400:
 Writing 1 enables AC excitation on the AD7195 ACX strobes. Writing 1 enables AC excitation on the AD7195 ACX strobes.
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 1 > ac_excitation_en** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 1 > ac_excitation_en**
Line 335: Line 406:
 1 1
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 0 > ac_excitation_en** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **echo 0 > ac_excitation_en**
-</xterm></box>+</xterm></WRAP>
 ===== Trigger management ===== ===== Trigger management =====
  
-<note>+<WRAP round help>
 This driver only supports it's own default trigger source **ad7192-dev0** This driver only supports it's own default trigger source **ad7192-dev0**
-</note>+</WRAP>
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat trigger/current_trigger** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> **cat trigger/current_trigger**
 ad7192-dev0 ad7192-dev0
-</xterm></box>+</xterm></WRAP>
  
 ===== Buffer management ===== ===== Buffer management =====
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/iio:buffer> ls root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/iio:buffer> ls
 enable           length  enable           length 
-</xterm></box>+</xterm></WRAP>
  
 {{page>software:linux:docs:iio:iio_snippets#Buffer management&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#Buffer management&noheader&firstseconly&noeditbtn}}
  
-<box 100% green|shell prompt running on the target>+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> **ls** root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> **ls**
Line 371: Line 442:
 in_voltage2-in_voltage2_shorted_type   in_voltage3_type               timestamp_type   in_voltage2-in_voltage2_shorted_type   in_voltage3_type               timestamp_type  
 root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements>
-</xterm></box>+</xterm></WRAP>
  
 {{page>software:linux:docs:iio:iio_snippets#Typical ADC scan elements&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#Typical ADC scan elements&noheader&firstseconly&noeditbtn}}
resources/tools-software/linux-drivers/iio-adc/ad7192.1353067003.txt.gz · Last modified: 16 Nov 2012 12:56 by Lars-Peter Clausen