The ADuCM3029_demo_ad7124_8PMDZ project provides a solution to control the AD7124-8 ADC on the EVAL-AD7124-8-PMDZ PMOD using a simple CLI on the USB. The demo showcases the flexibility of the AD7124 in choosing inputs, filters and different ranges for the available 16 channels.
The EVAL-AD7124-8-PMDZ is a minimalist 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC (Analog to Digital Converter) with PGA and Reference, SPI Pmod board for the AD7124-8. This module is designed as a low-cost alternative to the fully-featured AD7124-8 evaluation board and has no extra signal conditioning for the ADC.
The initial configuration of the ADuCM3029_demo_ad7124_8PMDZ engages all inputs in a mix of differential and single-ended channels. The input assignation to channels is the following:
By default only channel 0 is active at first, but this can be adjusted using the appropriate CLI commands (described below). At first all channels are using the configuration register 0 which is set to sinc4 filter option and the first option of PGA corresponding to the widest range. The filter sample rate is set at maximum. Each configuration register has a different PGA setting so that each channel can be set using the CLI to any PGA. The demo does this by assigning each channel to the corresponding configuration register that contains the desired PGA setting. Most of the demo CLI commands work in this configuration, but the CLI also offers access to the individual registers for the user to set the desired configuration manually.
The following is a list of items needed in order to replicate this demo.
The software needs no configuration.
A serial terminal is an application that runs on a PC or laptop that is used to display data and interact with a connected device (including many of the Circuits from the Lab reference designs). The device's UART peripheral is most often connected to a UART to USB interface IC, which appears as a traditional COM port on the host PC/ laptop. (Traditionally, the device's UART port would have been connected to an RS-232 line driver / receiver and connected to the PC via a 9-pin or 25-pin serial port.) There are many open-source applications, and while there are many choices, typically we use one of the following:
Before continuing, please make sure you download and install one of the above programs.
There are several parameters on all serial terminal programs that must be setup properly in order for the PC and the connected device to communicate. Below are the common settings that must match on both the PC side and the connected UART device.
In many instances there are other options that each of the different serial terminal applications provide, such as local line echo or local line editing, and features like this can be turned on or off depending on your preferences. This setup guide will not go over all the options of each tool, but just the minor features that will make it easier to read back data from the connected devices.
Example setup using Putty
Typing help or h after initial calibration sequence will display the list of commands and their short versions. Bellow is the short command list:
|Help||h||Display available commands.|
|Reset||rst|| Reset the application.|
<opt> = 'dev' to perform only a device reset; do not include to perform an application reset.
| rst dev - perform only device reset (datasheet defaults);
rst - perform application reset (application defaults).
|Register read||arr|| Read an ADC register of a specific address.|
<addr> = Address of the register to be read in hexadecimal base.
|arr 2a - Read register 0x2A|
|Register write||awr|| Write an ADC register of a specific address with a new value.|
<addr> = Address of the register to be written in hexadecimal base.
<val> = New value of the register.
|arw 9 8002 - Write 0x8002 to register 0x9.|
|Get data||ags|| Get a number of samples per enabled channels. If the operation takes too long press 'q' to abort.|
<no> = Number of samples (maximum 2048). If sample rate is smaller than 3000 setting the argument 0 or no argument means continuous streaming.
|Enable channels||aces|| Choose ADC channels to be activated.|
<mask> = 16-bit mask of the channels to be activated. Can be hexadecimal or binary.
A bit of 1 means activated the channel, a bit of 0 means deactivate
|aces 0xAAAA - activate every other channel. '0x' is necessary for hexadecimal interpretation.|
|Get enabled channels||aceg||Get enable status of ADC channels. Returns a hexadecimal 16-bit mask where bits of 1 represent enabled channels, and bits of 0 represent disabled channels.|
|Set PGA||aps|| Set PGA for a channel.|
<chan> = ID of the channel to be changed.
<opt> = PGA option; values are: opt0, opt1, … opt7 corresponding to the datasheet.
|aps 0 opt3 - set ADC channel 0 to PGA 3, gain value of 8.|
|Get PGA||apg|| Display a channel's PGA option; return values are: opt0, opt1, … opt7 corresponding to the datasheet.|
<chan> = ID of the channel to be read.
|apg 0 - read the PGA value of channel 0.|
| Set sample|
|aos|| Set ADC sample rate. Filter option, power mode and reference clock must be taken into consideration.|
<odr> = New sample rate value.
|aos 2000 - set sample rate to 2000 samples per second.|
|Get sample rate||aog||Read the current sample rate.|
| Set filter|
|afs|| Set ADC filter option.|
<opt> = filter option; can be: 'sinc4', 'sinc3', 'fflt4', 'fflt3' and 'postf'.
<post> = post-filter option; can be: 'opt0', 'opt1', … 'opt3'; add only when opt=postf.
|afs fflt4 - set filter option to fast settling sinc4.|
| Get filter|
|afg||Read the current filter.|
We recommend not opening the project directly, but rather import it into CrossCore Embedded Studios and make a local copy in your workspace.
The source code and include files of the ADuCM3029_demo_ad7124_8PMDZ can be found here:
The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.