The ADuCM360_demo_cn0336 is a data acquisition demo project for 4-20 mA inputs, for the EVAL-ADICUP360 base board with additional EVAL-CN0336-PMDZ pmod, created using the GNU ARM Eclipse Plug-ins in Eclipse environment.
This project is a good example for how to use EVAL-ADICUP360 board in different combinations with pmod boards. It expand the list of possible applications that can be done with the base board.
The ADuCM360_demo_cn0336 project uses the EVAL-CN0336-PMDZ pmod which is a completely isolated 12-bits, 300 kSPS data acquisition system (with only three active devices) that processes 4 mA to 20 mA input signals.
The CN0336 circuit consists of an input current-to-voltage converter, a level shifting circuit, an ADC stage and an output isolation stage. The 4 mA to 20 mA input signal is converted into voltage levels compatible with the input range of the ADC (0 V - 2.5 V). The 12-bits ADC value is received via SPI interface of the EVAL-ADICUP360 board.
The EVAL-CN0336-PMDZ comes with an evaluation software which can help you to test and to calibrate your pmod before you use it.
The ADuCM360_demo_cn0336 application processes ADC outputs and provide current and voltage values. You can decide how often the ADC measurements take place (see SCAN_TIME parameter).
A UART interface (115200 baud rate and 8-bits data length) is used to send the results to terminal window: input current value, voltage calculation and ADC code. If the input value is out of range you get an error message which means that you need to check your settings.
To start displaying data acquisition results on a terminal (putty in this case) you need to press ENTER key (CR) from the keyboard and after that the data are updated every time the input values are changed. The output data are send via UART using semihosting.
The project offers two method to calculate the input current, giving you the possibility to get more accurate results (see CN0336 circuit note). You can use transfer function of the circuit which calculate input current based on voltage changed value and circuit gain:
I = Imin + (Vout - Voffset)/Gain
Or you can use the two-point calibration method which used the ADC output values for 2 different measurements: first at Imin = 4 mA (ADC1) and second at Imax = 20 mA (ADC2):
Ix = Imin + [(Imax - Imin)/(ADC2 - ADC1)]*(ADCx - ADC1)
The following is a list of items needed in order to replicate this demo.
There are two basic ways to program the ADICUP360 with the software for the CN0336.
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 ADuCM360_demo_cn0336 demo can be found here:
Prebuilt CN0336 Bin File
Complete CN0336 Source Files
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
#define AD7091R_OPERATION_MODE POWER_DOWN
#define SCAN_TIME 500
#define VREF 2.5
#define CALC_FORMULA TWO_POINT_CALIBRATION
#define IMIN 4 /* Imin [mA] */ #define IMAX 20 /* Imax [mA] */ #define ADC_MIN 147 /* ADC min for IMIN */ #define ADC_MAX 3960 /* ADC max for IMAX */
Following is the UART configuration.
Select COM Port Baud rate: 115200 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
The official tool we promote for use with the EVAL-ADICUP360 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 ADuCM360_demo_cn0336 project use ADuCM36x C/C++ Project structure.
This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; port configuration for SPI0, UART via P0.6/P0.7; SPI, UART read/write functions; AD7091R control and current-voltage conversion.
In the src and include folders you will find the source and header files related to CN0336 software application. The Communication.c/h files contain SPI and UART specific data, meanwhile the AD7091R.c/h files contain the ADC control data and the CN0336.c/h files contain the data acquisition parts.
The RTE folder contains device and system related files:
End of Document