Wiki

no way to compare when less than two revisions

Differences

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


Previous revision
Next revision
resources:tools-software:linux-drivers:iio-dac:ad5676 [01 Feb 2018 15:03] – AD5310R/AD5311R support Stefan Popa
Line 1: Line 1:
 +====== AD5676 IIO DAC Linux Driver ======
 +
 +===== Supported Devices =====
 +
 +This driver supports the
 +  * [[adi>AD5310R]]
 +  * [[adi>AD5311R]]
 +  * [[adi>AD5671R]]
 +  * [[adi>AD5672R]]
 +  * [[adi>AD5675R]]
 +  * [[adi>AD5676]]
 +  * [[adi>AD5676R]]
 +  * [[adi>AD5683R]]
 +  * [[adi>AD5684R]]
 +  * [[adi>AD5685R]]
 +  * [[adi>AD5686]]
 +  * [[adi>AD5686R]]
 +  * [[adi>AD5691R]]
 +  * [[adi>AD5692R]]
 +  * [[adi>AD5693]]
 +  * [[adi>AD5693R]]
 +  * [[adi>AD5694]]
 +  * [[adi>AD5694R]]
 +  * [[adi>AD5695R]]
 +  * [[adi>AD5696]]
 +  * [[adi>AD5696R]]
 +
 +==== Reference Circuits  ====
 +  * [[adi>CN0229]]
 +
 +===== Evaluation Boards =====
 +
 +  * [[adi>EVAL-AD5683RSDZ]]
 +  * [[adi>EVAL-AD5684RSDZ]]
 +  * [[adi>EVAL-AD5686RSDZ]]
 +  * [[adi>EVAL-AD5693RSDZ]]
 +
 +===== Description =====
 +
 +This is a Linux industrial I/O ([[software:linux:docs:iio:iio|IIO]]) subsystem driver, targeting multi-channel serial interface DACs.
 +The industrial I/O subsystem provides a unified framework for drivers for many different types of converters and sensors using a number of different physical interfaces (i2c, spi, etc).
 +See [[software:linux:docs:iio:iio|IIO]] for more information.
 + 
 +====== Source Code ======
 +
 +===== Status =====
 +
 +^ Source ^ Mainlined? ^
 +| [[https://github.com/analogdevicesinc/linux/blob/rpi-4.9.y/drivers/iio/dac/|git]] | [No] |
 +
 +===== Files =====
 +
 +^ Function ^ File ^
 +| driver  | [[https://github.com/analogdevicesinc/linux/blob/rpi-4.9.y/drivers/iio/dac/ad5686.c]] |
 +| driver  | [[https://github.com/analogdevicesinc/linux/blob/rpi-4.9.y/drivers/iio/dac/ad5686.h]] |
 +| driver  | [[https://github.com/analogdevicesinc/linux/blob/rpi-4.9.y/drivers/iio/dac/ad5686-spi.c]] |
 +| driver  | [[https://github.com/analogdevicesinc/linux/blob/rpi-4.9.y/drivers/iio/dac/ad5696-i2c.c]] |
 +
 +===== Devicetree =====
 +
 +Required devicetree properties for spi devices:
 +  * compatible: Needs to be the name of the device. E.g. "ad5676"
 +  * reg: The chipselect number used for the device
 +  * spi-max-frequency: Maximum SPI clock frequency.
 +  * spi-cpol: Needs to be set for the correct SPI mode
 +  * vcc-supply: Phandle to the fixed regulator
 +
 +<code>
 +        adc_vref: fixedregulator@0 {
 +         compatible = "regulator-fixed";
 + regulator-name = "fixed-supply";
 + regulator-min-microvolt = <2500000>;
 + regulator-max-microvolt = <2500000>;
 + regulator-boot-on;
 + };
 +
 + #address-cells = <1>;
 + #size-cells = <0>;
 + status = "okay";
 +
 + ad5676@0 {
 + compatible = "ad5676";
 + reg = <0>;
 + spi-max-frequency = <1000000>;
 + spi-cpha;
 + vcc-supply = <&adc_vref>;
 + };
 +</code>
 +
 +Required devicetree properties for i2c devices:
 +  * compatible: Needs to be the name of the device. E.g. "AD5696"
 +  * reg: The chipselect number used for the device
 +  * vcc-supply: Phandle to the fixed regulator
 +
 +<code>
 +        adc_vref: fixedregulator@0 {
 +         compatible = "regulator-fixed";
 + regulator-name = "fixed-supply";
 + regulator-min-microvolt = <2500000>;
 + regulator-max-microvolt = <2500000>;
 + regulator-boot-on;
 + };
 +
 + #address-cells = <1>;
 + #size-cells = <0>;
 + status = "okay";
 +
 + ad5696@e {
 +     compatible = "ad5696";
 +     reg = <0xe>;
 +     vcc-supply = <&adc_vref>;
 + };
 +</code>
 +
 +====== Driver testing ======
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/> **cd /sys/bus/iio/devices/**
 +root:/sys/bus/iio/devices> ls
 +iio:device0
 +
 +root:/sys/bus/iio/devices> **cd iio\:device0**
 +
 +root:/sys/bus/iio/devices/iio:device0> **ls -l**
 +-r--r--r-- 1 root root 4096 Nov 11 12:03 dev
 +-r--r--r-- 1 root root 4096 Nov 11 12:03 name
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage0_powerdown
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage0_powerdown_mode
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage0_raw
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage1_powerdown
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage1_powerdown_mode
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage1_raw
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage2_powerdown
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage2_powerdown_mode
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage2_raw
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage3_powerdown
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage3_powerdown_mode
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage3_raw
 +-r--r--r-- 1 root root 4096 Nov 11 12:03 out_voltage_powerdown_mode_available
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 out_voltage_scale
 +drwxr-xr-x 2 root root    0 Nov 11 12:03 power
 +lrwxrwxrwx 1 root root    0 Nov 11 12:03 subsystem -> ../../../../../../../bus/iio
 +-rw-r--r-- 1 root root 4096 Nov 11 12:03 uevent
 +</xterm></WRAP>
 +
 +=== Show device name ===
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **cat name**
 +ad5696
 +</xterm></WRAP>
 +
 +=== Show scale ===
 +
 +**Description:**\\
 +scale to be applied to in_voltage0_raw in order to obtain the measured voltage in millivolts.
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **cat out_voltage_scale **
 +0.038146972
 +</xterm></WRAP>
 +
 +=== Set channel Y output voltage ===
 +
 +**Description:**\\
 +/sys/bus/iio/devices/deviceX/out_voltageY_raw\\
 +
 +Raw (unscaled, no bias etc.) output voltage for
 +channel Y.
 +
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **echo 10000 > out_voltage0_raw**
 +</xterm></WRAP>
 +
 +**U** = //out_voltage0_raw * out_voltage_scale// = 10000 * 0.038140 = **381.40 //mV//**
 +
 +=== List available power down modes ===
 +
 +/sys/bus/iio/devices/deviceX/out_powerdown_mode_available
 +
 +**Description:**\\
 +Lists all available output power down modes.
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **cat out_voltage_powerdown_mode_available**
 +1kohm_to_gnd 100kohm_to_gnd three_state
 +</xterm></WRAP>
 +
 +=== Set channel Y power down mode ===
 +
 +/sys/bus/iio/devices/deviceX/out_voltageY_powerdown_mode
 +
 +**Description:**\\
 +Specifies the output power down mode.
 +DAC output stage is disconnected from the amplifier and\\
 +
 +| 1kohm_to_gnd | connected to ground via an 1kOhm resistor |
 +| 100kohm_to_gnd | connected to ground via an 100kOhm resistor |
 +| three_state | left floating |
 +
 +For a list of available output power down options read
 +out_voltageX_powerdown_mode_available.
 +
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **echo three_state > out_voltage0_powerdown_mode**
 +root:/sys/bus/iio/devices/iio:device0> **cat out_voltage0_powerdown_mode**
 +three_state
 +</xterm></WRAP>
 +
 +=== Enable power down mode on output Y ===
 +
 +/sys/bus/iio/devices/deviceX/out_voltageY_powerdown
 +
 +**Description:**\\
 +Writing 1 causes output Y to enter the power down mode specified
 +by the corresponding out_voltageY_powerdown_mode. Clearing returns to
 +normal operation. Y may be suppressed if all outputs are
 +controlled together.
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root:/sys/bus/iio/devices/iio:device0> **echo 1 > out_voltage0_powerdown**
 +root:/sys/bus/iio/devices/iio:device0>  **cat out_voltage0_powerdown**
 +1
 +root:/sys/bus/iio/devices/iio:device0> **echo 0 > out_voltage0_powerdown**
 +root:/sys/bus/iio/devices/iio:device0>  **cat out_voltage0_powerdown**
 +0
 +</xterm></WRAP>
 +
 +
 +====== More Information ======
 +
 +{{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}}
  
resources/tools-software/linux-drivers/iio-dac/ad5676.txt · Last modified: 20 Nov 2020 10:32 by Alexandru Ardelean