The ADuCM3029_demo_cn0531 project provides a solution to control a AD5791 DAC PMOD using the EVAL-ADICUP3029. The AD5791 is a high precision, 1ppm, voltage output DAC that can be controlled in this application using a serial UART CLI connected to a host PC.
EVAL-CN0531-PMDZ is a minimalist 1 ppm, 20-Bit, ±1 LSB INL, DAC SPI PMOD board suitable for medical instrumentation, test and measurement equipment, industrial control or high end scientific and aerospace instrumentation. Multiple voltage references and power options are available to adapt this module depending on the application. With this module, the user is capable to use the onboard positive voltage reference or to connect external references.
The ADuCM3029_demo_cn0531 project uses this PMOD with the EVAL-ADICUP3029 board to bring up the DAC, control it's internal registers and control it's voltage output. This control is done using a minimalist CLI interface enabled over the UART controller of the board. This CLI can be used by a host PC connected via USB cable to the system.
The following is a list of items needed in order to replicate this demo.
Software does not need configuration to work.
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.|
|DAC specific commands|
|DAC register read||drr|| Read a DAC register.|
<addr> = address of the register to be read in hexadecimal.
|drr 1 - read register 1|
|DAC register write||drw|| Write a DAC register.|
<addr> = address of the register to be written in hexadecimal.
<val> = value to be written to the register in hexadecimal.
|drw 1 18c - set register 1 to 0x18C|
|DAC set output||do|| Update the DAC output voltage.|
<volt> = new voltage value expressed in volts.
|do -2.3 - set DAC output to -2.3V|
Note that the 'do' command for setting the output voltage works on the assumption that the on board 5V reference is used.
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_cn0531 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.
The program is composed of two main parts:
Board setup initializes UART and SPI communications and sets the DAC value register to 0. The DAC RBUF bit is also set to 0 to provide the widest voltage range for the application. The DAC output will be between -5V and 5V and coded in two's complement. The coding can be changed to offset binary and the 'do' CLI command will take that into consideration, as it will also take into consideration the RBUF bit. If the RBUF is changed to narrow the output field to 0V - 5V the coding will not change. As such the 0x00000 value of the DAC register will correspond to the middle range value of 2.5V. If not using the 'do' command to change the output, this will have to be taken into consideration.
End of Document