Wiki

This version (27 Dec 2022 08:54) was approved by Mahesh Phalke.The Previously approved version (14 Sep 2021 07:25) is available.Diff

AD7768-1 IIO Application

Introduction

This page gives an overview of using the ARM Mbed platform supported firmware example with Analog Devices EVAL-CN0540-ARDZ Evaluation board(s) that contains AD7768-1 and SDP-K1 controller board. This example code leverage the ADI developed IIO (Industrial Input Output) ecosystem to evaluate the AD77681 device by providing a device debug and data capture support.

The AD7768-1 is a low power, high performance, Σ-Δ analog-to-digital converter (ADC), with a Σ-Δ modulator and digital filter for precision conversion of both ac and dc signals. The AD7768-1 is a single-channel version of the AD7768, an 8-channel, simultaneously sampling, Σ-Δ ADC.

IIO oscilloscope is used as client application running on Windows-os, which is ADI developed GUI for ADC data visualization and device debug. The interface used for communicating client application with firmware application (IIO device) is UART (Note: SDP-K1 can also support high speed VirtualCOM port @1Mbps or higher speed for faster data transmission). The firmware application communicates with IIO device using ADI No-OS drivers and platform drivers low level software layers. SDP-K1 is used as controller board, on which IIO firmware application runs and using above software libraries, the IIO firmware communicates with IIO device.

This code has been developed and tested on SDP-K1 Controller Board using the on-board SDP-120 Headers. However, same code can be used without or with little modifications on any Mbed enabled board which has Arduino Header Support on it, such as STM32-Discovery, STM32-Nucleo, etc.
26 Dec 2022 09:51 · Janani Sunil
26 Dec 2022 10:39 · Janani Sunil

Hardware Connections

SDP-K1:

  • Place EVAL-CN0540 on top of the SDP-K1 to communicate with the AD7768-1 IC.
  • Locate VIO_ADJUST Pin Headers near the DC Connector, set it to 3.3V. ( Default is 1.8v )

Connection Details:

  • Refer to useful links for the SDP-K1, AD7768-1 IC and EVAL-CN0540-ARDZ board, schematics and pin description.

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.

*Note: Actual COM port number for your device may not be the same as shown above. Therefore, always check your SDP-K1 serial COM port number before connecting to IIO client.

26 Dec 2022 10:42 · Janani Sunil

Software Downloads

MBED Firmware

This section briefs on the usage of MBED firmware. This also explains the steps to compile and build the application using mbed and make based build.

Source code is hosted here:

Build Guide for Precision Converters MBED firmware (Use below link):

26 Dec 2022 18:38 · Janani Sunil

Libiio: IIO Library

This library provides an abstracted library interface to communicate IIO device and IIO client application (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):

26 Dec 2022 10:20 · Janani Sunil

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):


26 Dec 2022 10:22 · Janani Sunil
26 Dec 2022 10:50 · Janani Sunil

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 AD7768-1 Using IIO Ecosystem

Ensure that hardware connection has been made properly in between Controller Board (SDP-K1) and ADC 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 the device.
26 Dec 2022 10:52 · Janani Sunil

Running IIO Oscilloscope ( Client )

  • Open the IIO Oscilloscope application from start menu and configure the serial context settings as shown below in the image.
  • Click on the refresh button, the context description and the attributes will be populated by the serial details and the AD7768-1 device should pop-up in IIO devices list.
  • Click 'Connect' and a new window will pop-up.
  • On the new window, select the AD7768-1 device from the drop down menu list of 'Device Selection'.

Configure/Access IIO Device Attributes ( Parameters )

The IIO Oscilloscope's Device Attributes allows user to access and configure different device parameters.

There are 2 types of attributes:
  1. Device Attributes (Global): Access/Configure common device parameters. (e.g. Conversion Mode, Sampling Frequency)
  2. Channel Attributes (Specific to channels): Access/Configure channel specific device parameters. (e.g. channel raw and scale)
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, write a attribute value in the 'value field' and press 'Write' button. The value to be written corresponds to expected bit-field for that parameter, specified in the datasheet. For example, below figure shows how to write a “Power Mode” value.

Using Register Map Settings to read register values

How to read and write register values:
  • To 'Read a register ', simply populate the Address textbox with the desired address to be read and press 'Read' button on left side.
  • To 'Write a register ', populate the Address textbox with the desired address to be read and populate also the Value text box with the value base on the datasheet and press the 'write' button on the left.
  • To 'AutoRead a register ', Tick the Enable AutoRead check box and populate the Address textbox with the desired address to be read.

Unused or Unavailable register address will return as an error.

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.

The voltage is just instantaneous, so it is not possible to get RMS AC voltage or averaged DC voltage. Also, when using DMM tab, it is not encouraged to use Data Capture or Debug tab as this could impact data capturing.

Data Capture from IIO Device

To capture the data from AD7768-1 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.

Time Domain Plot:

Frequency Domain Plot:

The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. More info here: data-capture-using-iio-app
The continuous time domain data capture can work correctly at ODR/Sampling Rate defined in the firmware code (32KSPS). For plotting frequency domain response max 4096 samples can be selected due to limited buffer size in the firmware. These limitations are due to the firmware architecture and design choices and does not limit the actual device specifications provided in device datasheet

Modifying Firmware

The below block diagram shows the AD7768-1 IIO firmware layer.

app_config.h

This file can be used to:

  • Set the default active device to AD7768-1.
  • Set the serial communication between UART or Virtual COM port.

app_config_mbed.h

This file can be used to:

  • Configure Mbed related pin configurations.
  • Configure the pin mapping of AD7606 w.r.t Arduino Header on Controller Board.

ad77681_user_config.c

This file defines the user configurations for the AD7768-1, such as SPI parameters (frequency, mode, etc) and other init parameters used by No-OS drivers to initialize AD7768-1 device (e.g. Power Mode, Conversion mode, etc). These are the parameters loaded into device when device is powered-up or power-cycled.

ad77681_iio.c

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

ad77681_data_capture.c

This file defines the data capture implementation of AD7768-1 for visualizing adc raw data on IIO oscilloscope.

No-OS Drivers for ad77681

The no-OS drivers provide the high level abstracted layer for digital interface of AD7768-1 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. ad77681.c
  2. ad77681.h
It is hoped that the most common functions of the AD7768-1 are coded, but it's likely that some special functionality is not implemented. Feel free to consult Analog Devices Engineer-Zone for feature requests, feedback, bug-reports etc.

resources/tools-software/product-support-software/ad77681_mbed_iio_application.txt · Last modified: 27 Dec 2022 08:54 by Mahesh Phalke