This version (28 Sep 2021 10:20) was approved by Eric Pena.
AD7768-1 Mbed IIO Application
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.
The overview of an entire system is shown below:
IIO oscilloscope is used as client application running on windows-OS, which is an 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 Virtual COM port @1Mbps or higher speed for faster data transmission). The firmware application communicates with IIO device (AD7768-1) 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 AD7768-1 IIO device. The EVAL-CN0540-ARDZ Evaluation board is used for development and testing of this application.
This code has been developed and tested on SDP-K1 Controller Board using the on-board Arduino 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.
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 )
SDP-K1 can support both physical (230.4Kbps) and a virtual COM Port (@> 1Mbps) UART
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:
Latest firmware (Use below link):
Connect the EVAL-CN0540-ARDZ 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.
Go to the link of the code provided above in the 'Downloads' section and import code into Mbed online compiler (Edit app_config.h file (defaults to AD7768-1 device) if evaluating any other device).
Ensure SDP-K1 controller board is selected (top right of online-compiler page).
Compile the code.
After a successful compile a binary will be downloaded to your computer - store this on your drive.
Drag and drop this binary to the USB
drive hosted by your controller board.
Libiio: IIO Library
This library provides an abstracted library interface to communicate IIO device (AD7768-1) 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):
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 Mbed Controller Board (SDP-K1) and EVAL-CN0540-ARDZ Eval board that contains AD7768-1. 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 AD77681 device.
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:
Device Attributes (Global): Access/Configure common device parameters. (e.g.
Conversion Mode, Sampling Frequency)
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
The below block diagram shows the AD7768-1 IIO firmware layer.
This file can be used to:
This file can be used to:
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.
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.
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:
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.