The ADuCM3029_demo_cn0418 project provides a solution to control a PLC or DCS output system using the EVAL-CN0418-ARDZ and the EVAL-ADICUP3029. It uses a DAC with 4 channels that can be configured as either voltage or current output and is compatible with HART modem output to enable HART communication on any channel. It has a 32kb EEPROM memory that can also be used to identify the board and is controlled via a command line interface (CLI).
The EVAL-CN0418-ARDZ is an Arduino compatible shield includes a AD5755-1 (quad channel voltage and current output DAC with dynamic power control) and the AD5700-1 HART modem, to give a completely isolated multiplexed HART analog output solution.
The ADuCM3029_demo_cn0418 application uses different software modules to deliver a CLI interface that can be used to set any channel range or output and transmit and receive HART messages on any of those channels. It uses SPI to communicate with the AD5755-1, to read and write its registers. The channle code and range registers can be set as well as the RSET register. It can function both in voltage and current mode.
The current mode is used with the AD5700-1 HART modem to transmit and receive HART messages. The application can send command zero and then receive and interpret the result. The receiving is done asynchronous through the use of GPIO group interrupts featured by the ADuCM3029. The maximum baudrate of the HART communication is 1200 and is implemented by a software UART. It transmits and receives data bytes of 8 bits with one stop bit and one parity bit, using odd parity.
The CLI is implemented using the hardware UART module in the ADuCM3029 and can work up 115200 baudrate.
The following is a list of items needed in order to replicate this demo.
The software needs no configuration beyond the CLI UART baudrate, and HART UART parity and number of bits. These can be accessed in the ADuCM3029_demo_cn0418.c file in the main function, but usually the default values work best.
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:
Command | Description |
---|---|
General commands | |
h | Display available commands. |
stts | Display parameters of the application. |
DAC commands | |
dsr | Set range of a channel. <chan> = channel to be set. Available channel options are: cha, chb, chc, chd. <range> = chosen range for the channel. Available options are: - r05v = range from 0 to 5 volts; - r010v = range from 0 to 10 volts; - rmp5v = range form -5 to +5 volts; - rmp10v = range from -10 to +10 volts; - r420ma = range from 4 to 20 mili-amperes; - r020ma = range from 0 to 20 mili-amperes; - r024ma = range from 0 to 24 mili-amperes. |
dsv | Set voltage output on a channel. Only works if the channel is set to a voltage range. <chan> = channel to update. Available channel options are: cha, chb, chc, chd. <voltage> = voltage level expressed in volts. Use decimal point for fractional values. |
dsc | Set current output on a channel. Only works if the channel is set to a current range. <chan> = channel to update. Available channel options are: cha, chb, chc, chd. <current> = current level expressed in amperes. Use decimal point for fractional values. |
dsx | Set output on a channel. Works independent of channel range. <chan> = channel to update. Available channel options are: cha, chb, chc, chd. <code> = 16-bit output code for the channel. |
dse | Set the RSET of a channel. <chan> = channel to update. Available channel options are: cha, chb, chc, chd. <opt> = RSET option. Available options are: int and ext. |
HART commands | |
he | Enable HART channel. |
hd | Disable HART channel. |
hcc | Select wanted channel. <chan> = Channel to be selected. |
ht | Transmit string through HART. <string> = string to be transmitted. |
hg | Send the received buffer through UART connection. |
hcz | Send command zero with the specified number of FFs in the preambule. <pbsize> = size of the preambule (no. of 0xFFs in the beginning). |
hpt | Send a byte in a loop through HART to test the physical connection. <byte> = byte to send in loop. |
EEPROM commands | |
de | Discover EEPROM I2C addresses if there are any. |
There are two basic ways to program the ADICUP3029 with the software for the CN0418.
Using the drag and drop method, the software is going to be a version that Analog Devices creates for testing and evaluation purposes. This is the EASIEST way to get started with the reference design
Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needs, but will be a bit more advanced and will require you to download the CrossCore toolchain.
The software for the ADuCM3029_demo_cn0418 can be found here:
Prebuilt CN0418 Hex File
Complete CN0418 Source Files
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, SPI and I2C communication and verifies if there is an active EVAL-CN0418-ARDZ board connected by reading the main control register to memorize the value then trying to write and read that register to see if there is any device present that communicates through SPI the same way as the AD5755 and has the same register. If the AD5755's presence is confirmed this way the register is reset to the initial value and the application continues.
After initialization, the application enters a loop where it memorizes UART characters as they come from the CLI. If an ENTER character is detected the application determines if a command has been called and executes it. The application also listens on the active HART channel and memorizes in a buffer any transmission received.
End of Document