Wiki

This version is outdated by a newer approved version.DiffThis version (06 Jul 2022 09:46) is a draft.
Approvals: 0/1
The Previously approved version (24 Jun 2022 16:10) is available.Diff

This is an old revision of the document!


AD4130 Mbed IIO Application

Introduction

This page gives an overview of using the ARM Mbed platform supported firmware example with Analog Devices AD4130 Evaluation board and SDP-K1 controller board. This example code leverages the ADI developed IIO (Industrial Input Output) ecosystem to evaluate the AD4130 device by providing a device debug and data capture support. The overview of an entire system is shown below:

IIO oscilloscope is used as a client application running on windows-os, which is ADI developed GUI for ADC data visualization and device debug. The physical interface used for communicating client application with firmware application (IIO device) is UART/VirtualCOM (*For now only SDP-K1 supports high speed VirtualCOM port @1Mbps or higher speed for faster data transmission). The firmware application communicates with IIO device (AD4130) using ADI No-OS drivers and platform drivers middle-ware software libraries. SDP-K1 is used as controller board, on which IIO firmware application runs and using above software libraries, the IIO firmware communicates with target device. The AD4130 eval board is used for development and testing of this application.


Hardware Connections

Jumper Settings

AD4130 uses SPI communication for device register access and data capture. For data transmission to IIO client, VirtualCOM Or UART serial communication is used. SDP-K1 by default uses the VCOM serial interface for higher speed data transmission. SDP-K1 is powered through USB connections from the computer. SDP-K1 acts as a Serial device when connected to PC, which creates a COM Port to connect to IIO Oscilloscope GUI running on windows-os. The COM port assigned to a device can be seen through the device manager for windows-based OS.

SDP-K1 can support high speed VirtualCOM port USB interface, so by default VCOM is configured as default interface in the firmware. The interface can be set to UART by defining macro “USE_PHY_COM_PORT” in the app_config.h file.


Software Downloads

Latest firmware (Use below link):

Quick Start to Use Mbed IIO Firmware

If you have some familiarity with the Mbed platform, the following is a basic list of steps required to start running the code, see below for more detail:

  • Connect the AD4130 EVAL-board to the SDP-K1 controller board as specified in hardware connections section.
  • Connect the SDP-K1 controller board to your computer over USB provided along with SDP-K1 board.
  • Unzip the ‘ad4130_iio-application.zip’ file provided by Analog Devices onto your local folder.
  • Import the code into Keil Studio Cloud IDE (web compiler) by drag and drop of this unzipped folder into web IDE. This shall create a new project with same name as folder name onto web IDE.
  • Right click on the project name and select ‘Set Active Project’ option.

  • Unordered List ItemFix library import issues by selecting ‘Mbed Libraries’ tab at the bottom side of IDE and then clicking on the ‘Fix all problems’ option. Allow some time to checkout all library dependency.

  • Compile the code as shown below:

  • After a successful build, a binary will be generated and available for download - store this onto your local drive.
  • Drag and drop this binary to the USB drive hosted by your controller board (e.g. SDP-K1) to program the microcontroller.

Libiio: IIO Library

This library provides an abstracted library interface to communicate IIO device and IIO client application (e.g. IIO Oscilloscope) without worrying about the low level hardware details. Download and install below libiio windows installer in your computer.

Libiio installer for Windows (Use below link):

IIO Oscilloscope (Client)

This is a GUI (Graphical User Interface) based IIO client application for data visualization and device configuration/debugging. The data from IIO devices (ADCs/DACs) is transmitted over Serial/Ethernet/USB link to IIO Oscilloscope client through the abstracted layer of “libiio”.

Download and install below IIO Oscilloscope windows installer in your computer. IIO Oscilloscope installer for Windows (Use below link):


Evaluating AD4130 Using IIO Ecosystem

Ensure that hardware connection has been made properly in between Controller Board (SDP-K1) and AD4130 Eval board. Also ensure all software's (IIO firmware, Libiio windows installer and IIO Oscilloscope windows installer) are downloaded and installed in your computer before trying to communicate with AD4130 device..

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 AD4130 device should pop-up in IIO devices list.

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.

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:

  1. Device Attributes (Global): Access/Configure common device parameters.
  2. 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.

Data Capture from IIO Device

To capture the data from AD717x 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: Data Capture using IIO App

Data capturing utilizes two modes:

  1. Normal sequencer: In this mode, the channel for which data to be captured are enabled and automatically added into a sequencer. The sequencer operates in the continuous conversion mode. After each conversion, an interrupt signal attached to configured INT source is triggered and conversion result is read into a internal acquisition buffer.
  1. FIFO mode: This mode uses the internal FIFO of device to store the ADC samples. The conversion happens in continuous conversion mode and an interrupt signal attached to configured INT source is triggered when internal FIFO becomes full (reached to watermark limit). The data from FIFO is read periodically when FIFO is made available by device. The FIFO is operated in ‘Oldest Save’ mode as there must be enough time provided to read the FIFO after it becomes full. If FIFO is operated into streaming mode, the previous data could get overwritten before it is being acquired by the firmware.
  • Time Domain Plot

*Note: Due to low sampling rate (50SPS) for temperature sensor measurement, select 50 or less samples during data capturing for sensor demo mode channels.

  • Frequency Domain Plot:

*Note: *Note: Max 4096 samples can be selected for plotting frequency domain response due to limited buffer size in the firmware.

Access Register map of IIO Device

AD4130 Firmware Structure

app_config.h

This file can be used to:

  1. Select the AD4130 and SDP-K1 interface (Default is SDP-120, but it can be changed to Arduino by enabling ‘ARDUINO’ macro.
  2. Select the AD4130 device package (either LFCSP or WLCSP). Default is LFCSP. The corresponding hardware board must be used with software selected package type.
  3. Configure the pin mapping w.r.t SDP-120 or Arduino interface.

ad4130_user_config.c

This file defines the user configurations for the AD4130, such as SPI parameters (frequency, mode, etc) and other init parameters used by No-OS drivers to initialize AD4130 device (e.g. required GPIOs, software/hardware mode, etc). These are the parameters loaded into device when device is powered-up or power-cycled.

ad4130_user_config.c

This file implements the data capturing logic for the AD4130 device. The data capturing can be done using normal ‘Sequencer’ Or using internal ‘FIFO’. Enable the macro ‘FIFO_ENABLED’ for enabling FIFO mode.

iio_ad4130.c

This file defines getter/setter functions for all the device and channel specific attributes (related to AD4130 devices) to read/write the device parameters. The majority of device specific functionality is present in this module.

No-OS Drivers for AD4130

The no-os drivers provide the high level abstracted layer for digital interface of AD4130 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:

  1. ad7124.c
  2. ad7124.h

*The AD7124 legacy no-os drivers are used for evaluating the part; however, the drivers are updated to support the memory map and device APIs for accessing AD4130 device.

resources/eval/user-guides/ad4130/mbed_iio_app.1657093570.txt.gz · Last modified: 06 Jul 2022 09:46 by Mahesh Phalke