From 1a0637508caa7add413086b709c8f56d650cefc9 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Fri, 27 Mar 2026 16:49:49 +0200 Subject: [PATCH 1/6] reference-designs/eval-ad719x: Add untracked wiki-migration pages Co-Authored-By: Claude Opus 4.6 --- .../reference-designs/eval-ad719x/ad7190.rst | 224 ++++++ .../reference-designs/eval-ad719x/ad7192.rst | 653 ++++++++++++++++++ .../reference-designs/eval-ad719x/ad7193.rst | 208 ++++++ .../ad719x_mbed_iio_application.rst | 245 +++++++ .../reference-designs/eval-ad719x/index.rst | 11 + .../linux-drivers/iio-adc/ad7192.rst | 653 ++++++++++++++++++ .../ad719x_mbed_iio_application.rst | 245 +++++++ .../tools-software/uc-drivers/ad7193.rst | 296 ++++++++ .../uc-drivers/renesas/ad7190.rst | 224 ++++++ .../uc-drivers/renesas/ad7193.rst | 208 ++++++ 10 files changed, 2967 insertions(+) create mode 100644 docs/solutions/reference-designs/eval-ad719x/ad7190.rst create mode 100644 docs/solutions/reference-designs/eval-ad719x/ad7192.rst create mode 100644 docs/solutions/reference-designs/eval-ad719x/ad7193.rst create mode 100644 docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst create mode 100644 docs/solutions/reference-designs/eval-ad719x/index.rst create mode 100644 docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst create mode 100644 docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst create mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst create mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst create mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7190.rst b/docs/solutions/reference-designs/eval-ad719x/ad7190.rst new file mode 100644 index 00000000000..653fe9aa49b --- /dev/null +++ b/docs/solutions/reference-designs/eval-ad719x/ad7190.rst @@ -0,0 +1,224 @@ +AD7190 - Microcontroller No-OS Driver +===================================== + +Supported Devices +----------------- + +- :adi:`AD7190` +- :adi:`AD7192` +- :adi:`AD7195` + +Evaluation Boards +----------------- + +- :adi:`EVAL-AD7190EBZ` +- :adi:`EVAL-AD7192EBZ` +- :adi:`EVAL-AD7195EBZ` + +Overview +-------- + +The :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` are low noise, complete analog front ends for high precision measurement applications. Devices contain a low noise, 24-bit sigma-delta (Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means that signals of small amplitude can be interfaced directly to the ADC. The :adi:`AD7195` contains ac excitation, which is used to remove dc-induced offsets from bridge sensors. + +Devices can be configured to have two differential inputs or four pseudo differential inputs. The on-chip channel sequencer allows several channels to be enabled, and the :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` sequentially convert on each enabled channel. This simplifies communication with the parts. The on-chip 4.92 MHz clock can be used as the clock source to the ADC or, alternatively, an external clock or crystal can be used. The output data rate from the parts can be varied from 4.7 Hz to 4.8 kHz. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz.jpg + :align: center + +The goal of this project (Microcontroller No-OS) is to be able to provide +reference projects for lower end processors, which can't run Linux, or aren't +running a specific operating system, to help those customers using +microcontrollers with ADI parts. Here you can find a generic driver which can be +used as a base for any microcontroller platform and also specific drivers for +Renesas platforms. + +Driver Description +------------------ + +The driver contains two parts: + +- The driver for the AD7190 part, which may be used, without modifications, with any microcontroller. +- The Communication Driver, where the specific communication functions for the + desired type of processor and communication protocol have to be implemented. + This driver implements the communication with the device and hides the actual + details of the communication protocol to the ADI driver. + +The Communication Driver has a standard interface, so the AD7190 driver can be +used exactly as it is provided. + +There are three functions which are called by the AD7190 driver: + +- SPI_Init() – initializes the communication peripheral. +- SPI_Write() – writes data to the device. +- SPI_Read() – reads data from the device. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/spi_architecture.png + :align: center + +.. container:: centeralign + + SPI driver architecture + +The following functions are implemented in this version of AD7190 driver: + ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| Function | Description | ++=============================================================================================================================================+==========================================================================+ +| void AD7190_SetRegisterValue(unsigned char registerAddress, unsigned long registerValue, unsigned char bytesNumber, unsigned char modifyCS) | Writes data into a register. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_GetRegisterValue(unsigned char registerAddress, unsigned char bytesNumber, unsigned char modifyCS) | Reads the value of a register. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned char AD7190_Init(void) | Initializes the SPI peripheral and checks if the AD7190 part is present. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_Reset(void) | Resets the device. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_SetPower(unsigned char pwrMode) | Set device to idle or power-down. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_WaitRdyGoLow(void) | Waits for RDY pin to go low. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_ChannelSelect(unsigned short channel) | Selects the channel to be enabled. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_Calibrate(unsigned char mode, unsigned char channel) | Performs the given calibration to the specified channel. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_RangeSetup(unsigned char polarity, unsigned char range) | Selects the polarity of the conversion and the ADC input range. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_SingleConversion(void) | Returns the result of a single conversion. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_ContinuousReadAvg(unsigned char sampleNumber) | Returns the average of several conversion results. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_TemperatureRead(void) | Read data from temperature sensor and converts it to Celsius degrees. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ + +**HW Platform(s):** + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `Renesas Demo Kit for RX62N (Renesas) `_ + +Downloads +--------- + +.. admonition:: Download + :class: download + + + - `AD7190 Generic Driver `_ + - `AD7190 RL78G13 Driver `_ + - `AD7190 RX62N Driver `_ + + +Renesas RL78G13 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7190 +demonstration project on a Renesas RL78G13 platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- :adi:`EVAL-AD7190EBZ (Analog Devices) ` + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ + +Hardware Setup +-------------- + +An EVAL-AD7190EBZ has to be interfaced with the Renesas Demonstration Kit (RDK) +for RL78G13: + +:: + + EVAL-AD7190EBZ J2 connector Pin CS → YRDKRL78G13 J11 connector Pin 1 + EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRL78G13 J11 connector Pin 2 + EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRL78G13 J11 connector Pin 3 + EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRL78G13 J11 connector Pin 4 + EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRL78G13 J11 connector Pin 5 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7190 part is present; +- configures the AD7190 part; +- reads data from single conversion; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rl78g13_software_tutorial_without_applilet3 `_ + +Renesas RX62N Quick Start Guide +=============================== + +This section contains a description of the steps required to run the AD7190 +demonstration project on a Renesas RX62N platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RX62N (Renesas) `_ +- :adi:`EVAL-AD7190EBZ (ADI) ` + +Required Software +----------------- + +- `High-performance Embedded Workshop for RX62N family `_ + +Hardware Setup +-------------- + +An EVAL-AD7190EBZ board has to be interfaced with the Renesas Demonstration Kit +(RDK) for RX62N: + +:: + + EVAL-AD7190EBZ J2 connector Pin CS → YRDKRX62N J8 connector Pin 15 + EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRX62N J8 connector Pin 19 + EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRX62N J8 connector Pin 22 + EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRX62N J8 connector Pin 20 + EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRX62N J8 connector Pin 4 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7190 part is present; +- configures the AD7190 part; +- reads data from single conversion; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rx62n_software_design `_ + +More information +================ + +.. note:: + + See `more-information `_ diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7192.rst b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst new file mode 100644 index 00000000000..c40a70b8a11 --- /dev/null +++ b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst @@ -0,0 +1,653 @@ +AD7192 IIO High Precision ADC Linux Driver +========================================== + +Supported Devices +----------------- + +- :adi:`AD7190` +- :adi:`AD7192` +- :adi:`AD7193` (Upstream 4.6+) +- :adi:`AD7194` +- :adi:`AD7195` + +Reference Circuits +------------------ + +- :adi:`CN0119` +- :adi:`CN0102` +- :adi:`CN0155` +- :adi:`CN0209` +- :adi:`CN0251` +- :adi:`CN0287` +- :adi:`CN0371` + +Evaluation Boards +----------------- + +- :adi:`EVAL-AD7190EBZ` +- :adi:`EVAL-AD7192EBZ` +- :adi:`EVAL-AD7193EBZ` +- :adi:`EVAL-AD7194EBZ` +- :adi:`EVAL-AD7195EBZ` + +Description +----------- + +This is a Linux industrial I/O (:doc:`IIO `) subsystem driver, targeting multi channel serial interface ADCs. 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 :doc:`IIO ` for more information. + +Source Code +=========== + +Status +------ + ++--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| Source | Mainlined? | ++====================================================================================================================+====================================================================================================================+ +| `git `_ | `yes `_ | ++--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ + +Files +----- + ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| Function | File | ++==========+==================================================================================================================================================+ +| driver | `drivers/staging/iio/adc/ad7192.c `_ | ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| include | `drivers/staging/iio/adc/ad7192.h `_ | ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Example platform device initialization +====================================== + +For compile time configuration, it’s common Linux practice to keep board- and +application-specific configuration out of the main driver file, instead putting +it into the board support file. + +For devices on custom boards, as typical of embedded and SoC-(system-on-chip) +based hardware, Linux uses platform_data to point to board-specific structures +describing devices and how they are connected to the SoC. This can include +available ports, chip variants, preferred modes, default initialization, +additional pin roles, and so on. This shrinks the board-support packages (BSPs) +and minimizes board and application specific #ifdefs in drivers. + +The reference voltage may vary between boards and models. The platform_data for +the device's "struct device" holds this information. + +.. code:: c + + /** + * struct ad7192_platform_data - platform/board specific information + * @vref_mv: the external reference voltage in millivolt + * @ext_clk_Hz: the external clock frequency in Hz, if not set + * the driver uses the internal clock (16.776 MHz) + * @clock_source_sel: [0..3] + * 0 External 4.92 MHz clock connected from MCLK1 to MCLK2 + * 1 External Clock applied to MCLK2 + * 2 Internal 4.92 MHz Clock not available at the MCLK2 pin + * 3 Internal 4.92 MHz Clock available at the MCLK2 pin + * @refin2_en: REFIN1/REFIN2 Reference Select (AD7190/2 only) + * @rej60_en: 50/60Hz notch filter enable + * @sinc3_en: SINC3 filter enable (default SINC4) + * @chop_en: CHOP mode enable + * @buf_en: buffered input mode enable + * @unipolar_en: unipolar mode enable + * @burnout_curr_en: constant current generators on AIN(+|-) enable + */ + + struct ad7192_platform_data { + u16 vref_mv; + u32 ext_clk_Hz; + u8 clock_source_sel; + bool refin2_en; + bool rej60_en; + bool sinc3_en; + bool chop_en; + bool buf_en; + bool unipolar_en; + bool burnout_curr_en; + }; + +.. code:: c + + static struct ad7192_platform_data ad7192_pdata = { + .vref_mv = 3300, + .clock_source_sel = 2, + .refin2_en = true, + .rej60_en = false, + .sinc3_en = false, + .chop_en = false, + .buf_en = false, + .unipolar_en = true, + .burnout_curr_en = false, + }; + +Unlike PCI or USB devices, SPI devices are not enumerated at the hardware level. +Instead, the software must know which devices are connected on each SPI bus +segment, and what slave selects these devices are using. For this reason, the +kernel code must instantiate SPI devices explicitly. The most common method is +to declare the SPI devices by bus number. + +This method is appropriate when the SPI bus is a system bus, as in many embedded +systems, wherein each SPI bus has a number which is known in advance. It is thus +possible to pre-declare the SPI devices that inhabit this bus. This is done with +an array of struct spi_board_info, which is registered by calling +spi_register_board_info(). + +For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`__ + +Depending on the converter IC used, you may need to set the modalias +accordingly, matching your part name. It may also required to adjust +max_speed_hz. Please consult the datasheet, for maximum spi clock supported by +the device in question. + +.. code:: c + + static struct spi_board_info board_spi_board_info[] __initdata = { + #if defined(CONFIG_AD7192) \ + || defined(CONFIG_AD7192_MODULE) + { + .modalias = "ad7192", + .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* CS, change it for your board */ + .platform_data = &ad7192_pdata, + .mode = SPI_MODE_3, + .irq = IRQ_PF6, + }, + #endif + }; + +.. code:: c + + static int __init board_init(void) + { + [--snip--] + + spi_register_board_info(board_spi_board_info, ARRAY_SIZE(board_spi_board_info)); + + [--snip--] + + return 0; + } + arch_initcall(board_init); + +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: + +:: + + /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; + }; + }; + }; + +.. 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. + +Adding Linux driver support +=========================== + +Configure kernel with "make menuconfig" (alternatively use "make xconfig" or +"make qconfig") + +.. hint:: + + The AD7192 Driver depends on CONFIG_SPI + +:: + + Linux Kernel Configuration + Device Drivers ---> + [*] Staging drivers ---> + <*> Industrial I/O support ---> + --- Industrial I/O support + - *- Enable ring buffer support within IIO + - *- Industrial I/O lock free software ring + - *- Enable triggered sampling support + + Analog to digital converters + [--snip--] + + <*> Analog Devices AD7190 AD7192 AD7195 ADC driver + + [--snip--] + +Hardware configuration +====================== + +.. image:: https://wiki.analog.com/_media/resources/tools-software/linux-drivers/iio-adc/ad7192_eval_lr.jpg + :width: 600 + +Driver testing +============== + +Each and every IIO device, typically a hardware chip, has a device folder under +/sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under +every of these directory folders reside a set of files, depending on the +characteristics and features of the hardware device in question. These files are +consistently generalized and documented in the IIO ABI documentation. In order +to determine which IIO deviceX corresponds to which hardware device, the user +can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the +sequence in which the iio device drivers are loaded/registered is constant, the +numbering is constant and may be known in advance. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/> cd /sys/bus/iio/devices/ + root:/sys/bus/iio/devices> ls + iio:device0 trigger0 + + root:/sys/bus/iio/devices> cd iio:device0 + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> ls -l + -rw-r--r-- 1 root root 4096 Jan 4 16:59 bridge_switch_en + drwxr-xr-x 4 root root 0 Jan 4 16:59 buffer + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale_available + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1-in_voltage2_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2-in_voltage2_shorted_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3-in_voltage4_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage4_raw + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale_available + -r--r--r-- 1 root root 4096 Jan 4 16:59 name + drwxr-xr-x 2 root root 0 Jan 4 16:59 power + -rw-r--r-- 1 root root 4096 Jan 5 11:38 sampling_frequency + lrwxrwxrwx 1 root root 0 Jan 4 16:59 subsystem -> ../../../../../bus/iio + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_raw + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_scale + drwxr-xr-x 2 root root 0 Jan 4 16:59 trigger + -rw-r--r-- 1 root root 4096 Jan 4 16:59 uevent + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> + + +Show device name +---------------- + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat name + ad7192 + + +Set sampling frequency / update rate +------------------------------------ + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency + 10 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 50 > sampling_frequency + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency + 50 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> + + +Show available scales for differential input channels +----------------------------------------------------- + +Lists all available scales for the differential input pairs: + +================= =================================== +ADC Input Pair Channel name +================= =================================== +AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw +AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw +AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw +================= =================================== + +Setting these directly influences the ADC input range, by altering the GAIN +amplifier. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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 + + +Show available scales for pseudo-differential input channels +------------------------------------------------------------ + +Lists all available scales for the differential input pairs: + +============== =============== +ADC Input Pair Channel name +============== =============== +AIN1 - AINCOM in_voltage1_raw +AIN2 - AINCOM in_voltage2_raw +AIN3 - AINCOM in_voltage3_raw +AIN4 - AINCOM in_voltage4_raw +============== =============== + +Setting these directly influences the ADC input range, by altering the GAIN +amplifier. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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 + + +Set scale for differential input channels +----------------------------------------- + +Scale to be applied to in1-in2_raw, in2-in3_raw in order to obtain the measured +voltage in millivolts. Allows the user to select one scale out of the available +scales. If the written scale differs from the current scale. The driver performs +full and zero offset calibration on all differential input channels. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale + 0.000393390 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0.000196690 > in_voltage-in_voltage_scale + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale + 0.000196690 + + +Show channel in_voltage1 measurement +------------------------------------ + +**Description:** Raw unscaled voltage measurement on channel in_voltage1 + +================= =================================== +ADC Input Pair Channel name +================= =================================== +AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw +AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw +AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw +AIN1 - AINCOM in_voltage1_raw +AIN2 - AINCOM in_voltage2_raw +AIN3 - AINCOM in_voltage3_raw +AIN4 - AINCOM in_voltage4_raw +================= =================================== + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in1_raw + -1 + + +**U** = *in_voltage1_raw \* in_voltage_scale* = 3983772\* 0.000393390 = **1567.17606708 mV** + +Show channel in_voltage1-in_voltage2 measurement +------------------------------------------------ + +**Description:** Raw unscaled voltage measurement on channel in_voltage1-in_voltage2 + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage1-in_voltage2_raw + -1 + + +**U** = *in_voltage1-in_voltage3_raw \* in_voltage-in_voltage_scale* = -1 \* 0.000393390 = **-0.000393390 mV** + +Show internal temperature +------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/in_temp0_raw Shows raw unscaled temperature. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_temp0_raw + -175 + + +Bride power-down switch control +------------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/bridge_switch_en Writing 1 closes the bridge switch. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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> cat bridge_switch_en + 1 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > bridge_switch_en + + +AC excitation control (AD7195 only) +----------------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/ac_excitation_en Writing 1 enables AC excitation on the AD7195 ACX strobes. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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> cat ac_excitation_en + 1 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > ac_excitation_en + + +Trigger management +------------------ + +.. hint:: + + This driver only supports it's own default trigger source ad7192-dev0 + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat trigger/current_trigger + ad7192-dev0 + + +Buffer management +----------------- + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/iio:buffer> ls + enable length + + +The Industrial I/O subsystem provides support for various ring buffer based data +acquisition methods. Apart from device specific hardware buffer support, the +user can chose between two different software ring buffer implementations. One +is the IIO lock free software ring, and the other is based on Linux kfifo. +Devices with buffer support feature an additional sub-folder in the +/sys/bus/iio/devices/deviceX/ folder hierarchy. Called deviceX:bufferY, where Y +defaults to 0, for devices with a single buffer. + +Every buffer implementation features a set of files: + +| **length** +| Get/set the number of sample sets that may be held by the buffer. + +| **enable** +| Enables/disables the buffer. This file should be written last, after length and selection of scan elements. + +| **watermark** +| A single positive integer specifying the maximum number of scan elements to wait for. Poll will block until the watermark is reached. Blocking read will wait until the minimum between the requested read amount or the low water mark is available. Non-blocking read will retrieve the available samples from the buffer even if there are less samples then watermark level. This allows the application to block on poll with a timeout and read the available samples after the timeout expires and thus have a maximum delay guarantee. + +| **data_available** +| A read-only value indicating the bytes of data available in the buffer. In the case of an output buffer, this indicates the amount of empty space available to write data to. In the case of an input buffer, this indicates the amount of data available for reading. + +| **length_align_bytes** +| Using the high-speed interface. DMA buffers may have an alignment requirement for the buffer length. Newer versions of the kernel will report the alignment requirements associated with a device through the \`length_align_bytes\` property. + +| **scan_elements** +| The scan_elements directory contains interfaces for elements that will be captured for a single triggered sample set in the buffer. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> ls + in_voltage1-in_voltage2_en in_voltage2_en in_voltage4_en + in_voltage1-in_voltage2_index in_voltage2_index in_voltage4_index + in_voltage1-in_voltage2_type in_voltage2_type in_voltage4_type + in_voltage1_en in_voltage3-in_voltage4_en in_temp0_en + in_voltage1_index in_voltage3-in_voltage4_index in_temp0_index + in_voltage1_type in_voltage3-in_voltage4_type in_temp0_type + in_voltage2-in_voltage2_shorted_en in_voltage3_en timestamp_en + in_voltage2-in_voltage2_shorted_index in_voltage3_index timestamp_index + in_voltage2-in_voltage2_shorted_type in_voltage3_type timestamp_type + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> + + +| **in_voltageX_en / in_voltageX-voltageY_en / timestamp_en:** +| Scan element control for triggered data capture. Writing 1 will enable the scan element, writing 0 will disable it + +| **in_voltageX_type / in_voltageX-voltageY_type / timestamp_type:** +| Description of the scan element data storage within the buffer and therefore in the form in which it is read from user-space. Form is [s|u]bits/storage-bits. s or u specifies if signed (2's complement) or unsigned. bits is the number of bits of data and storage-bits is the space (after padding) that it occupies in the buffer. Note that some devices will have additional information in the unused bits so to get a clean value, the bits value must be used to mask the buffer output value appropriately. The storage-bits value also specifies the data alignment. So u12/16 will be a unsigned 12 bit integer stored in a 16 bit location aligned to a 16 bit boundary. For other storage combinations this attribute will be extended appropriately. + +| **in_voltageX_index / in_voltageX-voltageY_index / timestamp_index:** +| A single positive integer specifying the position of this scan element in the buffer. Note these are not dependent on what is enabled and may not be contiguous. Thus for user-space to establish the full layout these must be used in conjunction with all \_en attributes to establish which channels are present, and the relevant \_type attributes to establish the data storage format. + +More Information +================ + +- IIO mailing list: linux-iio@vger.kernel.org +- `IIO Linux Kernel Documentation sysfs-bus-iio-\* `_ +- `IIO Documentation `_ +- :doc:`IIO test and visualization application ` +- :doc:`libiio - IIO system library ` +- :doc:`libiio - Internals ` +- :doc:`Pointers and good books ` +- `IIO High Speed `_ +- `Software Defined Radio using the IIO framework `_ +- + +|libiio introduction| + +*Need Help?* + +- :ez:`Analog Devices Linux Device Drivers Help Forum ` +- `Ask a Question `_ + +.. |libiio introduction| image:: https://wiki.analog.com/_media/software/linux/docs/iio/youtube>p_vntewue24 diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7193.rst b/docs/solutions/reference-designs/eval-ad719x/ad7193.rst new file mode 100644 index 00000000000..69402395912 --- /dev/null +++ b/docs/solutions/reference-designs/eval-ad719x/ad7193.rst @@ -0,0 +1,208 @@ +AD7193 - No-OS Driver for Renesas Microcontroller Platforms +=========================================================== + +.. include:: ../ad7193.rst + +**HW Platform(s):** + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `Renesas Demo Kit for RX62N (Renesas) `_ + +Downloads +--------- + +.. admonition:: Download + :class: download + + + - `AD7193 Generic Driver `_ + - `AD7193 RL78G13 Driver `_ + - `AD7193 RX62N Driver `_ + - **AD7193 Driver:** :git-no-OS:`drivers/adc/ad7193` + - **PmodAD5 Demo for RL78G14:** :git-no-OS:`Renesas/RL78G14/PmodAD5` + - **RL78G14 Common Drivers:** :git-no-OS:`Renesas/RL78G14/Common` + + +Renesas RL78G13 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RL78G13 platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `PmodAD5 `_ + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ + +Hardware Setup +-------------- + +A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image +below). + +|image1| + +.. important:: + + + - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range + for AVDD is 3.0V ≤ AVDD ≤ 5.25V + + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part for differential input on CH0(AIN1-AIN2); +- first reads data from a single conversion and displays it; +- then reads data from multiple conversions, calculates the average value and displays it; +- in the end reads data from the temperature sensor and displays it in degrees + Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13_screen.jpg + :align: center + :width: 200 + +Software Project Setup +---------------------- + +.. note:: + + See `rl78g13_software_tutorial_without_applilet3 `_ + +Renesas RL78G14 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RL78G14 platform using the PmodAD5. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G14 (Renesas) `_ +- PmodAD5 + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ +- The AD7193 demonstration project for the Renesas RL78G14 platform. + +.. note:: + + The AD7193 demonstration project for the Renesas RL78G14 platform consists of + three parts: the AD7193 Driver, the PmodAD5 Demo for RL78G14 and the RL78G14 + Common Drivers. + + + All three parts have to be downloaded. + +Hardware Setup +-------------- + +A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image +below). + +|image2| + +.. important:: + + + - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range + for AVDD is 3.0V ≤ AVDD ≤ 5.25V + + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part for differential input on CH0(AIN1-AIN2); +- first reads data from a single conversion and displays it; +- then reads data from multiple conversions, calculates the average value and displays it; +- in the end reads data from the temperature sensor and displays it in degrees + Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14_screen.jpg + :align: center + +Software Project Tutorial +------------------------- + +.. note:: + + See `rl78g14_software_tutorial `_ + +Renesas RX62N Quick Start Guide +=============================== + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RX62N platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RX62N (Renesas) `_ +- PmodAD5 + +Required Software +----------------- + +- `High-performance Embedded Workshop for RX62N family `_ +- `Renesas Peripheral Driver Library for RX62N family `_ + +Hardware Setup +-------------- + +A PmodAD5 has to be interfaced with the Renesas Demonstration Kit (RDK) for +RX62N: + +:: + + PmodAD5 Pin 1 (CS) → YRDKRX62N J8 connector Pin 15 + PmodAD5 Pin 2 (MOSI) → YRDKRX62N J8 connector Pin 19 + PmodAD5 Pin 3 (MISO) → YRDKRX62N J8 connector Pin 22 + PmodAD5 Pin 4 (CLK) → YRDKRX62N J8 connector Pin 20 + PmodAD5 Pin 5 (GND) → YRDKRX62N J8 connector Pin 4 + PmodAD5 Pin 6 (VCC) → YRDKRX62N J8 connector Pin 3 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rx62n_software_design `_ + +More information +================ + +.. include:: ../more-information.rst + +.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13.jpg + :width: 500 +.. |image2| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14.jpg diff --git a/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst b/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst new file mode 100644 index 00000000000..20a5e5069c2 --- /dev/null +++ b/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst @@ -0,0 +1,245 @@ +AD719x IIO Application +====================== + +Introduction +============ + +This page gives an overview of using the ARM platforms supported (default is +Mbed) firmware example with Analog Devices AD719x Evaluation board and SDP-K1 +controller board. This example code leverages the ADI developed IIO (Industrial +Input Output) ecosystem to evaluate the AD719x device by providing a device +debug and data capture support. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_introduction#introduction&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/iio_support_introduction#Introduction&showfooter=nofooter + +-------------- + +Useful links +------------ + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/useful_links#useful_link&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/useful_links#Useful Link&showfooter=nofooter + +- :git-no-OS:`AD719x No-OS drivers ` +- :adi:`AD7190 Product Page ` +- :adi:`AD7192 Product Page ` +- :adi:`AD7193 Product Page ` +- :adi:`AD7195 Product Page ` + +-------------- + +Hardware Connections +~~~~~~~~~~~~~~~~~~~~ + +Jumper Settings: SDP-K1: Connect the VIO_ADJUST jumper on the SDP-K1 board to +3.3V position to drive SDP-K1 GPIOs at 3.3V + +EVAL-AD719X: + +- Stack the EVAL-AD719X-ASDZ on the Arduino connectors of the SDP-K1 board. +- Connect a male-to-male jumper wire between D8 and D12 on Arduino connectors. +- Set the LK7 and LK8 jumper headers to 3.3V. +- Set LK12 jumper header to position + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_hardware_connection.png + :width: 800 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/hardware_connections_uart#uart_connections&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/hardware_connections_uart#UART Connections&showfooter=nofooter + +-------------- + +Software Downloads +================== + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_software_downloads#software_downloads&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/iio_support_software_downloads#Software Downloads&showfooter=nofooter + +-------------- + +Evaluating AD719x Using IIO Ecosystem +------------------------------------- + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/note_hardware_connections#note_in_hardware_connections&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/note_hardware_connections#Note in Hardware Connections&showfooter=nofooter + +Running IIO Oscilloscope (Client) +--------------------------------- + +Open the IIO Oscilloscope application from start menu and configure the serial +(UART) settings as shown below. Click on refresh button and AD719X device should +pop-up in IIO devices list. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_new.png + :width: 800 + +Click 'Connect' and it should by default open the data ‘Capture’ window. You can +drag aside or close this window to see the main ‘Debug and DMM’ tab window. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_windows.jpg + :width: 800 + +Configure/Access Device Attributes (Parameters) +----------------------------------------------- + +The IIO Oscilloscope allows user to access and configure different device +parameters, called as 'Device Attributes“. There are 2 types of attributes: + +- Device Attributes (Global): Access/Configure common device parameters. +- Channel Attributes (Specific to channels): Access/Configure channel specific + device parameters. + +How to read and write attribute: + +- To 'Read' an attribute, simply select the attribute from a list or press 'Read' button on left side. +- To 'Write' an attribute, select attribute value in the 'value field' and + press 'Write' button. + +Using DMM Tab to Read DC Voltage on Input Channels +-------------------------------------------------- + +DMM tab can be used read the instantaneous voltage applied on analog input +channels. Simply select the device and channels to read and press start button. + +*\*Note: The voltage is just instantaneous, so it is not possible to get RMS AC voltage or averaged DC voltage. Also, when using DMM tab, do not access/use the Data Capture or Debug tab as this could impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_dmm.png + :width: 600 + +Data Capture from IIO Device +---------------------------- + +To capture the data from AD719x IIO device, simply select the device and +channels to read/capture data. The data is plotted as “ADC Raw Value” Vs “Number +of Samples” and is just used for Visualization. The data is read as is from +device without any processing. If user wants to process the data, it must be +done externally by capturing data from the Serial link on controller board. + +*\*Note: The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* + +More info here: :doc:`Data Capture using IIO App ` + +Time Domain Plot +---------------- + +*\*Note: When enabling more than 4 channels, the number of samples should be decreased to 200 to avoid timeout in the IIO oscilloscope.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_plot.png + +Frequency Domain Plot +--------------------- + +*\*Note: Max 4096 samples can be selected for plotting frequency domain response due to limited buffer size in the firmware.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_fft.png + +-------------- + +Python Environment and Scripts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Data capture, device calibration, etc. can be achieved with python based IIO +clients, using 'pyadi-iio' library. A possible option using ADI's pyadi-iio +library in python has been demonstrated in the forthcoming sections. The python +scripts are provided along with firmware package. + +Setting-up Python Environment + +- Please install python into your local machine. The python scripts are developed and executed using python 3.8.0 version, so recommend using version 3.8.0 or beyond. Download python +- Once python is installed, make sure the environment path (on windows machine) is set properly. You can verify if python is installed properly by typing “python --version” command on command line tool such as gitbash, command prompt, power shell, etc. +- Install the “pyadi-iio” python package by executing command “python -m pip + install pyadi-iio”. Detailed guide on installing it is available in Python + Interfaces for ADI Hardware + +- Make sure to install additional support packages by running requirements.txt + file using command “python -m pip install -r requirements.txt” from “scripts/” + directory.” + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_requirement.png + +Modifying/running Python Scripts +-------------------------------- + +- All python scripts specific to ad719x IIO firmware are stored into “scripts” folder present in the project directory. +- Ensure that the firmware is compiled with the noise testing mode, using the + macros in the app_config.h file. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_config.png + +- Update the ‘uri’ interface in script according to COM port assigned to your device (sdp-k1). Default COM port is set to COM16 in all scripts. +- Update the ‘device_name’ variable to match with the device name in the + compiled firmware. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_com.png + +- Enable the channel and size of the sample block for noise analysis. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_samples.png + +Output Obtained from the Python Script While executing the +ad719x_rms_50hz_test.py, the command prompt requests for the number of samples +to be entered by the user. This should be multiple of defined sample block size. +On successful completion of capturing n samples, the noise data is displayed on +the windows and the data points are stored in a csv as adc_data_capture.csv in +the folder where the script is present. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_output.png + :alt: + +|image1| + +-------------- + +AD719x Firmware Structure +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_firmware_structure.png + +app_config.h +------------ + +This file can be used to: + +- Select the active platform using macro “ACTIVE_PLATFORM_MBED” (Only Mbed is supported) +- Select UART baud rate (for physical UART port) using “IIO_UART_BAUD_RATE” macro. Default is 230400. +- Select burst capture mode or continuous capture mode using “DATA_CAPTURE_MODE” macro. +- Select the active device by defining as “DEV_AD7193”. Default is AD7193 +- Uncomment the “BIPOLAR_MODE” macro to enable bipolar mode. Default is Unipolar mode. +- Uncomment the “DIFFERENTIAL_INPUT” macro to enable differential input. + Default is Pseudo differential input. + +ad719x_user_config.c/.h +----------------------- + +These files define the user configurations for the AD719X, such as SPI +parameters (frequency, mode, etc) and other init parameters used by No-OS +drivers to initialize AD719X device (gain, data output rate, reference voltage +etc). + +ad719x_data_capture.c +--------------------- + +This file implements the data capturing logic for the AD719x device. The data +capturing can be done using normal burst mode or continuous mode. + +ad719x_iio.c +------------ + +This file defines getter/setter functions for all the device and channel +specific attributes (related to AD719X devices) to read/write the device +parameters. The majority of device specific functionality is present in this +module. + +No-OS Drivers for AD719x +------------------------ + +The no-OS drivers provide the high level abstracted layer for digital interface +of AD719x devices. The complete digital interface (to access memory map and +perform data read) is done in integration with platform drivers. The +functionality related with no-os drivers is covered in below 2 files: + +- ad719x.c +- ad719x.h + +.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_2.png diff --git a/docs/solutions/reference-designs/eval-ad719x/index.rst b/docs/solutions/reference-designs/eval-ad719x/index.rst new file mode 100644 index 00000000000..1ec30478a04 --- /dev/null +++ b/docs/solutions/reference-designs/eval-ad719x/index.rst @@ -0,0 +1,11 @@ +AD719X +====== + +.. toctree:: + :hidden: + + ad7190 + ad7192 + ad7193 + ad7193 + ad719x_mbed_iio_application diff --git a/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst b/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst new file mode 100644 index 00000000000..c40a70b8a11 --- /dev/null +++ b/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst @@ -0,0 +1,653 @@ +AD7192 IIO High Precision ADC Linux Driver +========================================== + +Supported Devices +----------------- + +- :adi:`AD7190` +- :adi:`AD7192` +- :adi:`AD7193` (Upstream 4.6+) +- :adi:`AD7194` +- :adi:`AD7195` + +Reference Circuits +------------------ + +- :adi:`CN0119` +- :adi:`CN0102` +- :adi:`CN0155` +- :adi:`CN0209` +- :adi:`CN0251` +- :adi:`CN0287` +- :adi:`CN0371` + +Evaluation Boards +----------------- + +- :adi:`EVAL-AD7190EBZ` +- :adi:`EVAL-AD7192EBZ` +- :adi:`EVAL-AD7193EBZ` +- :adi:`EVAL-AD7194EBZ` +- :adi:`EVAL-AD7195EBZ` + +Description +----------- + +This is a Linux industrial I/O (:doc:`IIO `) subsystem driver, targeting multi channel serial interface ADCs. 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 :doc:`IIO ` for more information. + +Source Code +=========== + +Status +------ + ++--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| Source | Mainlined? | ++====================================================================================================================+====================================================================================================================+ +| `git `_ | `yes `_ | ++--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ + +Files +----- + ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| Function | File | ++==========+==================================================================================================================================================+ +| driver | `drivers/staging/iio/adc/ad7192.c `_ | ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| include | `drivers/staging/iio/adc/ad7192.h `_ | ++----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Example platform device initialization +====================================== + +For compile time configuration, it’s common Linux practice to keep board- and +application-specific configuration out of the main driver file, instead putting +it into the board support file. + +For devices on custom boards, as typical of embedded and SoC-(system-on-chip) +based hardware, Linux uses platform_data to point to board-specific structures +describing devices and how they are connected to the SoC. This can include +available ports, chip variants, preferred modes, default initialization, +additional pin roles, and so on. This shrinks the board-support packages (BSPs) +and minimizes board and application specific #ifdefs in drivers. + +The reference voltage may vary between boards and models. The platform_data for +the device's "struct device" holds this information. + +.. code:: c + + /** + * struct ad7192_platform_data - platform/board specific information + * @vref_mv: the external reference voltage in millivolt + * @ext_clk_Hz: the external clock frequency in Hz, if not set + * the driver uses the internal clock (16.776 MHz) + * @clock_source_sel: [0..3] + * 0 External 4.92 MHz clock connected from MCLK1 to MCLK2 + * 1 External Clock applied to MCLK2 + * 2 Internal 4.92 MHz Clock not available at the MCLK2 pin + * 3 Internal 4.92 MHz Clock available at the MCLK2 pin + * @refin2_en: REFIN1/REFIN2 Reference Select (AD7190/2 only) + * @rej60_en: 50/60Hz notch filter enable + * @sinc3_en: SINC3 filter enable (default SINC4) + * @chop_en: CHOP mode enable + * @buf_en: buffered input mode enable + * @unipolar_en: unipolar mode enable + * @burnout_curr_en: constant current generators on AIN(+|-) enable + */ + + struct ad7192_platform_data { + u16 vref_mv; + u32 ext_clk_Hz; + u8 clock_source_sel; + bool refin2_en; + bool rej60_en; + bool sinc3_en; + bool chop_en; + bool buf_en; + bool unipolar_en; + bool burnout_curr_en; + }; + +.. code:: c + + static struct ad7192_platform_data ad7192_pdata = { + .vref_mv = 3300, + .clock_source_sel = 2, + .refin2_en = true, + .rej60_en = false, + .sinc3_en = false, + .chop_en = false, + .buf_en = false, + .unipolar_en = true, + .burnout_curr_en = false, + }; + +Unlike PCI or USB devices, SPI devices are not enumerated at the hardware level. +Instead, the software must know which devices are connected on each SPI bus +segment, and what slave selects these devices are using. For this reason, the +kernel code must instantiate SPI devices explicitly. The most common method is +to declare the SPI devices by bus number. + +This method is appropriate when the SPI bus is a system bus, as in many embedded +systems, wherein each SPI bus has a number which is known in advance. It is thus +possible to pre-declare the SPI devices that inhabit this bus. This is done with +an array of struct spi_board_info, which is registered by calling +spi_register_board_info(). + +For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`__ + +Depending on the converter IC used, you may need to set the modalias +accordingly, matching your part name. It may also required to adjust +max_speed_hz. Please consult the datasheet, for maximum spi clock supported by +the device in question. + +.. code:: c + + static struct spi_board_info board_spi_board_info[] __initdata = { + #if defined(CONFIG_AD7192) \ + || defined(CONFIG_AD7192_MODULE) + { + .modalias = "ad7192", + .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ + .bus_num = 0, + .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* CS, change it for your board */ + .platform_data = &ad7192_pdata, + .mode = SPI_MODE_3, + .irq = IRQ_PF6, + }, + #endif + }; + +.. code:: c + + static int __init board_init(void) + { + [--snip--] + + spi_register_board_info(board_spi_board_info, ARRAY_SIZE(board_spi_board_info)); + + [--snip--] + + return 0; + } + arch_initcall(board_init); + +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: + +:: + + /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; + }; + }; + }; + +.. 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. + +Adding Linux driver support +=========================== + +Configure kernel with "make menuconfig" (alternatively use "make xconfig" or +"make qconfig") + +.. hint:: + + The AD7192 Driver depends on CONFIG_SPI + +:: + + Linux Kernel Configuration + Device Drivers ---> + [*] Staging drivers ---> + <*> Industrial I/O support ---> + --- Industrial I/O support + - *- Enable ring buffer support within IIO + - *- Industrial I/O lock free software ring + - *- Enable triggered sampling support + + Analog to digital converters + [--snip--] + + <*> Analog Devices AD7190 AD7192 AD7195 ADC driver + + [--snip--] + +Hardware configuration +====================== + +.. image:: https://wiki.analog.com/_media/resources/tools-software/linux-drivers/iio-adc/ad7192_eval_lr.jpg + :width: 600 + +Driver testing +============== + +Each and every IIO device, typically a hardware chip, has a device folder under +/sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under +every of these directory folders reside a set of files, depending on the +characteristics and features of the hardware device in question. These files are +consistently generalized and documented in the IIO ABI documentation. In order +to determine which IIO deviceX corresponds to which hardware device, the user +can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the +sequence in which the iio device drivers are loaded/registered is constant, the +numbering is constant and may be known in advance. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/> cd /sys/bus/iio/devices/ + root:/sys/bus/iio/devices> ls + iio:device0 trigger0 + + root:/sys/bus/iio/devices> cd iio:device0 + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> ls -l + -rw-r--r-- 1 root root 4096 Jan 4 16:59 bridge_switch_en + drwxr-xr-x 4 root root 0 Jan 4 16:59 buffer + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale_available + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1-in_voltage2_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2-in_voltage2_shorted_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3-in_voltage4_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3_raw + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage4_raw + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale_available + -r--r--r-- 1 root root 4096 Jan 4 16:59 name + drwxr-xr-x 2 root root 0 Jan 4 16:59 power + -rw-r--r-- 1 root root 4096 Jan 5 11:38 sampling_frequency + lrwxrwxrwx 1 root root 0 Jan 4 16:59 subsystem -> ../../../../../bus/iio + -r--r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_raw + -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_scale + drwxr-xr-x 2 root root 0 Jan 4 16:59 trigger + -rw-r--r-- 1 root root 4096 Jan 4 16:59 uevent + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> + + +Show device name +---------------- + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat name + ad7192 + + +Set sampling frequency / update rate +------------------------------------ + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency + 10 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 50 > sampling_frequency + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency + 50 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> + + +Show available scales for differential input channels +----------------------------------------------------- + +Lists all available scales for the differential input pairs: + +================= =================================== +ADC Input Pair Channel name +================= =================================== +AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw +AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw +AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw +================= =================================== + +Setting these directly influences the ADC input range, by altering the GAIN +amplifier. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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 + + +Show available scales for pseudo-differential input channels +------------------------------------------------------------ + +Lists all available scales for the differential input pairs: + +============== =============== +ADC Input Pair Channel name +============== =============== +AIN1 - AINCOM in_voltage1_raw +AIN2 - AINCOM in_voltage2_raw +AIN3 - AINCOM in_voltage3_raw +AIN4 - AINCOM in_voltage4_raw +============== =============== + +Setting these directly influences the ADC input range, by altering the GAIN +amplifier. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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 + + +Set scale for differential input channels +----------------------------------------- + +Scale to be applied to in1-in2_raw, in2-in3_raw in order to obtain the measured +voltage in millivolts. Allows the user to select one scale out of the available +scales. If the written scale differs from the current scale. The driver performs +full and zero offset calibration on all differential input channels. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale + 0.000393390 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0.000196690 > in_voltage-in_voltage_scale + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale + 0.000196690 + + +Show channel in_voltage1 measurement +------------------------------------ + +**Description:** Raw unscaled voltage measurement on channel in_voltage1 + +================= =================================== +ADC Input Pair Channel name +================= =================================== +AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw +AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw +AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw +AIN1 - AINCOM in_voltage1_raw +AIN2 - AINCOM in_voltage2_raw +AIN3 - AINCOM in_voltage3_raw +AIN4 - AINCOM in_voltage4_raw +================= =================================== + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in1_raw + -1 + + +**U** = *in_voltage1_raw \* in_voltage_scale* = 3983772\* 0.000393390 = **1567.17606708 mV** + +Show channel in_voltage1-in_voltage2 measurement +------------------------------------------------ + +**Description:** Raw unscaled voltage measurement on channel in_voltage1-in_voltage2 + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage1-in_voltage2_raw + -1 + + +**U** = *in_voltage1-in_voltage3_raw \* in_voltage-in_voltage_scale* = -1 \* 0.000393390 = **-0.000393390 mV** + +Show internal temperature +------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/in_temp0_raw Shows raw unscaled temperature. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_temp0_raw + -175 + + +Bride power-down switch control +------------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/bridge_switch_en Writing 1 closes the bridge switch. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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> cat bridge_switch_en + 1 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > bridge_switch_en + + +AC excitation control (AD7195 only) +----------------------------------- + +**Description:** /sys/bus/iio/devices/iio:deviceX/ac_excitation_en Writing 1 enables AC excitation on the AD7195 ACX strobes. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + 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> cat ac_excitation_en + 1 + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > ac_excitation_en + + +Trigger management +------------------ + +.. hint:: + + This driver only supports it's own default trigger source ad7192-dev0 + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat trigger/current_trigger + ad7192-dev0 + + +Buffer management +----------------- + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/iio:buffer> ls + enable length + + +The Industrial I/O subsystem provides support for various ring buffer based data +acquisition methods. Apart from device specific hardware buffer support, the +user can chose between two different software ring buffer implementations. One +is the IIO lock free software ring, and the other is based on Linux kfifo. +Devices with buffer support feature an additional sub-folder in the +/sys/bus/iio/devices/deviceX/ folder hierarchy. Called deviceX:bufferY, where Y +defaults to 0, for devices with a single buffer. + +Every buffer implementation features a set of files: + +| **length** +| Get/set the number of sample sets that may be held by the buffer. + +| **enable** +| Enables/disables the buffer. This file should be written last, after length and selection of scan elements. + +| **watermark** +| A single positive integer specifying the maximum number of scan elements to wait for. Poll will block until the watermark is reached. Blocking read will wait until the minimum between the requested read amount or the low water mark is available. Non-blocking read will retrieve the available samples from the buffer even if there are less samples then watermark level. This allows the application to block on poll with a timeout and read the available samples after the timeout expires and thus have a maximum delay guarantee. + +| **data_available** +| A read-only value indicating the bytes of data available in the buffer. In the case of an output buffer, this indicates the amount of empty space available to write data to. In the case of an input buffer, this indicates the amount of data available for reading. + +| **length_align_bytes** +| Using the high-speed interface. DMA buffers may have an alignment requirement for the buffer length. Newer versions of the kernel will report the alignment requirements associated with a device through the \`length_align_bytes\` property. + +| **scan_elements** +| The scan_elements directory contains interfaces for elements that will be captured for a single triggered sample set in the buffer. + +.. container:: box bggreen + + This specifies any shell prompt running on the target + + + :: + + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> ls + in_voltage1-in_voltage2_en in_voltage2_en in_voltage4_en + in_voltage1-in_voltage2_index in_voltage2_index in_voltage4_index + in_voltage1-in_voltage2_type in_voltage2_type in_voltage4_type + in_voltage1_en in_voltage3-in_voltage4_en in_temp0_en + in_voltage1_index in_voltage3-in_voltage4_index in_temp0_index + in_voltage1_type in_voltage3-in_voltage4_type in_temp0_type + in_voltage2-in_voltage2_shorted_en in_voltage3_en timestamp_en + in_voltage2-in_voltage2_shorted_index in_voltage3_index timestamp_index + in_voltage2-in_voltage2_shorted_type in_voltage3_type timestamp_type + root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> + + +| **in_voltageX_en / in_voltageX-voltageY_en / timestamp_en:** +| Scan element control for triggered data capture. Writing 1 will enable the scan element, writing 0 will disable it + +| **in_voltageX_type / in_voltageX-voltageY_type / timestamp_type:** +| Description of the scan element data storage within the buffer and therefore in the form in which it is read from user-space. Form is [s|u]bits/storage-bits. s or u specifies if signed (2's complement) or unsigned. bits is the number of bits of data and storage-bits is the space (after padding) that it occupies in the buffer. Note that some devices will have additional information in the unused bits so to get a clean value, the bits value must be used to mask the buffer output value appropriately. The storage-bits value also specifies the data alignment. So u12/16 will be a unsigned 12 bit integer stored in a 16 bit location aligned to a 16 bit boundary. For other storage combinations this attribute will be extended appropriately. + +| **in_voltageX_index / in_voltageX-voltageY_index / timestamp_index:** +| A single positive integer specifying the position of this scan element in the buffer. Note these are not dependent on what is enabled and may not be contiguous. Thus for user-space to establish the full layout these must be used in conjunction with all \_en attributes to establish which channels are present, and the relevant \_type attributes to establish the data storage format. + +More Information +================ + +- IIO mailing list: linux-iio@vger.kernel.org +- `IIO Linux Kernel Documentation sysfs-bus-iio-\* `_ +- `IIO Documentation `_ +- :doc:`IIO test and visualization application ` +- :doc:`libiio - IIO system library ` +- :doc:`libiio - Internals ` +- :doc:`Pointers and good books ` +- `IIO High Speed `_ +- `Software Defined Radio using the IIO framework `_ +- + +|libiio introduction| + +*Need Help?* + +- :ez:`Analog Devices Linux Device Drivers Help Forum ` +- `Ask a Question `_ + +.. |libiio introduction| image:: https://wiki.analog.com/_media/software/linux/docs/iio/youtube>p_vntewue24 diff --git a/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst b/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst new file mode 100644 index 00000000000..20a5e5069c2 --- /dev/null +++ b/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst @@ -0,0 +1,245 @@ +AD719x IIO Application +====================== + +Introduction +============ + +This page gives an overview of using the ARM platforms supported (default is +Mbed) firmware example with Analog Devices AD719x Evaluation board and SDP-K1 +controller board. This example code leverages the ADI developed IIO (Industrial +Input Output) ecosystem to evaluate the AD719x device by providing a device +debug and data capture support. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_introduction#introduction&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/iio_support_introduction#Introduction&showfooter=nofooter + +-------------- + +Useful links +------------ + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/useful_links#useful_link&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/useful_links#Useful Link&showfooter=nofooter + +- :git-no-OS:`AD719x No-OS drivers ` +- :adi:`AD7190 Product Page ` +- :adi:`AD7192 Product Page ` +- :adi:`AD7193 Product Page ` +- :adi:`AD7195 Product Page ` + +-------------- + +Hardware Connections +~~~~~~~~~~~~~~~~~~~~ + +Jumper Settings: SDP-K1: Connect the VIO_ADJUST jumper on the SDP-K1 board to +3.3V position to drive SDP-K1 GPIOs at 3.3V + +EVAL-AD719X: + +- Stack the EVAL-AD719X-ASDZ on the Arduino connectors of the SDP-K1 board. +- Connect a male-to-male jumper wire between D8 and D12 on Arduino connectors. +- Set the LK7 and LK8 jumper headers to 3.3V. +- Set LK12 jumper header to position + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_hardware_connection.png + :width: 800 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/hardware_connections_uart#uart_connections&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/hardware_connections_uart#UART Connections&showfooter=nofooter + +-------------- + +Software Downloads +================== + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_software_downloads#software_downloads&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/iio_support_software_downloads#Software Downloads&showfooter=nofooter + +-------------- + +Evaluating AD719x Using IIO Ecosystem +------------------------------------- + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/note_hardware_connections#note_in_hardware_connections&showfooter=nofooter + :alt: section>resources/tools-software/product-support-software/note_hardware_connections#Note in Hardware Connections&showfooter=nofooter + +Running IIO Oscilloscope (Client) +--------------------------------- + +Open the IIO Oscilloscope application from start menu and configure the serial +(UART) settings as shown below. Click on refresh button and AD719X device should +pop-up in IIO devices list. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_new.png + :width: 800 + +Click 'Connect' and it should by default open the data ‘Capture’ window. You can +drag aside or close this window to see the main ‘Debug and DMM’ tab window. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_windows.jpg + :width: 800 + +Configure/Access Device Attributes (Parameters) +----------------------------------------------- + +The IIO Oscilloscope allows user to access and configure different device +parameters, called as 'Device Attributes“. There are 2 types of attributes: + +- Device Attributes (Global): Access/Configure common device parameters. +- Channel Attributes (Specific to channels): Access/Configure channel specific + device parameters. + +How to read and write attribute: + +- To 'Read' an attribute, simply select the attribute from a list or press 'Read' button on left side. +- To 'Write' an attribute, select attribute value in the 'value field' and + press 'Write' button. + +Using DMM Tab to Read DC Voltage on Input Channels +-------------------------------------------------- + +DMM tab can be used read the instantaneous voltage applied on analog input +channels. Simply select the device and channels to read and press start button. + +*\*Note: The voltage is just instantaneous, so it is not possible to get RMS AC voltage or averaged DC voltage. Also, when using DMM tab, do not access/use the Data Capture or Debug tab as this could impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_dmm.png + :width: 600 + +Data Capture from IIO Device +---------------------------- + +To capture the data from AD719x IIO device, simply select the device and +channels to read/capture data. The data is plotted as “ADC Raw Value” Vs “Number +of Samples” and is just used for Visualization. The data is read as is from +device without any processing. If user wants to process the data, it must be +done externally by capturing data from the Serial link on controller board. + +*\*Note: The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* + +More info here: :doc:`Data Capture using IIO App ` + +Time Domain Plot +---------------- + +*\*Note: When enabling more than 4 channels, the number of samples should be decreased to 200 to avoid timeout in the IIO oscilloscope.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_plot.png + +Frequency Domain Plot +--------------------- + +*\*Note: Max 4096 samples can be selected for plotting frequency domain response due to limited buffer size in the firmware.* + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_fft.png + +-------------- + +Python Environment and Scripts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Data capture, device calibration, etc. can be achieved with python based IIO +clients, using 'pyadi-iio' library. A possible option using ADI's pyadi-iio +library in python has been demonstrated in the forthcoming sections. The python +scripts are provided along with firmware package. + +Setting-up Python Environment + +- Please install python into your local machine. The python scripts are developed and executed using python 3.8.0 version, so recommend using version 3.8.0 or beyond. Download python +- Once python is installed, make sure the environment path (on windows machine) is set properly. You can verify if python is installed properly by typing “python --version” command on command line tool such as gitbash, command prompt, power shell, etc. +- Install the “pyadi-iio” python package by executing command “python -m pip + install pyadi-iio”. Detailed guide on installing it is available in Python + Interfaces for ADI Hardware + +- Make sure to install additional support packages by running requirements.txt + file using command “python -m pip install -r requirements.txt” from “scripts/” + directory.” + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_requirement.png + +Modifying/running Python Scripts +-------------------------------- + +- All python scripts specific to ad719x IIO firmware are stored into “scripts” folder present in the project directory. +- Ensure that the firmware is compiled with the noise testing mode, using the + macros in the app_config.h file. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_config.png + +- Update the ‘uri’ interface in script according to COM port assigned to your device (sdp-k1). Default COM port is set to COM16 in all scripts. +- Update the ‘device_name’ variable to match with the device name in the + compiled firmware. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_com.png + +- Enable the channel and size of the sample block for noise analysis. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_samples.png + +Output Obtained from the Python Script While executing the +ad719x_rms_50hz_test.py, the command prompt requests for the number of samples +to be entered by the user. This should be multiple of defined sample block size. +On successful completion of capturing n samples, the noise data is displayed on +the windows and the data points are stored in a csv as adc_data_capture.csv in +the folder where the script is present. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_output.png + :alt: + +|image1| + +-------------- + +AD719x Firmware Structure +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_firmware_structure.png + +app_config.h +------------ + +This file can be used to: + +- Select the active platform using macro “ACTIVE_PLATFORM_MBED” (Only Mbed is supported) +- Select UART baud rate (for physical UART port) using “IIO_UART_BAUD_RATE” macro. Default is 230400. +- Select burst capture mode or continuous capture mode using “DATA_CAPTURE_MODE” macro. +- Select the active device by defining as “DEV_AD7193”. Default is AD7193 +- Uncomment the “BIPOLAR_MODE” macro to enable bipolar mode. Default is Unipolar mode. +- Uncomment the “DIFFERENTIAL_INPUT” macro to enable differential input. + Default is Pseudo differential input. + +ad719x_user_config.c/.h +----------------------- + +These files define the user configurations for the AD719X, such as SPI +parameters (frequency, mode, etc) and other init parameters used by No-OS +drivers to initialize AD719X device (gain, data output rate, reference voltage +etc). + +ad719x_data_capture.c +--------------------- + +This file implements the data capturing logic for the AD719x device. The data +capturing can be done using normal burst mode or continuous mode. + +ad719x_iio.c +------------ + +This file defines getter/setter functions for all the device and channel +specific attributes (related to AD719X devices) to read/write the device +parameters. The majority of device specific functionality is present in this +module. + +No-OS Drivers for AD719x +------------------------ + +The no-OS drivers provide the high level abstracted layer for digital interface +of AD719x devices. The complete digital interface (to access memory map and +perform data read) is done in integration with platform drivers. The +functionality related with no-os drivers is covered in below 2 files: + +- ad719x.c +- ad719x.h + +.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_2.png diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst new file mode 100644 index 00000000000..60641466653 --- /dev/null +++ b/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst @@ -0,0 +1,296 @@ +Supported devices +================= + +- :adi:`AD7190` +- :adi:`AD7192` +- :adi:`AD7193` +- :adi:`AD7194` +- :adi:`AD7195` + +Evaluation Boards +================= + +- :adi:`EVAL-AD7190` +- :adi:`EVAL-AD7192` +- :adi:`EVAL-AD7193` +- :adi:`EVAL-AD7194` +- :adi:`EVAL-AD7195` + +Overview +======== + +The AD719X family is composed of a low noise, complete analog front end for high +precision measurement applications. It contains a low noise, 24-bit sigma-delta +(Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means +that signals of small amplitude can interface directly to the ADC. + +The on-chip channel sequencer allows several channels to be enabled +simultaneously, and the AD719X sequentially converts on each enabled channel, +simplifying communication with the part. The on-chip 4.92 MHz clock can be used +as the clock source to the ADC or, alternatively, an external clock or crystal +can be used. The output data rate from the part can be varied from 4.7 Hz to 4.8 +kHz. + +The device has a very flexible digital filter, including a fast settling option. +Variables such as output data rate and settling time are dependent on the option +selected. The AD7193 also includes a zero latency option. + +:adi:`AD7190` operates with 5 V analog power supply and a digital power supply from 2.7 V to 5.25 V. It consumes a current of 6 mA. It is housed in a 24-lead TSSOP package. + +:adi:`AD7192` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.35 mA. It is housed in a 24-lead TSSOP package. + +:adi:`AD7193` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.65 mA, and it is available in a 28-lead TSSOP package and a 32-lead LFCSP package. + +:adi:`AD7194` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.65 mA, and it is housed in a 32-lead LFCSP package. + +:adi:`AD7195` operates with a 5 V analog power supply and a digital power supply from 2.7 V to 5.25 V. It consumes a current of 6 mA. It is housed in a 32-lead LFCSP package. + +Applications +------------ + +- Weigh scales +- Strain gage transducers +- Pressure measurement +- Pressure measurement +- Temperature measurement +- Chromatography +- PLC/DCS analog input modules +- Data acquisition +- Medical and scientific instrumentation + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/ad7192-fbl.png + :align: center + :width: 400 + +ADI No-OS +========= + +The goal of ADI Microcontroller No-OS is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. ADI No-OS offers **generic drivers** which can be used as a base for any microcontroller platform and also **example projects** which are using these drivers on various microcontroller platforms. + +For more information about ADI No-OS and supported microcontroller platforms see: :doc:`no-OS ` + +Driver Description +================== + +The source code for AD719X driver can be found here: + +.. admonition:: Download + :class: download + + + - :git-no-OS:`Header file of AD719X Driver ` + - :git-no-OS:`Implementation of AD719X Driver ` + + +The driver also uses the ADI util library, so make sure you also add the +necessary files in your project. The source code for the util library can be +found here: + +.. admonition:: Download + :class: download + + + - :git-no-OS:`Header file of ADI util library ` + - :git-no-OS:`Implementation file of ADI util library ` + + +The driver contains three parts: + +- The driver for the AD719X part, which may be used, without modifications, with any microcontroller. +- The Communication Driver, where the specific communication functions for the desired type of processor and communication protocol have to be implemented. This driver implements the communication with the device and hides the actual details of the communication protocol to the ADI driver. +- The GPIO Driver, where the specific GPIO functions for the desired type of + processor have to be implemented. This driver lets the device know when the + conversions are ready, hiding the actual details of the GPIO ADI driver. + +The Communication and GPIO drivers have a standard interface, so the AD719X +driver can be used exactly as it is provided. + +For SPI Communication there are three functions which are called by the AD719X +driver: + +- no_os_spi_init() – Initializes the communication peripheral. +- no_os_spi_write_and_read() - Reads and writes data from/to device. +- no_os_spi_remove() - Removes SPI device. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/no_os_spi_architecture.png + :align: center + :width: 500 + +.. container:: centeralign + + SPI driver architecture + +For GPIO control there are seven functions which are called by the AD719X +driver: + +- no_os_gpio_get() – Initializes GPIO peripheral. +- no_os_gpio_get_optional() - Initializes optional GPIO peripheral. +- no_os_gpio_direction_input() - Sets GPIO as input. +- no_os_gpio_direction_output - Sets GPIO as output +- no_os_gpio_get_value - Gets value of GPIO. +- no_os_gpio_set_value - Sets value of GPIO. +- no_os_gpio_remove - Removes GPIO peripheral. + +For SPI and GPIO usage there are four data types that have to be defined: + +- no_os_spi_desc - structure holding the SPI descriptor +- no_os_spi_init_param - structure holding the parameters for SPI initialization +- no_os_gpio_desc - structure holding the GPIO descriptor +- no_os_gpio_init_param - structure holding the parameters for GPIO + initialization + +AD719X Driver Code Documentation +-------------------------------- + +Source code documentation for the driver is automatically generated using the +Doxygen tool and it is available below: + +- `AD719X Header file `_ +- `AD719X Source file `_ + +AD719X Device Configuration +--------------------------- + +Driver Initialization +--------------------- + +In order to be able to use the device, you will have to provide the initial parameters for the communication protocol as for the device - spi initial parameters, gpio MISO initial parameters, gpio SYNC initial parameters, polarity, gain, operating mode, data rate code, clock source, input mode, buffer option, bpdsw mode and chip id. The first API to be called is **ad719x_init**. Make sure that it returns 0, which means that the device was initialized correctly. **ad719x_init** also performs a soft reset, by calling **ad719x_reset**, in order to put the device in a known state. + +Range Configuration +------------------- + +By calling **ad719x_range_setup**, driver sets polarity and gain of the device. Accepted values for gain: + +- AD719X_ADC_GAIN_1 +- AD719X_ADC_GAIN_8 +- AD719X_ADC_GAIN_16 +- AD719X_ADC_GAIN_32 +- AD719X_ADC_GAIN_64 +- AD719X_ADC_GAIN_128 + +Filter Output Data Rate Configuration +------------------------------------- + +By calling **ad719x_output_rate_select**, driver sets the filter output data rate. Accepted values are between 1 and 1023. The output data rate can be programmed from 4.7 Hz to 4800 Hz. + +Buffer Configuration +-------------------- + +By calling **ad719x_buffer_select**, driver sets the inputs as buffered or unbuffered. + +Clock Configuration +------------------- + +By calling **ad719x_clock_select**, driver sets the clock source for the ADC. Accepted values: + +- AD719X_EXT_CRYSTAL_MCLK1_MCLK2 - External crystal. The external crystal is connected from MCLK1 to MCLK2. +- AD719X_EXT_CRYSTAL_MCLK2 - External Clock applied to MCLK2. +- AD719X_INT_CLK_4_92_MHZ_TRIST - Internal 4.92 MHz clock. Pin MCLK2 is tristated. +- AD719X_INT_CLK_4_92_MHZ - Internal 4.92 MHz clock. The internal clock is + available on MCLK2. + +Bridge Switch Configuration +--------------------------- + +By calling **ad719x_set_bridge_switch**, driver opens or closes the bridge power-down switch of the ADC. + +Operating Mode Configuration +---------------------------- + +By calling **ad719x_set_operating_mode**, driver sets ADC to the desired operation mode. + +**All the above configurations are done by ad719x_init, so no further configuration is needed.** + +Channel Calibration +------------------- + +Channel calibration can be done calling **ad719x_calibrate** and providing desired channel and calibration type. + +AD719X Device Measurements +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Operation Mode Setting +---------------------- + +After the specific configuration was performed as mentioned above, you can set the device in the desired measurement mode, using **ad719x_set_operating_mode** API. The available operation modes are: + +- AD719X_MODE_CONT - Continuous Conversion Mode +- AD719X_MODE_SINGLE - Single Conversion Mode +- AD719X_MODE_IDLE - Idle Mode +- AD719X_MODE_PWRDN - Power-Down Mode +- AD719X_MODE_CAL_INT_ZERO - Internal Zero-Scale Calibration +- AD719X_MODE_CAL_INT_FULL - Internal Full-Scale Calibration +- AD719X_MODE_CAL_SYS_ZERO - System Zero-Scale Calibration +- AD719X_MODE_CAL_SYS_FULL - System Full-Scale Calibration + +Temperature Data +---------------- + +Temperature can be read using device's internal sensor. **ad719x_temperature_read** API will read and convert raw value into Celsius degrees. + +Single Conversion Data +---------------------- + +By using **ad719x_single_conversion** API, a single read of the enabled channels will occur. + +Continuous Conversion Data +-------------------------- + +By using **ad719x_continuous_read_avg** API, the device will read the specified number of samples and will store their average value. + +**For Single Conversion and Continuous Conversion Data, user can use ad719x_convert_to_volts API to transform raw value into Volts.** + +AD719X Driver Initialization Example on Xilinx Platform +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:: + + struct xil_spi_init_param spi_extra = { + .type = SPI_PS, + .flags = 0U + }; + struct spi_init_param spi_ip = { + .device_id = SPI_DEVICE_ID, + .max_speed_hz = 1000, + .mode = SPI_MODE_3, + .chip_select = 0U, + .bit_order = SPI_BIT_ORDER_MSB_FIRST, + .platform_ops = &xil_spi_ops, + .extra = &spi_extra + }; + + const struct xil_gpio_init_param gpio_extra = { + .type = GPIO_PS, + .device_id = GPIO_DEVICE_ID + }; + const struct gpio_init_param miso_ip = { + .number = RDY_PIN, + .platform_ops = &xil_gpio_ops, + .extra = &gpio_extra + }; + const struct gpio_init_param sync_ip = { + .number = SYNC_PIN, + .platform_ops = &xil_gpio_ops, + .extra = &gpio_extra + }; + + /* Device AD719X instance. */ + struct ad719x_dev *dev; + struct ad719x_init_param ad7190_dev_ip = { + .spi_init = &spi_ip, + .gpio_miso = &miso_ip, + .sync_pin = NULL, + .current_polarity = 1, + .current_gain = AD719X_ADC_GAIN_64, + .operating_mode = AD719X_MODE_SINGLE, + .data_rate_code = 480U, + .clock_source = AD719X_INT_CLK_4_92_MHZ, + .input_mode = 0, + .buffer = 0, + .bpdsw_mode = 0, + .chip_id = AD7190 + }; + + ret = ad719x_init(&dev, ad7190_dev_ip); + if(ret) + return FAILURE; diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst new file mode 100644 index 00000000000..653fe9aa49b --- /dev/null +++ b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst @@ -0,0 +1,224 @@ +AD7190 - Microcontroller No-OS Driver +===================================== + +Supported Devices +----------------- + +- :adi:`AD7190` +- :adi:`AD7192` +- :adi:`AD7195` + +Evaluation Boards +----------------- + +- :adi:`EVAL-AD7190EBZ` +- :adi:`EVAL-AD7192EBZ` +- :adi:`EVAL-AD7195EBZ` + +Overview +-------- + +The :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` are low noise, complete analog front ends for high precision measurement applications. Devices contain a low noise, 24-bit sigma-delta (Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means that signals of small amplitude can be interfaced directly to the ADC. The :adi:`AD7195` contains ac excitation, which is used to remove dc-induced offsets from bridge sensors. + +Devices can be configured to have two differential inputs or four pseudo differential inputs. The on-chip channel sequencer allows several channels to be enabled, and the :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` sequentially convert on each enabled channel. This simplifies communication with the parts. The on-chip 4.92 MHz clock can be used as the clock source to the ADC or, alternatively, an external clock or crystal can be used. The output data rate from the parts can be varied from 4.7 Hz to 4.8 kHz. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz.jpg + :align: center + +The goal of this project (Microcontroller No-OS) is to be able to provide +reference projects for lower end processors, which can't run Linux, or aren't +running a specific operating system, to help those customers using +microcontrollers with ADI parts. Here you can find a generic driver which can be +used as a base for any microcontroller platform and also specific drivers for +Renesas platforms. + +Driver Description +------------------ + +The driver contains two parts: + +- The driver for the AD7190 part, which may be used, without modifications, with any microcontroller. +- The Communication Driver, where the specific communication functions for the + desired type of processor and communication protocol have to be implemented. + This driver implements the communication with the device and hides the actual + details of the communication protocol to the ADI driver. + +The Communication Driver has a standard interface, so the AD7190 driver can be +used exactly as it is provided. + +There are three functions which are called by the AD7190 driver: + +- SPI_Init() – initializes the communication peripheral. +- SPI_Write() – writes data to the device. +- SPI_Read() – reads data from the device. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/spi_architecture.png + :align: center + +.. container:: centeralign + + SPI driver architecture + +The following functions are implemented in this version of AD7190 driver: + ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| Function | Description | ++=============================================================================================================================================+==========================================================================+ +| void AD7190_SetRegisterValue(unsigned char registerAddress, unsigned long registerValue, unsigned char bytesNumber, unsigned char modifyCS) | Writes data into a register. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_GetRegisterValue(unsigned char registerAddress, unsigned char bytesNumber, unsigned char modifyCS) | Reads the value of a register. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned char AD7190_Init(void) | Initializes the SPI peripheral and checks if the AD7190 part is present. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_Reset(void) | Resets the device. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_SetPower(unsigned char pwrMode) | Set device to idle or power-down. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_WaitRdyGoLow(void) | Waits for RDY pin to go low. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_ChannelSelect(unsigned short channel) | Selects the channel to be enabled. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_Calibrate(unsigned char mode, unsigned char channel) | Performs the given calibration to the specified channel. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| void AD7190_RangeSetup(unsigned char polarity, unsigned char range) | Selects the polarity of the conversion and the ADC input range. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_SingleConversion(void) | Returns the result of a single conversion. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_ContinuousReadAvg(unsigned char sampleNumber) | Returns the average of several conversion results. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ +| unsigned long AD7190_TemperatureRead(void) | Read data from temperature sensor and converts it to Celsius degrees. | ++---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ + +**HW Platform(s):** + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `Renesas Demo Kit for RX62N (Renesas) `_ + +Downloads +--------- + +.. admonition:: Download + :class: download + + + - `AD7190 Generic Driver `_ + - `AD7190 RL78G13 Driver `_ + - `AD7190 RX62N Driver `_ + + +Renesas RL78G13 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7190 +demonstration project on a Renesas RL78G13 platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- :adi:`EVAL-AD7190EBZ (Analog Devices) ` + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ + +Hardware Setup +-------------- + +An EVAL-AD7190EBZ has to be interfaced with the Renesas Demonstration Kit (RDK) +for RL78G13: + +:: + + EVAL-AD7190EBZ J2 connector Pin CS → YRDKRL78G13 J11 connector Pin 1 + EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRL78G13 J11 connector Pin 2 + EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRL78G13 J11 connector Pin 3 + EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRL78G13 J11 connector Pin 4 + EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRL78G13 J11 connector Pin 5 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7190 part is present; +- configures the AD7190 part; +- reads data from single conversion; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rl78g13_software_tutorial_without_applilet3 `_ + +Renesas RX62N Quick Start Guide +=============================== + +This section contains a description of the steps required to run the AD7190 +demonstration project on a Renesas RX62N platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RX62N (Renesas) `_ +- :adi:`EVAL-AD7190EBZ (ADI) ` + +Required Software +----------------- + +- `High-performance Embedded Workshop for RX62N family `_ + +Hardware Setup +-------------- + +An EVAL-AD7190EBZ board has to be interfaced with the Renesas Demonstration Kit +(RDK) for RX62N: + +:: + + EVAL-AD7190EBZ J2 connector Pin CS → YRDKRX62N J8 connector Pin 15 + EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRX62N J8 connector Pin 19 + EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRX62N J8 connector Pin 22 + EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRX62N J8 connector Pin 20 + EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRX62N J8 connector Pin 4 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7190 part is present; +- configures the AD7190 part; +- reads data from single conversion; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rx62n_software_design `_ + +More information +================ + +.. note:: + + See `more-information `_ diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst new file mode 100644 index 00000000000..69402395912 --- /dev/null +++ b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst @@ -0,0 +1,208 @@ +AD7193 - No-OS Driver for Renesas Microcontroller Platforms +=========================================================== + +.. include:: ../ad7193.rst + +**HW Platform(s):** + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `Renesas Demo Kit for RX62N (Renesas) `_ + +Downloads +--------- + +.. admonition:: Download + :class: download + + + - `AD7193 Generic Driver `_ + - `AD7193 RL78G13 Driver `_ + - `AD7193 RX62N Driver `_ + - **AD7193 Driver:** :git-no-OS:`drivers/adc/ad7193` + - **PmodAD5 Demo for RL78G14:** :git-no-OS:`Renesas/RL78G14/PmodAD5` + - **RL78G14 Common Drivers:** :git-no-OS:`Renesas/RL78G14/Common` + + +Renesas RL78G13 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RL78G13 platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G13 (Renesas) `_ +- `PmodAD5 `_ + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ + +Hardware Setup +-------------- + +A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image +below). + +|image1| + +.. important:: + + + - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range + for AVDD is 3.0V ≤ AVDD ≤ 5.25V + + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part for differential input on CH0(AIN1-AIN2); +- first reads data from a single conversion and displays it; +- then reads data from multiple conversions, calculates the average value and displays it; +- in the end reads data from the temperature sensor and displays it in degrees + Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13_screen.jpg + :align: center + :width: 200 + +Software Project Setup +---------------------- + +.. note:: + + See `rl78g13_software_tutorial_without_applilet3 `_ + +Renesas RL78G14 Quick Start Guide +================================= + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RL78G14 platform using the PmodAD5. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RL78G14 (Renesas) `_ +- PmodAD5 + +Required Software +----------------- + +- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ +- The AD7193 demonstration project for the Renesas RL78G14 platform. + +.. note:: + + The AD7193 demonstration project for the Renesas RL78G14 platform consists of + three parts: the AD7193 Driver, the PmodAD5 Demo for RL78G14 and the RL78G14 + Common Drivers. + + + All three parts have to be downloaded. + +Hardware Setup +-------------- + +A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image +below). + +|image2| + +.. important:: + + + - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range + for AVDD is 3.0V ≤ AVDD ≤ 5.25V + + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part for differential input on CH0(AIN1-AIN2); +- first reads data from a single conversion and displays it; +- then reads data from multiple conversions, calculates the average value and displays it; +- in the end reads data from the temperature sensor and displays it in degrees + Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14_screen.jpg + :align: center + +Software Project Tutorial +------------------------- + +.. note:: + + See `rl78g14_software_tutorial `_ + +Renesas RX62N Quick Start Guide +=============================== + +This section contains a description of the steps required to run the AD7193 +demonstration project on a Renesas RX62N platform. + +Required Hardware +----------------- + +- `Renesas Demo Kit for RX62N (Renesas) `_ +- PmodAD5 + +Required Software +----------------- + +- `High-performance Embedded Workshop for RX62N family `_ +- `Renesas Peripheral Driver Library for RX62N family `_ + +Hardware Setup +-------------- + +A PmodAD5 has to be interfaced with the Renesas Demonstration Kit (RDK) for +RX62N: + +:: + + PmodAD5 Pin 1 (CS) → YRDKRX62N J8 connector Pin 15 + PmodAD5 Pin 2 (MOSI) → YRDKRX62N J8 connector Pin 19 + PmodAD5 Pin 3 (MISO) → YRDKRX62N J8 connector Pin 22 + PmodAD5 Pin 4 (CLK) → YRDKRX62N J8 connector Pin 20 + PmodAD5 Pin 5 (GND) → YRDKRX62N J8 connector Pin 4 + PmodAD5 Pin 6 (VCC) → YRDKRX62N J8 connector Pin 3 + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n.jpg + :align: center + +Reference Project Overview +-------------------------- + +The reference project: + +- checks if the AD7193 part is present; +- configures the AD7193 part; +- reads data from multiple conversions, calculates the average value and displays it; +- reads data from the temperature sensor and displays it in degrees Celsius. + +.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n_screen.jpg + :align: center + +Software Project Setup +---------------------- + +.. note:: + + See `rx62n_software_design `_ + +More information +================ + +.. include:: ../more-information.rst + +.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13.jpg + :width: 500 +.. |image2| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14.jpg From fab795a1b7b2b4fb2cd78cb18e7d0babb8a1c308 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Thu, 2 Apr 2026 13:16:00 +0300 Subject: [PATCH 2/6] Replace stub index.rst with template Co-Authored-By: Claude Opus 4.6 --- .../reference-designs/eval-ad719x/index.rst | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/docs/solutions/reference-designs/eval-ad719x/index.rst b/docs/solutions/reference-designs/eval-ad719x/index.rst index 1ec30478a04..8a5cbb96b29 100644 --- a/docs/solutions/reference-designs/eval-ad719x/index.rst +++ b/docs/solutions/reference-designs/eval-ad719x/index.rst @@ -1,5 +1,24 @@ -AD719X -====== +.. _eval_ad719x eval: + +EVAL AD719X +=================================================================== + +.. TODO: Add a picture of the chip/board + +Overview +------------------------------------------------------------------------------- + +.. TODO: Describe in max 10 rows the main features and applications. + +Features: + +- feature 1 +- feature 2 + +Applications: + +- application 1 +- application 2 .. toctree:: :hidden: @@ -9,3 +28,22 @@ AD719X ad7193 ad7193 ad719x_mbed_iio_application + +Recommendations +------------------------------------------------------------------------------- + +People who follow the flow that is outlined, have a much better experience with +things. However, like many things, documentation is never as complete as it +should be. If you have any questions, feel free to ask on our +:ref:`EngineerZone forums `, but before that, please make +sure you read our documentation thoroughly. + +Warning +------------------------------------------------------------------------------- + +.. esd-warning:: + +Help and support +------------------------------------------------------------------------------- + +Please go to :ref:`Help and Support ` page. From 78fb52a921f13395c7fe47abc9d0213212807c84 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Tue, 7 Apr 2026 13:21:39 +0300 Subject: [PATCH 3/6] Fix build: remove leaked wiki-migration source files, fix index.rst Co-Authored-By: Claude Opus 4.6 --- .../linux-drivers/iio-adc/ad7192.rst | 653 ------------------ .../ad719x_mbed_iio_application.rst | 245 ------- .../tools-software/uc-drivers/ad7193.rst | 296 -------- .../uc-drivers/renesas/ad7190.rst | 224 ------ .../uc-drivers/renesas/ad7193.rst | 208 ------ 5 files changed, 1626 deletions(-) delete mode 100644 docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst delete mode 100644 docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst delete mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst delete mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst delete mode 100644 docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst diff --git a/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst b/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst deleted file mode 100644 index c40a70b8a11..00000000000 --- a/docs/wiki-migration/resources/tools-software/linux-drivers/iio-adc/ad7192.rst +++ /dev/null @@ -1,653 +0,0 @@ -AD7192 IIO High Precision ADC Linux Driver -========================================== - -Supported Devices ------------------ - -- :adi:`AD7190` -- :adi:`AD7192` -- :adi:`AD7193` (Upstream 4.6+) -- :adi:`AD7194` -- :adi:`AD7195` - -Reference Circuits ------------------- - -- :adi:`CN0119` -- :adi:`CN0102` -- :adi:`CN0155` -- :adi:`CN0209` -- :adi:`CN0251` -- :adi:`CN0287` -- :adi:`CN0371` - -Evaluation Boards ------------------ - -- :adi:`EVAL-AD7190EBZ` -- :adi:`EVAL-AD7192EBZ` -- :adi:`EVAL-AD7193EBZ` -- :adi:`EVAL-AD7194EBZ` -- :adi:`EVAL-AD7195EBZ` - -Description ------------ - -This is a Linux industrial I/O (:doc:`IIO `) subsystem driver, targeting multi channel serial interface ADCs. 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 :doc:`IIO ` for more information. - -Source Code -=========== - -Status ------- - -+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ -| Source | Mainlined? | -+====================================================================================================================+====================================================================================================================+ -| `git `_ | `yes `_ | -+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ - -Files ------ - -+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| Function | File | -+==========+==================================================================================================================================================+ -| driver | `drivers/staging/iio/adc/ad7192.c `_ | -+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ -| include | `drivers/staging/iio/adc/ad7192.h `_ | -+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - -Example platform device initialization -====================================== - -For compile time configuration, it’s common Linux practice to keep board- and -application-specific configuration out of the main driver file, instead putting -it into the board support file. - -For devices on custom boards, as typical of embedded and SoC-(system-on-chip) -based hardware, Linux uses platform_data to point to board-specific structures -describing devices and how they are connected to the SoC. This can include -available ports, chip variants, preferred modes, default initialization, -additional pin roles, and so on. This shrinks the board-support packages (BSPs) -and minimizes board and application specific #ifdefs in drivers. - -The reference voltage may vary between boards and models. The platform_data for -the device's "struct device" holds this information. - -.. code:: c - - /** - * struct ad7192_platform_data - platform/board specific information - * @vref_mv: the external reference voltage in millivolt - * @ext_clk_Hz: the external clock frequency in Hz, if not set - * the driver uses the internal clock (16.776 MHz) - * @clock_source_sel: [0..3] - * 0 External 4.92 MHz clock connected from MCLK1 to MCLK2 - * 1 External Clock applied to MCLK2 - * 2 Internal 4.92 MHz Clock not available at the MCLK2 pin - * 3 Internal 4.92 MHz Clock available at the MCLK2 pin - * @refin2_en: REFIN1/REFIN2 Reference Select (AD7190/2 only) - * @rej60_en: 50/60Hz notch filter enable - * @sinc3_en: SINC3 filter enable (default SINC4) - * @chop_en: CHOP mode enable - * @buf_en: buffered input mode enable - * @unipolar_en: unipolar mode enable - * @burnout_curr_en: constant current generators on AIN(+|-) enable - */ - - struct ad7192_platform_data { - u16 vref_mv; - u32 ext_clk_Hz; - u8 clock_source_sel; - bool refin2_en; - bool rej60_en; - bool sinc3_en; - bool chop_en; - bool buf_en; - bool unipolar_en; - bool burnout_curr_en; - }; - -.. code:: c - - static struct ad7192_platform_data ad7192_pdata = { - .vref_mv = 3300, - .clock_source_sel = 2, - .refin2_en = true, - .rej60_en = false, - .sinc3_en = false, - .chop_en = false, - .buf_en = false, - .unipolar_en = true, - .burnout_curr_en = false, - }; - -Unlike PCI or USB devices, SPI devices are not enumerated at the hardware level. -Instead, the software must know which devices are connected on each SPI bus -segment, and what slave selects these devices are using. For this reason, the -kernel code must instantiate SPI devices explicitly. The most common method is -to declare the SPI devices by bus number. - -This method is appropriate when the SPI bus is a system bus, as in many embedded -systems, wherein each SPI bus has a number which is known in advance. It is thus -possible to pre-declare the SPI devices that inhabit this bus. This is done with -an array of struct spi_board_info, which is registered by calling -spi_register_board_info(). - -For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`__ - -Depending on the converter IC used, you may need to set the modalias -accordingly, matching your part name. It may also required to adjust -max_speed_hz. Please consult the datasheet, for maximum spi clock supported by -the device in question. - -.. code:: c - - static struct spi_board_info board_spi_board_info[] __initdata = { - #if defined(CONFIG_AD7192) \ - || defined(CONFIG_AD7192_MODULE) - { - .modalias = "ad7192", - .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ - .bus_num = 0, - .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* CS, change it for your board */ - .platform_data = &ad7192_pdata, - .mode = SPI_MODE_3, - .irq = IRQ_PF6, - }, - #endif - }; - -.. code:: c - - static int __init board_init(void) - { - [--snip--] - - spi_register_board_info(board_spi_board_info, ARRAY_SIZE(board_spi_board_info)); - - [--snip--] - - return 0; - } - arch_initcall(board_init); - -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: - -:: - - /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; - }; - }; - }; - -.. 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. - -Adding Linux driver support -=========================== - -Configure kernel with "make menuconfig" (alternatively use "make xconfig" or -"make qconfig") - -.. hint:: - - The AD7192 Driver depends on CONFIG_SPI - -:: - - Linux Kernel Configuration - Device Drivers ---> - [*] Staging drivers ---> - <*> Industrial I/O support ---> - --- Industrial I/O support - - *- Enable ring buffer support within IIO - - *- Industrial I/O lock free software ring - - *- Enable triggered sampling support - - Analog to digital converters - [--snip--] - - <*> Analog Devices AD7190 AD7192 AD7195 ADC driver - - [--snip--] - -Hardware configuration -====================== - -.. image:: https://wiki.analog.com/_media/resources/tools-software/linux-drivers/iio-adc/ad7192_eval_lr.jpg - :width: 600 - -Driver testing -============== - -Each and every IIO device, typically a hardware chip, has a device folder under -/sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under -every of these directory folders reside a set of files, depending on the -characteristics and features of the hardware device in question. These files are -consistently generalized and documented in the IIO ABI documentation. In order -to determine which IIO deviceX corresponds to which hardware device, the user -can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the -sequence in which the iio device drivers are loaded/registered is constant, the -numbering is constant and may be known in advance. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/> cd /sys/bus/iio/devices/ - root:/sys/bus/iio/devices> ls - iio:device0 trigger0 - - root:/sys/bus/iio/devices> cd iio:device0 - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> ls -l - -rw-r--r-- 1 root root 4096 Jan 4 16:59 bridge_switch_en - drwxr-xr-x 4 root root 0 Jan 4 16:59 buffer - -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage-in_voltage_scale_available - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1-in_voltage2_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage1_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2-in_voltage2_shorted_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage2_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3-in_voltage4_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage3_raw - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage4_raw - -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_voltage_scale_available - -r--r--r-- 1 root root 4096 Jan 4 16:59 name - drwxr-xr-x 2 root root 0 Jan 4 16:59 power - -rw-r--r-- 1 root root 4096 Jan 5 11:38 sampling_frequency - lrwxrwxrwx 1 root root 0 Jan 4 16:59 subsystem -> ../../../../../bus/iio - -r--r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_raw - -rw-r--r-- 1 root root 4096 Jan 4 16:59 in_temp0_scale - drwxr-xr-x 2 root root 0 Jan 4 16:59 trigger - -rw-r--r-- 1 root root 4096 Jan 4 16:59 uevent - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> - - -Show device name ----------------- - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat name - ad7192 - - -Set sampling frequency / update rate ------------------------------------- - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency - 10 - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 50 > sampling_frequency - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat sampling_frequency - 50 - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> - - -Show available scales for differential input channels ------------------------------------------------------ - -Lists all available scales for the differential input pairs: - -================= =================================== -ADC Input Pair Channel name -================= =================================== -AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw -AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw -AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw -================= =================================== - -Setting these directly influences the ADC input range, by altering the GAIN -amplifier. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - 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 - - -Show available scales for pseudo-differential input channels ------------------------------------------------------------- - -Lists all available scales for the differential input pairs: - -============== =============== -ADC Input Pair Channel name -============== =============== -AIN1 - AINCOM in_voltage1_raw -AIN2 - AINCOM in_voltage2_raw -AIN3 - AINCOM in_voltage3_raw -AIN4 - AINCOM in_voltage4_raw -============== =============== - -Setting these directly influences the ADC input range, by altering the GAIN -amplifier. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - 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 - - -Set scale for differential input channels ------------------------------------------ - -Scale to be applied to in1-in2_raw, in2-in3_raw in order to obtain the measured -voltage in millivolts. Allows the user to select one scale out of the available -scales. If the written scale differs from the current scale. The driver performs -full and zero offset calibration on all differential input channels. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale - 0.000393390 - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0.000196690 > in_voltage-in_voltage_scale - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage-in_voltage_scale - 0.000196690 - - -Show channel in_voltage1 measurement ------------------------------------- - -**Description:** Raw unscaled voltage measurement on channel in_voltage1 - -================= =================================== -ADC Input Pair Channel name -================= =================================== -AIN1(+) - AIN2(-) in_voltage1-in_voltage2_raw -AIN3(+) - AIN4(-) in_voltage3-in_voltage4_raw -AIN2(-) - AIN2(-) in_voltage2-in_voltage2_shorted_raw -AIN1 - AINCOM in_voltage1_raw -AIN2 - AINCOM in_voltage2_raw -AIN3 - AINCOM in_voltage3_raw -AIN4 - AINCOM in_voltage4_raw -================= =================================== - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in1_raw - -1 - - -**U** = *in_voltage1_raw \* in_voltage_scale* = 3983772\* 0.000393390 = **1567.17606708 mV** - -Show channel in_voltage1-in_voltage2 measurement ------------------------------------------------- - -**Description:** Raw unscaled voltage measurement on channel in_voltage1-in_voltage2 - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_voltage1-in_voltage2_raw - -1 - - -**U** = *in_voltage1-in_voltage3_raw \* in_voltage-in_voltage_scale* = -1 \* 0.000393390 = **-0.000393390 mV** - -Show internal temperature -------------------------- - -**Description:** /sys/bus/iio/devices/iio:deviceX/in_temp0_raw Shows raw unscaled temperature. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat in_temp0_raw - -175 - - -Bride power-down switch control -------------------------------- - -**Description:** /sys/bus/iio/devices/iio:deviceX/bridge_switch_en Writing 1 closes the bridge switch. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - 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> cat bridge_switch_en - 1 - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > bridge_switch_en - - -AC excitation control (AD7195 only) ------------------------------------ - -**Description:** /sys/bus/iio/devices/iio:deviceX/ac_excitation_en Writing 1 enables AC excitation on the AD7195 ACX strobes. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - 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> cat ac_excitation_en - 1 - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> echo 0 > ac_excitation_en - - -Trigger management ------------------- - -.. hint:: - - This driver only supports it's own default trigger source ad7192-dev0 - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0> cat trigger/current_trigger - ad7192-dev0 - - -Buffer management ------------------ - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/device0/iio:buffer> ls - enable length - - -The Industrial I/O subsystem provides support for various ring buffer based data -acquisition methods. Apart from device specific hardware buffer support, the -user can chose between two different software ring buffer implementations. One -is the IIO lock free software ring, and the other is based on Linux kfifo. -Devices with buffer support feature an additional sub-folder in the -/sys/bus/iio/devices/deviceX/ folder hierarchy. Called deviceX:bufferY, where Y -defaults to 0, for devices with a single buffer. - -Every buffer implementation features a set of files: - -| **length** -| Get/set the number of sample sets that may be held by the buffer. - -| **enable** -| Enables/disables the buffer. This file should be written last, after length and selection of scan elements. - -| **watermark** -| A single positive integer specifying the maximum number of scan elements to wait for. Poll will block until the watermark is reached. Blocking read will wait until the minimum between the requested read amount or the low water mark is available. Non-blocking read will retrieve the available samples from the buffer even if there are less samples then watermark level. This allows the application to block on poll with a timeout and read the available samples after the timeout expires and thus have a maximum delay guarantee. - -| **data_available** -| A read-only value indicating the bytes of data available in the buffer. In the case of an output buffer, this indicates the amount of empty space available to write data to. In the case of an input buffer, this indicates the amount of data available for reading. - -| **length_align_bytes** -| Using the high-speed interface. DMA buffers may have an alignment requirement for the buffer length. Newer versions of the kernel will report the alignment requirements associated with a device through the \`length_align_bytes\` property. - -| **scan_elements** -| The scan_elements directory contains interfaces for elements that will be captured for a single triggered sample set in the buffer. - -.. container:: box bggreen - - This specifies any shell prompt running on the target - - - :: - - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> ls - in_voltage1-in_voltage2_en in_voltage2_en in_voltage4_en - in_voltage1-in_voltage2_index in_voltage2_index in_voltage4_index - in_voltage1-in_voltage2_type in_voltage2_type in_voltage4_type - in_voltage1_en in_voltage3-in_voltage4_en in_temp0_en - in_voltage1_index in_voltage3-in_voltage4_index in_temp0_index - in_voltage1_type in_voltage3-in_voltage4_type in_temp0_type - in_voltage2-in_voltage2_shorted_en in_voltage3_en timestamp_en - in_voltage2-in_voltage2_shorted_index in_voltage3_index timestamp_index - in_voltage2-in_voltage2_shorted_type in_voltage3_type timestamp_type - root:/sys/devices/platform/bfin-spi.0/spi0.18/iio:device0/scan_elements> - - -| **in_voltageX_en / in_voltageX-voltageY_en / timestamp_en:** -| Scan element control for triggered data capture. Writing 1 will enable the scan element, writing 0 will disable it - -| **in_voltageX_type / in_voltageX-voltageY_type / timestamp_type:** -| Description of the scan element data storage within the buffer and therefore in the form in which it is read from user-space. Form is [s|u]bits/storage-bits. s or u specifies if signed (2's complement) or unsigned. bits is the number of bits of data and storage-bits is the space (after padding) that it occupies in the buffer. Note that some devices will have additional information in the unused bits so to get a clean value, the bits value must be used to mask the buffer output value appropriately. The storage-bits value also specifies the data alignment. So u12/16 will be a unsigned 12 bit integer stored in a 16 bit location aligned to a 16 bit boundary. For other storage combinations this attribute will be extended appropriately. - -| **in_voltageX_index / in_voltageX-voltageY_index / timestamp_index:** -| A single positive integer specifying the position of this scan element in the buffer. Note these are not dependent on what is enabled and may not be contiguous. Thus for user-space to establish the full layout these must be used in conjunction with all \_en attributes to establish which channels are present, and the relevant \_type attributes to establish the data storage format. - -More Information -================ - -- IIO mailing list: linux-iio@vger.kernel.org -- `IIO Linux Kernel Documentation sysfs-bus-iio-\* `_ -- `IIO Documentation `_ -- :doc:`IIO test and visualization application ` -- :doc:`libiio - IIO system library ` -- :doc:`libiio - Internals ` -- :doc:`Pointers and good books ` -- `IIO High Speed `_ -- `Software Defined Radio using the IIO framework `_ -- - -|libiio introduction| - -*Need Help?* - -- :ez:`Analog Devices Linux Device Drivers Help Forum ` -- `Ask a Question `_ - -.. |libiio introduction| image:: https://wiki.analog.com/_media/software/linux/docs/iio/youtube>p_vntewue24 diff --git a/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst b/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst deleted file mode 100644 index 20a5e5069c2..00000000000 --- a/docs/wiki-migration/resources/tools-software/product-support-software/ad719x_mbed_iio_application.rst +++ /dev/null @@ -1,245 +0,0 @@ -AD719x IIO Application -====================== - -Introduction -============ - -This page gives an overview of using the ARM platforms supported (default is -Mbed) firmware example with Analog Devices AD719x Evaluation board and SDP-K1 -controller board. This example code leverages the ADI developed IIO (Industrial -Input Output) ecosystem to evaluate the AD719x device by providing a device -debug and data capture support. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_introduction#introduction&showfooter=nofooter - :alt: section>resources/tools-software/product-support-software/iio_support_introduction#Introduction&showfooter=nofooter - --------------- - -Useful links ------------- - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/useful_links#useful_link&showfooter=nofooter - :alt: section>resources/tools-software/product-support-software/useful_links#Useful Link&showfooter=nofooter - -- :git-no-OS:`AD719x No-OS drivers ` -- :adi:`AD7190 Product Page ` -- :adi:`AD7192 Product Page ` -- :adi:`AD7193 Product Page ` -- :adi:`AD7195 Product Page ` - --------------- - -Hardware Connections -~~~~~~~~~~~~~~~~~~~~ - -Jumper Settings: SDP-K1: Connect the VIO_ADJUST jumper on the SDP-K1 board to -3.3V position to drive SDP-K1 GPIOs at 3.3V - -EVAL-AD719X: - -- Stack the EVAL-AD719X-ASDZ on the Arduino connectors of the SDP-K1 board. -- Connect a male-to-male jumper wire between D8 and D12 on Arduino connectors. -- Set the LK7 and LK8 jumper headers to 3.3V. -- Set LK12 jumper header to position - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_hardware_connection.png - :width: 800 - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/hardware_connections_uart#uart_connections&showfooter=nofooter - :alt: section>resources/tools-software/product-support-software/hardware_connections_uart#UART Connections&showfooter=nofooter - --------------- - -Software Downloads -================== - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/iio_support_software_downloads#software_downloads&showfooter=nofooter - :alt: section>resources/tools-software/product-support-software/iio_support_software_downloads#Software Downloads&showfooter=nofooter - --------------- - -Evaluating AD719x Using IIO Ecosystem -------------------------------------- - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/section>resources/tools-software/product-support-software/note_hardware_connections#note_in_hardware_connections&showfooter=nofooter - :alt: section>resources/tools-software/product-support-software/note_hardware_connections#Note in Hardware Connections&showfooter=nofooter - -Running IIO Oscilloscope (Client) ---------------------------------- - -Open the IIO Oscilloscope application from start menu and configure the serial -(UART) settings as shown below. Click on refresh button and AD719X device should -pop-up in IIO devices list. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_new.png - :width: 800 - -Click 'Connect' and it should by default open the data ‘Capture’ window. You can -drag aside or close this window to see the main ‘Debug and DMM’ tab window. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_windows.jpg - :width: 800 - -Configure/Access Device Attributes (Parameters) ------------------------------------------------ - -The IIO Oscilloscope allows user to access and configure different device -parameters, called as 'Device Attributes“. There are 2 types of attributes: - -- Device Attributes (Global): Access/Configure common device parameters. -- Channel Attributes (Specific to channels): Access/Configure channel specific - device parameters. - -How to read and write attribute: - -- To 'Read' an attribute, simply select the attribute from a list or press 'Read' button on left side. -- To 'Write' an attribute, select attribute value in the 'value field' and - press 'Write' button. - -Using DMM Tab to Read DC Voltage on Input Channels --------------------------------------------------- - -DMM tab can be used read the instantaneous voltage applied on analog input -channels. Simply select the device and channels to read and press start button. - -*\*Note: The voltage is just instantaneous, so it is not possible to get RMS AC voltage or averaged DC voltage. Also, when using DMM tab, do not access/use the Data Capture or Debug tab as this could impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_dmm.png - :width: 600 - -Data Capture from IIO Device ----------------------------- - -To capture the data from AD719x IIO device, simply select the device and -channels to read/capture data. The data is plotted as “ADC Raw Value” Vs “Number -of Samples” and is just used for Visualization. The data is read as is from -device without any processing. If user wants to process the data, it must be -done externally by capturing data from the Serial link on controller board. - -*\*Note: The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* - -More info here: :doc:`Data Capture using IIO App ` - -Time Domain Plot ----------------- - -*\*Note: When enabling more than 4 channels, the number of samples should be decreased to 200 to avoid timeout in the IIO oscilloscope.* - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_plot.png - -Frequency Domain Plot ---------------------- - -*\*Note: Max 4096 samples can be selected for plotting frequency domain response due to limited buffer size in the firmware.* - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_osc_fft.png - --------------- - -Python Environment and Scripts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Data capture, device calibration, etc. can be achieved with python based IIO -clients, using 'pyadi-iio' library. A possible option using ADI's pyadi-iio -library in python has been demonstrated in the forthcoming sections. The python -scripts are provided along with firmware package. - -Setting-up Python Environment - -- Please install python into your local machine. The python scripts are developed and executed using python 3.8.0 version, so recommend using version 3.8.0 or beyond. Download python -- Once python is installed, make sure the environment path (on windows machine) is set properly. You can verify if python is installed properly by typing “python --version” command on command line tool such as gitbash, command prompt, power shell, etc. -- Install the “pyadi-iio” python package by executing command “python -m pip - install pyadi-iio”. Detailed guide on installing it is available in Python - Interfaces for ADI Hardware - -- Make sure to install additional support packages by running requirements.txt - file using command “python -m pip install -r requirements.txt” from “scripts/” - directory.” - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_requirement.png - -Modifying/running Python Scripts --------------------------------- - -- All python scripts specific to ad719x IIO firmware are stored into “scripts” folder present in the project directory. -- Ensure that the firmware is compiled with the noise testing mode, using the - macros in the app_config.h file. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_config.png - -- Update the ‘uri’ interface in script according to COM port assigned to your device (sdp-k1). Default COM port is set to COM16 in all scripts. -- Update the ‘device_name’ variable to match with the device name in the - compiled firmware. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_com.png - -- Enable the channel and size of the sample block for noise analysis. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_samples.png - -Output Obtained from the Python Script While executing the -ad719x_rms_50hz_test.py, the command prompt requests for the number of samples -to be entered by the user. This should be multiple of defined sample block size. -On successful completion of capturing n samples, the noise data is displayed on -the windows and the data points are stored in a csv as adc_data_capture.csv in -the folder where the script is present. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_output.png - :alt: - -|image1| - --------------- - -AD719x Firmware Structure -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_firmware_structure.png - -app_config.h ------------- - -This file can be used to: - -- Select the active platform using macro “ACTIVE_PLATFORM_MBED” (Only Mbed is supported) -- Select UART baud rate (for physical UART port) using “IIO_UART_BAUD_RATE” macro. Default is 230400. -- Select burst capture mode or continuous capture mode using “DATA_CAPTURE_MODE” macro. -- Select the active device by defining as “DEV_AD7193”. Default is AD7193 -- Uncomment the “BIPOLAR_MODE” macro to enable bipolar mode. Default is Unipolar mode. -- Uncomment the “DIFFERENTIAL_INPUT” macro to enable differential input. - Default is Pseudo differential input. - -ad719x_user_config.c/.h ------------------------ - -These files define the user configurations for the AD719X, such as SPI -parameters (frequency, mode, etc) and other init parameters used by No-OS -drivers to initialize AD719X device (gain, data output rate, reference voltage -etc). - -ad719x_data_capture.c ---------------------- - -This file implements the data capturing logic for the AD719x device. The data -capturing can be done using normal burst mode or continuous mode. - -ad719x_iio.c ------------- - -This file defines getter/setter functions for all the device and channel -specific attributes (related to AD719X devices) to read/write the device -parameters. The majority of device specific functionality is present in this -module. - -No-OS Drivers for AD719x ------------------------- - -The no-OS drivers provide the high level abstracted layer for digital interface -of AD719x devices. The complete digital interface (to access memory map and -perform data read) is done in integration with platform drivers. The -functionality related with no-os drivers is covered in below 2 files: - -- ad719x.c -- ad719x.h - -.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/product-support-software/ad719x_iio_python_2.png diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst deleted file mode 100644 index 60641466653..00000000000 --- a/docs/wiki-migration/resources/tools-software/uc-drivers/ad7193.rst +++ /dev/null @@ -1,296 +0,0 @@ -Supported devices -================= - -- :adi:`AD7190` -- :adi:`AD7192` -- :adi:`AD7193` -- :adi:`AD7194` -- :adi:`AD7195` - -Evaluation Boards -================= - -- :adi:`EVAL-AD7190` -- :adi:`EVAL-AD7192` -- :adi:`EVAL-AD7193` -- :adi:`EVAL-AD7194` -- :adi:`EVAL-AD7195` - -Overview -======== - -The AD719X family is composed of a low noise, complete analog front end for high -precision measurement applications. It contains a low noise, 24-bit sigma-delta -(Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means -that signals of small amplitude can interface directly to the ADC. - -The on-chip channel sequencer allows several channels to be enabled -simultaneously, and the AD719X sequentially converts on each enabled channel, -simplifying communication with the part. The on-chip 4.92 MHz clock can be used -as the clock source to the ADC or, alternatively, an external clock or crystal -can be used. The output data rate from the part can be varied from 4.7 Hz to 4.8 -kHz. - -The device has a very flexible digital filter, including a fast settling option. -Variables such as output data rate and settling time are dependent on the option -selected. The AD7193 also includes a zero latency option. - -:adi:`AD7190` operates with 5 V analog power supply and a digital power supply from 2.7 V to 5.25 V. It consumes a current of 6 mA. It is housed in a 24-lead TSSOP package. - -:adi:`AD7192` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.35 mA. It is housed in a 24-lead TSSOP package. - -:adi:`AD7193` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.65 mA, and it is available in a 28-lead TSSOP package and a 32-lead LFCSP package. - -:adi:`AD7194` operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.65 mA, and it is housed in a 32-lead LFCSP package. - -:adi:`AD7195` operates with a 5 V analog power supply and a digital power supply from 2.7 V to 5.25 V. It consumes a current of 6 mA. It is housed in a 32-lead LFCSP package. - -Applications ------------- - -- Weigh scales -- Strain gage transducers -- Pressure measurement -- Pressure measurement -- Temperature measurement -- Chromatography -- PLC/DCS analog input modules -- Data acquisition -- Medical and scientific instrumentation - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/ad7192-fbl.png - :align: center - :width: 400 - -ADI No-OS -========= - -The goal of ADI Microcontroller No-OS is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. ADI No-OS offers **generic drivers** which can be used as a base for any microcontroller platform and also **example projects** which are using these drivers on various microcontroller platforms. - -For more information about ADI No-OS and supported microcontroller platforms see: :doc:`no-OS ` - -Driver Description -================== - -The source code for AD719X driver can be found here: - -.. admonition:: Download - :class: download - - - - :git-no-OS:`Header file of AD719X Driver ` - - :git-no-OS:`Implementation of AD719X Driver ` - - -The driver also uses the ADI util library, so make sure you also add the -necessary files in your project. The source code for the util library can be -found here: - -.. admonition:: Download - :class: download - - - - :git-no-OS:`Header file of ADI util library ` - - :git-no-OS:`Implementation file of ADI util library ` - - -The driver contains three parts: - -- The driver for the AD719X part, which may be used, without modifications, with any microcontroller. -- The Communication Driver, where the specific communication functions for the desired type of processor and communication protocol have to be implemented. This driver implements the communication with the device and hides the actual details of the communication protocol to the ADI driver. -- The GPIO Driver, where the specific GPIO functions for the desired type of - processor have to be implemented. This driver lets the device know when the - conversions are ready, hiding the actual details of the GPIO ADI driver. - -The Communication and GPIO drivers have a standard interface, so the AD719X -driver can be used exactly as it is provided. - -For SPI Communication there are three functions which are called by the AD719X -driver: - -- no_os_spi_init() – Initializes the communication peripheral. -- no_os_spi_write_and_read() - Reads and writes data from/to device. -- no_os_spi_remove() - Removes SPI device. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/no_os_spi_architecture.png - :align: center - :width: 500 - -.. container:: centeralign - - SPI driver architecture - -For GPIO control there are seven functions which are called by the AD719X -driver: - -- no_os_gpio_get() – Initializes GPIO peripheral. -- no_os_gpio_get_optional() - Initializes optional GPIO peripheral. -- no_os_gpio_direction_input() - Sets GPIO as input. -- no_os_gpio_direction_output - Sets GPIO as output -- no_os_gpio_get_value - Gets value of GPIO. -- no_os_gpio_set_value - Sets value of GPIO. -- no_os_gpio_remove - Removes GPIO peripheral. - -For SPI and GPIO usage there are four data types that have to be defined: - -- no_os_spi_desc - structure holding the SPI descriptor -- no_os_spi_init_param - structure holding the parameters for SPI initialization -- no_os_gpio_desc - structure holding the GPIO descriptor -- no_os_gpio_init_param - structure holding the parameters for GPIO - initialization - -AD719X Driver Code Documentation --------------------------------- - -Source code documentation for the driver is automatically generated using the -Doxygen tool and it is available below: - -- `AD719X Header file `_ -- `AD719X Source file `_ - -AD719X Device Configuration ---------------------------- - -Driver Initialization ---------------------- - -In order to be able to use the device, you will have to provide the initial parameters for the communication protocol as for the device - spi initial parameters, gpio MISO initial parameters, gpio SYNC initial parameters, polarity, gain, operating mode, data rate code, clock source, input mode, buffer option, bpdsw mode and chip id. The first API to be called is **ad719x_init**. Make sure that it returns 0, which means that the device was initialized correctly. **ad719x_init** also performs a soft reset, by calling **ad719x_reset**, in order to put the device in a known state. - -Range Configuration -------------------- - -By calling **ad719x_range_setup**, driver sets polarity and gain of the device. Accepted values for gain: - -- AD719X_ADC_GAIN_1 -- AD719X_ADC_GAIN_8 -- AD719X_ADC_GAIN_16 -- AD719X_ADC_GAIN_32 -- AD719X_ADC_GAIN_64 -- AD719X_ADC_GAIN_128 - -Filter Output Data Rate Configuration -------------------------------------- - -By calling **ad719x_output_rate_select**, driver sets the filter output data rate. Accepted values are between 1 and 1023. The output data rate can be programmed from 4.7 Hz to 4800 Hz. - -Buffer Configuration --------------------- - -By calling **ad719x_buffer_select**, driver sets the inputs as buffered or unbuffered. - -Clock Configuration -------------------- - -By calling **ad719x_clock_select**, driver sets the clock source for the ADC. Accepted values: - -- AD719X_EXT_CRYSTAL_MCLK1_MCLK2 - External crystal. The external crystal is connected from MCLK1 to MCLK2. -- AD719X_EXT_CRYSTAL_MCLK2 - External Clock applied to MCLK2. -- AD719X_INT_CLK_4_92_MHZ_TRIST - Internal 4.92 MHz clock. Pin MCLK2 is tristated. -- AD719X_INT_CLK_4_92_MHZ - Internal 4.92 MHz clock. The internal clock is - available on MCLK2. - -Bridge Switch Configuration ---------------------------- - -By calling **ad719x_set_bridge_switch**, driver opens or closes the bridge power-down switch of the ADC. - -Operating Mode Configuration ----------------------------- - -By calling **ad719x_set_operating_mode**, driver sets ADC to the desired operation mode. - -**All the above configurations are done by ad719x_init, so no further configuration is needed.** - -Channel Calibration -------------------- - -Channel calibration can be done calling **ad719x_calibrate** and providing desired channel and calibration type. - -AD719X Device Measurements -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Operation Mode Setting ----------------------- - -After the specific configuration was performed as mentioned above, you can set the device in the desired measurement mode, using **ad719x_set_operating_mode** API. The available operation modes are: - -- AD719X_MODE_CONT - Continuous Conversion Mode -- AD719X_MODE_SINGLE - Single Conversion Mode -- AD719X_MODE_IDLE - Idle Mode -- AD719X_MODE_PWRDN - Power-Down Mode -- AD719X_MODE_CAL_INT_ZERO - Internal Zero-Scale Calibration -- AD719X_MODE_CAL_INT_FULL - Internal Full-Scale Calibration -- AD719X_MODE_CAL_SYS_ZERO - System Zero-Scale Calibration -- AD719X_MODE_CAL_SYS_FULL - System Full-Scale Calibration - -Temperature Data ----------------- - -Temperature can be read using device's internal sensor. **ad719x_temperature_read** API will read and convert raw value into Celsius degrees. - -Single Conversion Data ----------------------- - -By using **ad719x_single_conversion** API, a single read of the enabled channels will occur. - -Continuous Conversion Data --------------------------- - -By using **ad719x_continuous_read_avg** API, the device will read the specified number of samples and will store their average value. - -**For Single Conversion and Continuous Conversion Data, user can use ad719x_convert_to_volts API to transform raw value into Volts.** - -AD719X Driver Initialization Example on Xilinx Platform -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - struct xil_spi_init_param spi_extra = { - .type = SPI_PS, - .flags = 0U - }; - struct spi_init_param spi_ip = { - .device_id = SPI_DEVICE_ID, - .max_speed_hz = 1000, - .mode = SPI_MODE_3, - .chip_select = 0U, - .bit_order = SPI_BIT_ORDER_MSB_FIRST, - .platform_ops = &xil_spi_ops, - .extra = &spi_extra - }; - - const struct xil_gpio_init_param gpio_extra = { - .type = GPIO_PS, - .device_id = GPIO_DEVICE_ID - }; - const struct gpio_init_param miso_ip = { - .number = RDY_PIN, - .platform_ops = &xil_gpio_ops, - .extra = &gpio_extra - }; - const struct gpio_init_param sync_ip = { - .number = SYNC_PIN, - .platform_ops = &xil_gpio_ops, - .extra = &gpio_extra - }; - - /* Device AD719X instance. */ - struct ad719x_dev *dev; - struct ad719x_init_param ad7190_dev_ip = { - .spi_init = &spi_ip, - .gpio_miso = &miso_ip, - .sync_pin = NULL, - .current_polarity = 1, - .current_gain = AD719X_ADC_GAIN_64, - .operating_mode = AD719X_MODE_SINGLE, - .data_rate_code = 480U, - .clock_source = AD719X_INT_CLK_4_92_MHZ, - .input_mode = 0, - .buffer = 0, - .bpdsw_mode = 0, - .chip_id = AD7190 - }; - - ret = ad719x_init(&dev, ad7190_dev_ip); - if(ret) - return FAILURE; diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst deleted file mode 100644 index 653fe9aa49b..00000000000 --- a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7190.rst +++ /dev/null @@ -1,224 +0,0 @@ -AD7190 - Microcontroller No-OS Driver -===================================== - -Supported Devices ------------------ - -- :adi:`AD7190` -- :adi:`AD7192` -- :adi:`AD7195` - -Evaluation Boards ------------------ - -- :adi:`EVAL-AD7190EBZ` -- :adi:`EVAL-AD7192EBZ` -- :adi:`EVAL-AD7195EBZ` - -Overview --------- - -The :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` are low noise, complete analog front ends for high precision measurement applications. Devices contain a low noise, 24-bit sigma-delta (Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means that signals of small amplitude can be interfaced directly to the ADC. The :adi:`AD7195` contains ac excitation, which is used to remove dc-induced offsets from bridge sensors. - -Devices can be configured to have two differential inputs or four pseudo differential inputs. The on-chip channel sequencer allows several channels to be enabled, and the :adi:`AD7190`, :adi:`AD7192` and :adi:`AD7195` sequentially convert on each enabled channel. This simplifies communication with the parts. The on-chip 4.92 MHz clock can be used as the clock source to the ADC or, alternatively, an external clock or crystal can be used. The output data rate from the parts can be varied from 4.7 Hz to 4.8 kHz. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz.jpg - :align: center - -The goal of this project (Microcontroller No-OS) is to be able to provide -reference projects for lower end processors, which can't run Linux, or aren't -running a specific operating system, to help those customers using -microcontrollers with ADI parts. Here you can find a generic driver which can be -used as a base for any microcontroller platform and also specific drivers for -Renesas platforms. - -Driver Description ------------------- - -The driver contains two parts: - -- The driver for the AD7190 part, which may be used, without modifications, with any microcontroller. -- The Communication Driver, where the specific communication functions for the - desired type of processor and communication protocol have to be implemented. - This driver implements the communication with the device and hides the actual - details of the communication protocol to the ADI driver. - -The Communication Driver has a standard interface, so the AD7190 driver can be -used exactly as it is provided. - -There are three functions which are called by the AD7190 driver: - -- SPI_Init() – initializes the communication peripheral. -- SPI_Write() – writes data to the device. -- SPI_Read() – reads data from the device. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/spi_architecture.png - :align: center - -.. container:: centeralign - - SPI driver architecture - -The following functions are implemented in this version of AD7190 driver: - -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| Function | Description | -+=============================================================================================================================================+==========================================================================+ -| void AD7190_SetRegisterValue(unsigned char registerAddress, unsigned long registerValue, unsigned char bytesNumber, unsigned char modifyCS) | Writes data into a register. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| unsigned long AD7190_GetRegisterValue(unsigned char registerAddress, unsigned char bytesNumber, unsigned char modifyCS) | Reads the value of a register. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| unsigned char AD7190_Init(void) | Initializes the SPI peripheral and checks if the AD7190 part is present. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_Reset(void) | Resets the device. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_SetPower(unsigned char pwrMode) | Set device to idle or power-down. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_WaitRdyGoLow(void) | Waits for RDY pin to go low. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_ChannelSelect(unsigned short channel) | Selects the channel to be enabled. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_Calibrate(unsigned char mode, unsigned char channel) | Performs the given calibration to the specified channel. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| void AD7190_RangeSetup(unsigned char polarity, unsigned char range) | Selects the polarity of the conversion and the ADC input range. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| unsigned long AD7190_SingleConversion(void) | Returns the result of a single conversion. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| unsigned long AD7190_ContinuousReadAvg(unsigned char sampleNumber) | Returns the average of several conversion results. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ -| unsigned long AD7190_TemperatureRead(void) | Read data from temperature sensor and converts it to Celsius degrees. | -+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ - -**HW Platform(s):** - -- `Renesas Demo Kit for RL78G13 (Renesas) `_ -- `Renesas Demo Kit for RX62N (Renesas) `_ - -Downloads ---------- - -.. admonition:: Download - :class: download - - - - `AD7190 Generic Driver `_ - - `AD7190 RL78G13 Driver `_ - - `AD7190 RX62N Driver `_ - - -Renesas RL78G13 Quick Start Guide -================================= - -This section contains a description of the steps required to run the AD7190 -demonstration project on a Renesas RL78G13 platform. - -Required Hardware ------------------ - -- `Renesas Demo Kit for RL78G13 (Renesas) `_ -- :adi:`EVAL-AD7190EBZ (Analog Devices) ` - -Required Software ------------------ - -- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ - -Hardware Setup --------------- - -An EVAL-AD7190EBZ has to be interfaced with the Renesas Demonstration Kit (RDK) -for RL78G13: - -:: - - EVAL-AD7190EBZ J2 connector Pin CS → YRDKRL78G13 J11 connector Pin 1 - EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRL78G13 J11 connector Pin 2 - EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRL78G13 J11 connector Pin 3 - EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRL78G13 J11 connector Pin 4 - EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRL78G13 J11 connector Pin 5 - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13.jpg - :align: center - -Reference Project Overview --------------------------- - -The reference project: - -- checks if the AD7190 part is present; -- configures the AD7190 part; -- reads data from single conversion; -- reads data from multiple conversions, calculates the average value and displays it; -- reads data from the temperature sensor and displays it in degrees Celsius. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/eval_ad7190ebz_rl78g13_screen.jpg - :align: center - -Software Project Setup ----------------------- - -.. note:: - - See `rl78g13_software_tutorial_without_applilet3 `_ - -Renesas RX62N Quick Start Guide -=============================== - -This section contains a description of the steps required to run the AD7190 -demonstration project on a Renesas RX62N platform. - -Required Hardware ------------------ - -- `Renesas Demo Kit for RX62N (Renesas) `_ -- :adi:`EVAL-AD7190EBZ (ADI) ` - -Required Software ------------------ - -- `High-performance Embedded Workshop for RX62N family `_ - -Hardware Setup --------------- - -An EVAL-AD7190EBZ board has to be interfaced with the Renesas Demonstration Kit -(RDK) for RX62N: - -:: - - EVAL-AD7190EBZ J2 connector Pin CS → YRDKRX62N J8 connector Pin 15 - EVAL-AD7190EBZ J2 connector Pin DIN → YRDKRX62N J8 connector Pin 19 - EVAL-AD7190EBZ J2 connector Pin DOUT → YRDKRX62N J8 connector Pin 22 - EVAL-AD7190EBZ J2 connector Pin SCLK → YRDKRX62N J8 connector Pin 20 - EVAL-AD7190EBZ J2 connector Pin AGND → YRDKRX62N J8 connector Pin 4 - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n.jpg - :align: center - -Reference Project Overview --------------------------- - -The reference project: - -- checks if the AD7190 part is present; -- configures the AD7190 part; -- reads data from single conversion; -- reads data from multiple conversions, calculates the average value and displays it; -- reads data from the temperature sensor and displays it in degrees Celsius. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7190_rx62n_screen.jpg - :align: center - -Software Project Setup ----------------------- - -.. note:: - - See `rx62n_software_design `_ - -More information -================ - -.. note:: - - See `more-information `_ diff --git a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst b/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst deleted file mode 100644 index 69402395912..00000000000 --- a/docs/wiki-migration/resources/tools-software/uc-drivers/renesas/ad7193.rst +++ /dev/null @@ -1,208 +0,0 @@ -AD7193 - No-OS Driver for Renesas Microcontroller Platforms -=========================================================== - -.. include:: ../ad7193.rst - -**HW Platform(s):** - -- `Renesas Demo Kit for RL78G13 (Renesas) `_ -- `Renesas Demo Kit for RX62N (Renesas) `_ - -Downloads ---------- - -.. admonition:: Download - :class: download - - - - `AD7193 Generic Driver `_ - - `AD7193 RL78G13 Driver `_ - - `AD7193 RX62N Driver `_ - - **AD7193 Driver:** :git-no-OS:`drivers/adc/ad7193` - - **PmodAD5 Demo for RL78G14:** :git-no-OS:`Renesas/RL78G14/PmodAD5` - - **RL78G14 Common Drivers:** :git-no-OS:`Renesas/RL78G14/Common` - - -Renesas RL78G13 Quick Start Guide -================================= - -This section contains a description of the steps required to run the AD7193 -demonstration project on a Renesas RL78G13 platform. - -Required Hardware ------------------ - -- `Renesas Demo Kit for RL78G13 (Renesas) `_ -- `PmodAD5 `_ - -Required Software ------------------ - -- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ - -Hardware Setup --------------- - -A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image -below). - -|image1| - -.. important:: - - - - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range - for AVDD is 3.0V ≤ AVDD ≤ 5.25V - - -Reference Project Overview --------------------------- - -The reference project: - -- checks if the AD7193 part is present; -- configures the AD7193 part for differential input on CH0(AIN1-AIN2); -- first reads data from a single conversion and displays it; -- then reads data from multiple conversions, calculates the average value and displays it; -- in the end reads data from the temperature sensor and displays it in degrees - Celsius. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13_screen.jpg - :align: center - :width: 200 - -Software Project Setup ----------------------- - -.. note:: - - See `rl78g13_software_tutorial_without_applilet3 `_ - -Renesas RL78G14 Quick Start Guide -================================= - -This section contains a description of the steps required to run the AD7193 -demonstration project on a Renesas RL78G14 platform using the PmodAD5. - -Required Hardware ------------------ - -- `Renesas Demo Kit for RL78G14 (Renesas) `_ -- PmodAD5 - -Required Software ------------------ - -- `IAR Embedded Workbench for Renesas RL78 Kickstart `_ -- The AD7193 demonstration project for the Renesas RL78G14 platform. - -.. note:: - - The AD7193 demonstration project for the Renesas RL78G14 platform consists of - three parts: the AD7193 Driver, the PmodAD5 Demo for RL78G14 and the RL78G14 - Common Drivers. - - - All three parts have to be downloaded. - -Hardware Setup --------------- - -A PmodAD5 has to be connected to the PMOD1 connector, pins 1 to 6 (see image -below). - -|image2| - -.. important:: - - - - When using AVDD > DVDD (= 3.3V), JP1 on PmodAD5 must be removed. The range - for AVDD is 3.0V ≤ AVDD ≤ 5.25V - - -Reference Project Overview --------------------------- - -The reference project: - -- checks if the AD7193 part is present; -- configures the AD7193 part for differential input on CH0(AIN1-AIN2); -- first reads data from a single conversion and displays it; -- then reads data from multiple conversions, calculates the average value and displays it; -- in the end reads data from the temperature sensor and displays it in degrees - Celsius. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14_screen.jpg - :align: center - -Software Project Tutorial -------------------------- - -.. note:: - - See `rl78g14_software_tutorial `_ - -Renesas RX62N Quick Start Guide -=============================== - -This section contains a description of the steps required to run the AD7193 -demonstration project on a Renesas RX62N platform. - -Required Hardware ------------------ - -- `Renesas Demo Kit for RX62N (Renesas) `_ -- PmodAD5 - -Required Software ------------------ - -- `High-performance Embedded Workshop for RX62N family `_ -- `Renesas Peripheral Driver Library for RX62N family `_ - -Hardware Setup --------------- - -A PmodAD5 has to be interfaced with the Renesas Demonstration Kit (RDK) for -RX62N: - -:: - - PmodAD5 Pin 1 (CS) → YRDKRX62N J8 connector Pin 15 - PmodAD5 Pin 2 (MOSI) → YRDKRX62N J8 connector Pin 19 - PmodAD5 Pin 3 (MISO) → YRDKRX62N J8 connector Pin 22 - PmodAD5 Pin 4 (CLK) → YRDKRX62N J8 connector Pin 20 - PmodAD5 Pin 5 (GND) → YRDKRX62N J8 connector Pin 4 - PmodAD5 Pin 6 (VCC) → YRDKRX62N J8 connector Pin 3 - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n.jpg - :align: center - -Reference Project Overview --------------------------- - -The reference project: - -- checks if the AD7193 part is present; -- configures the AD7193 part; -- reads data from multiple conversions, calculates the average value and displays it; -- reads data from the temperature sensor and displays it in degrees Celsius. - -.. image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/ad7193_rx62n_screen.jpg - :align: center - -Software Project Setup ----------------------- - -.. note:: - - See `rx62n_software_design `_ - -More information -================ - -.. include:: ../more-information.rst - -.. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13.jpg - :width: 500 -.. |image2| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g14.jpg From f6e012f9c4460c6af1eedecbdf8bc2cbfaf77238 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Tue, 7 Apr 2026 13:46:24 +0300 Subject: [PATCH 4/6] Fix :doc: refs to wiki-migration paths and RST errors Co-Authored-By: Claude Opus 4.6 --- .../reference-designs/eval-ad719x/ad7192.rst | 12 ++++++------ .../eval-ad719x/ad719x_mbed_iio_application.rst | 2 +- .../reference-designs/eval-ad719x/index.rst | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7192.rst b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst index c40a70b8a11..16e1c1ff557 100644 --- a/docs/solutions/reference-designs/eval-ad719x/ad7192.rst +++ b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst @@ -33,7 +33,7 @@ Evaluation Boards Description ----------- -This is a Linux industrial I/O (:doc:`IIO `) subsystem driver, targeting multi channel serial interface ADCs. 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 :doc:`IIO ` for more information. +This is a Linux industrial I/O (`IIO `_) subsystem driver, targeting multi channel serial interface ADCs. 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 `IIO `_ for more information. Source Code =========== @@ -135,7 +135,7 @@ possible to pre-declare the SPI devices that inhabit this bus. This is done with an array of struct spi_board_info, which is registered by calling spi_register_board_info(). -For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`__ +For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`_ Depending on the converter IC used, you may need to set the modalias accordingly, matching your part name. It may also required to adjust @@ -635,10 +635,10 @@ More Information - IIO mailing list: linux-iio@vger.kernel.org - `IIO Linux Kernel Documentation sysfs-bus-iio-\* `_ - `IIO Documentation `_ -- :doc:`IIO test and visualization application ` -- :doc:`libiio - IIO system library ` -- :doc:`libiio - Internals ` -- :doc:`Pointers and good books ` +- `IIO test and visualization application `_ +- `libiio - IIO system library `_ +- `libiio - Internals `_ +- `Pointers and good books `_ - `IIO High Speed `_ - `Software Defined Radio using the IIO framework `_ - diff --git a/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst b/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst index 20a5e5069c2..c9b17303897 100644 --- a/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst +++ b/docs/solutions/reference-designs/eval-ad719x/ad719x_mbed_iio_application.rst @@ -118,7 +118,7 @@ done externally by capturing data from the Serial link on controller board. *\*Note: The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.* -More info here: :doc:`Data Capture using IIO App ` +More info here: `Data Capture using IIO App `_ Time Domain Plot ---------------- diff --git a/docs/solutions/reference-designs/eval-ad719x/index.rst b/docs/solutions/reference-designs/eval-ad719x/index.rst index 8a5cbb96b29..93f8af046fc 100644 --- a/docs/solutions/reference-designs/eval-ad719x/index.rst +++ b/docs/solutions/reference-designs/eval-ad719x/index.rst @@ -26,10 +26,8 @@ Applications: ad7190 ad7192 ad7193 - ad7193 ad719x_mbed_iio_application - -Recommendations + Recommendations ------------------------------------------------------------------------------- People who follow the flow that is outlined, have a much better experience with From c02375b71cf66bcdf26586c7a71bf48c332562b8 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Tue, 7 Apr 2026 15:32:09 +0300 Subject: [PATCH 5/6] Fix remaining build errors (includes, tables, toctree) Co-Authored-By: Claude Opus 4.6 --- docs/solutions/reference-designs/eval-ad719x/ad7192.rst | 2 +- docs/solutions/reference-designs/eval-ad719x/ad7193.rst | 6 ++++-- docs/solutions/reference-designs/eval-ad719x/index.rst | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7192.rst b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst index 16e1c1ff557..7b2544f7f15 100644 --- a/docs/solutions/reference-designs/eval-ad719x/ad7192.rst +++ b/docs/solutions/reference-designs/eval-ad719x/ad7192.rst @@ -135,7 +135,7 @@ possible to pre-declare the SPI devices that inhabit this bus. This is done with an array of struct spi_board_info, which is registered by calling spi_register_board_info(). -For more information see: `spi-summary.rst documentation/spi/spi-summary.rst>`_ +For more information see: `spi-summary.rst `_ Depending on the converter IC used, you may need to set the modalias accordingly, matching your part name. It may also required to adjust diff --git a/docs/solutions/reference-designs/eval-ad719x/ad7193.rst b/docs/solutions/reference-designs/eval-ad719x/ad7193.rst index 69402395912..1ff727391d8 100644 --- a/docs/solutions/reference-designs/eval-ad719x/ad7193.rst +++ b/docs/solutions/reference-designs/eval-ad719x/ad7193.rst @@ -1,7 +1,8 @@ AD7193 - No-OS Driver for Renesas Microcontroller Platforms =========================================================== -.. include:: ../ad7193.rst +.. .. include:: ../ad7193.rst + :orphan: **HW Platform(s):** @@ -201,7 +202,8 @@ Software Project Setup More information ================ -.. include:: ../more-information.rst +.. .. include:: ../more-information.rst + :orphan: .. |image1| image:: https://wiki.analog.com/_media/resources/tools-software/uc-drivers/renesas/pmod_ad5_rl78g13.jpg :width: 500 diff --git a/docs/solutions/reference-designs/eval-ad719x/index.rst b/docs/solutions/reference-designs/eval-ad719x/index.rst index 93f8af046fc..6f4e411c56a 100644 --- a/docs/solutions/reference-designs/eval-ad719x/index.rst +++ b/docs/solutions/reference-designs/eval-ad719x/index.rst @@ -27,7 +27,6 @@ Applications: ad7192 ad7193 ad719x_mbed_iio_application - Recommendations ------------------------------------------------------------------------------- People who follow the flow that is outlined, have a much better experience with From 132747fb8ce575f309474dd47579d3f81583ad01 Mon Sep 17 00:00:00 2001 From: Vicentiu Neagoe Date: Tue, 7 Apr 2026 15:56:45 +0300 Subject: [PATCH 6/6] Fix build: index.rst blank line before section heading Co-Authored-By: Claude Opus 4.6 --- docs/solutions/reference-designs/eval-ad719x/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/solutions/reference-designs/eval-ad719x/index.rst b/docs/solutions/reference-designs/eval-ad719x/index.rst index 6f4e411c56a..89d87f7656f 100644 --- a/docs/solutions/reference-designs/eval-ad719x/index.rst +++ b/docs/solutions/reference-designs/eval-ad719x/index.rst @@ -27,6 +27,7 @@ Applications: ad7192 ad7193 ad719x_mbed_iio_application + ------------------------------------------------------------------------------- People who follow the flow that is outlined, have a much better experience with