The ADuCM360_demo_cn0338 is a CO2 gas measurement demo project for the EVAL-ADICUP360 base board with additional EVAL-CN0338-ARDZ shield, 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 shield boards. It expand the list of possible applications that can be done with the base board.
The ADuCM360_demo_cn0338 project uses the EVAL-CN0338-ARDZ shield which is a complete thermopile-based gas sensor using the nondispersive infrared (NDIR) principle.
The CN0338 circuit uses 24-bit, Σ-Δ ADCs of the ADuCM360 microcontroller for simultaneous sampling of a dual element thermopile at programmable rates of 3.5 Hz to 3.906 kHz.
The ADuCM360_demo_cn0338 application perform ADC reads, processes them and make all necessary calculations in order to provide gas concentration. Beside this it provide an interactive command line interpreter which offer the possibility to the user to customize his CN0338 shield. The UART interface (1 start bit, 8-bits data length, no parity bits and 2 stop bits) is used to send(and to receive) data to (from) a terminal window. Default value of UART baud rate is 115200 Hz, but you have the possibility to change it at run time from command line.
To start the application you need first to press ENTER key (CR) from the keyboard. A welcome message will pop-up, after that you can type 'help' to find out which are the available commands.
The project offers two calibration techniques based on Beer-Lambert Law. Find which one is more closer to your application (see Calibration Procedure).
You can check current values of the system variables using 'printsettings' command and also have the possibility to reset system variables to default values - 'resetTodefault'.
To start CN0338 measurements use 'run' command. This one will display CO2 concentration; temperature; low, high and diff voltage values for REF (peak-to-peak output of the reference detector), ACT (peak-to-peak output of the active detector) and FA (fractional absorbance).
From command line you can set following parameters: ADC sample frequency; serial port baud rate; falling and rising edge time for NDIR signal; NDIR light source frequency.
The CN0338 need to be calibrated before first use to archive best performance. There have two calibrate algorithm in CN0338 firmware, customer can choice one of algorithm to apply in calibrate procedure. The two algorithm is: Beer-Lambert Law and Modified Beer-Lambert Law, for more details about those two algorithm, please reference the circuit note in www.analog.com/cn0338.
Beer-Lambert Law calibrate procedure
Modified Beer-Lambert Law calibrate procedure
After above calibrate procedure the CN0338 is ready to use.
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 CN0338.
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_cn0338 demo can be found here:
Prebuilt CN0338 Bin File
Complete CN0338 Source Files
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
#define ALGORITHM_PEAK2PEAK
Following is the UART configuration.
Select COM Port Baud rate: 115200 Data: 8 bit Parity: none Start: 1 bit Stop: 2 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_cn0338 is a C++ project that uses ADuCM36x C/C++ Project structure.
This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; port configuration for ADC, UART via P0.1/P0.2; UART read/write functions; Memory read/write functions; NDIR calculations; C02 concentration and temperature conversions.
In the src and include folders you will find the source and header files related to CN0338 software application. The Communication.cpp/h files contain UART specific data, meanwhile the CN0338.cpp/h files contain the calculation part, the ADC.cpp/h files contain ADC channels handling and Flash.cpp/h provide memory management. The entire 'command line interpreter' is summarize in Cmd.cpp/h, Cmd_settings.cpp/h and Cmd_calibrate.cpp/h files.
Because most of the parameters can be set at run time, not need to configure so much values before you start application.
The RTE folder contains device and system related files:
End of Document