How to Quickly Evaluate Data Converters Using ACE with Python or MATLAB

Sep 1 2022
Add to myAnalog

Add article to the Resources section of myAnalog, to an existing project or to a new project.

Create New Project

Abstract

Evaluation boards (EVBs), along with their accompanying software, can easily evaluate the performance of Analog Devices products with their plug and play capability. Their graphical user interface (GUI) provides an intuitive means to manually configure and communicate with the device. However, in more complex products, sweeping across all the product’s bells and whistles while evaluating all the available features may become time consuming if these repetitive tasks are not automated.

This article explains how to record a macro and how to use it within Python® and MATLAB® environments to automate certain evaluation tasks without having to develop any complex software controller code. The AD7380 and AD7606C-16 examples used in this article automate all the user interaction such that they sweep through many different configurations and launch conversions, then export the results. These examples are used in the article to automate the evaluation of the performance benefits that an oversampling digital filter brings to an analog-to-digital converter (ADC). While this article focuses on the AD7380 and AD7606C-16, the information in this article can also apply to other ADI products and applications.

Introduction

ADI provides the means to easily evaluate every new product release, its achievable performance, as its features. Firstly, our evaluation boards consist of a printed circuit board (PCB) that houses the main devices—for example, an ADC—along with the required companion products such as voltage reference, driver amplifier, clock source, power solution, etc. Secondly, these boards come with software that show-cases the actual performance the solution can achieve. It displays real data that can be acquired with this platform. For the past couple of years, ACE software1 has been the platform used for this purpose.

Within the ACE platform, each product features a plug-in that eases the device configuration by accessing the device register map through clean, easily navigable GUI.

Following the ADC example, ACE normally displays the raw data in the form of a waveform or histogram and calculates AC performance metrics like SNR or THD through FFTs. This article shows how to automate all these procedures without the need for software development.

Figure 1. A block diagram of an evaluation board’s hardware and software interaction, including ACE to Python/MATLAB communication.

ACE Plug-Ins

Figure 2 shows the AD7380 plug-in chip view where several buttons are offered to easily configure the device:

  1. REF allows for the selection of either the internal or external reference
  2. OSC can enable oversampling and set the oversampling ratio

Figure 2. The AD7380’s ACE plug-in chip view.

Figure 3 shows the AD7606C-16 plug-in chip view where several buttons, highlighted with darker blue color, can be used among others to:

  1. Select the analog input range, per channel, by clicking the PGA symbol
  2. Select the reference source, whether internal or external
  3. Select the oversampling ratio
  4. Configure the offset/gain/phase calibration features
  5. Configure the diagnostics

Figure 3. The AD7606C-16’s ACE plug-in chip view.

While the previous examples use the AD7380 and AD7606C-16, the scope of this article is not just these products, but everything related to working with ACE and automating repetitive tasks. Every ACE plug-in will have its own GUI layout. However, as the products grow in complexity and more features are added (for example, diagnostics, calibrations, etc.), the more complex and tedious it becomes to test all these features manually. ACE remote control offers the ability to set or sweep parameters to, for example, sweep the oversampling ratio and measure how the noise performance improves.

Setting Up ACE Remote Control

Before starting to create code to control ACE remotely, the communication with ACE needs to be established by following these steps:

  1. Open ACE and go to Settings
  2. Go to the IPC Server tab and ensure it is enabled
  3. Make sure a port is allocated, preferably 2357

Figure 4. Setting up communication with ACE.

Recording a Macro and Generating Scripts

ACE has a Macro Tools menu to record configuration and device interaction steps by putting them into a macro file. Once a macro is generated, it can then be used to automatically repeat all the steps at once. The following steps explain how to generate a macro:

  1. Open ACE then go to Tools >> Macro Tools.
  2. Hit the record macro commands button, on the right-hand side of the icon within the blue area highlighted in Figure 5.
  3. Start performing device interaction such as changing parameters, inputting values to registers on the memory map, capturing data, etc. The Command window will fill up as the GUI is navigated and interacted with.
  4. Once all actions/settings to be entered are recorded, hit the stop recording macro commands button. Same location as above. The Command window will automatically pop up then.

As an example, while recording the macro, the user configures the oversampling ratio and the resolution mode, just by using the buttons explained in Figure 2. The Command window will look like Figure 5.

Figure 5. Command window and macro tools.

In this window, all the steps recorded can be reviewed and even skip/break any unwanted autogenerated step, before exporting the whole program into a selectable language script, as highlighted in red in Figure 5.

Once a macro file has been recorded, it can then be saved and played again to repeat the previously performed steps. ACE has a built-in feature to generate scripts that perform the recorded actions in a supported language of choice. So, following the previous list, the next steps will be:

  1. Click on the Generate icon, at the right-hand side of the blue area highlighted in Figure 5, to open the script generator window.
  2. Select the desired language among C#, MATLAB, or Python, and hit Export.

This code can then be imported into an IDE for execution. Using this code as the base, add additional features like instrument control to have an automated test bench for measurements.2 Visual Studio Code or MATLAB is used on the examples displayed in the next sections, and the examples will just use the product evaluation board to perform noise analysis, without any extra piece of equipment. In order to find code examples for manipulating, storing, or plotting the data gathered, as shown in the next couple of sections, visit wiki.analog.com and search for the evaluation board of interest.

Figure 6. An ACE generated code editor using Python language.

Automate Evaluation Tasks with Python

The .py file generated in the previous section allows for easily launching and repeating a series of previously recorded actions. Furthermore, even greater benefits come by editing these scripts and automating certain tasks. Following the previous example where the oversampling ratio and resolution were set in the AD7380 ACE plug-in, the generated macro is edited to allow input parameters, as shown in Figure 7. Note that, by default, these macros are called execute_macro(), but this name can be changed to a more descriptive name.

Figure 7. Edit the Python function in order to use input parameters.

This macro can now be called inside for a loop, sweeping the oversampling ratio values and seeing how the noise performance improves as the oversampling ratio increases, as well as seeing the benefits of enabling two extra bits of resolution.

Figure 8. These instructions are for a loop that sweeps the oversampling ratio and turns on and off the two extra bits of resolution.

As a result, the Python example code accesses the exported data files, reads the SNR data measured by the ACE plug-in, and reports it through the serial monitor. As shown in Table 1, oversampling improves noise performance3 but, at a certain point, two extra bits of resolution are needed in order to see the real benefit where AD7380 is shown as an 18-bit word instead of 16-bit.

Table 1. AD7380’s SNR vs. Oversampling Ratio
OSR Dynamic Range (Normal Resolution) Dynamic Range (Boost Resolution, 18-Bit)
1 90.8 dB 90.8 dB
2 92.6 dB 93.6 dB
4 94.3 dB 96.5 dB
8 95.8 dB 99.2 dB
16 96.3 dB 100.4 dB
32 96.5 dB 100.5 dB

Automate Evaluation Tasks with MATLAB

Like the Python example, the autogenerated code can be exported also for MATLAB, generating an .m file in this case. Here, macros are defined as a function, but these can also be edited to allow input parameters. The following MATLAB examples use the AD7606C-16 board instead.

Again, the benefits of AD7606C-16’s oversampling can easily be evaluated through automating ACE. Figure 9 shows a MATLAB function, edited to accept parameters like the throughput, number of samples, interface type (serial or parallel), the reference source (internal or external), oversampling ratio, number of digital lines, or the analog input range.

Figure 9. Edit the MATLAB function in order to use input parameters.

This particular function could be used within the main code in order to quickly launch the data capture different configurations to easily perform several AD7606C-16 comparisons like:

  • Noise performance vs. oversampling ratio
  • Performance vs. throughput
  • Performance vs. analog input range
  • Internal vs. external reference
  • Serial interface vs. parallel interface

And many more. Note that this is just the AD7606C-16 example; depending on the product under evaluation, many different performance evaluation needs may arise.

A good hand of AD7606C-16 can be found at wiki.analog.com,4 with the source code available. This shows how to code the macros and also gives examples to postprocess the data. The OversamplingSweep.m example sweeps the oversampling ratio and plots a histogram of codes for each value. As shown in Figure 10, the larger the oversampling ratio, the narrower the histogram of codes. Table 2 also shows how the peak-to-peak distribution of codes reduces with oversampling.

Figure 10 (continued). Histograms of codes show how the noise performance improves with the oversampling ratio. A simple script allows to sweep across the many oversampling ratio options available (up to 256).

Table 2. AD7606C-16’s Distribution of Codes vs. Oversampling Ratio
OSR Peak-to-Peak (LSBs)
1 16
2 13
4 12
8 10
16 7
32 6
64 4
128 4
256 2

Conclusion

The newer ACE platform, the framework for the latest evaluation board’s software, is an advantageous tool for any hardware designer eager to speed up the ADI product’s evaluation work because of the capability of recording macros. These macros enable test automation, through industry known programming languages such as Python or MATLAB. Automating these tasks, in turn, enables faster product evaluation and selection phase, resulting on an improvement in time to market and shortening hardware design cycles. Further support can always be found, for this and other topics, in EngineerZone, and more remote control examples can be found at wiki.analog.com.

About The Authors

Lluis Beltran Gil
Lluis Beltran Gil received his B.S. degree in electronics engineering in 2009 and in industrial engineering in 2012, both from the Universitat Politècnica de València, UPV (Technical University of Valencia). After graduati...

Latest Media 20

Subtitle
Learn More
Add to myAnalog

Add article to the Resources section of myAnalog, to an existing project or to a new project.

Create New Project