Wiki

This version (12 Dec 2017 21:41) was approved by Brandon.The Previously approved version (01 Feb 2016 16:39) is available.Diff

Toxic Gas (CO) Measurement Demo

The ADuCM360_demo_cn0357 is a toxic gas(CO) detector demo project for the EVAL-ADICUP360 base board with additional EVAL-CN0357-ARDZ shield, created using the GNU ARM Eclipse Plug-ins in Eclipse environment.

General description

This project is a good example for how to use EVAL-ADICUP360 board in different combinations with various shield boards. It expand the list of possible applications that can be done with the base board.

The ADuCM360_demo_cn0357 project uses the EVAL-CN0357-ARDZ shield which is a single-supply, low noise, portable gas detector circuit using an electrochemical sensor.



The EVAL-CN0357-ARDZ shield circuit provides a potentiostatic circuit for biasing the electrochemical sensor, along with a programmable TIA and 16-bit Sigma-Delta ADC. The TIA converts the small currents passing in the sensor to a voltage that can be read by the ADC. The 16-bit ADC value is received via SPI interface of the EVAL-ADICUP360 board, where the gas concentration is computed.




The ADuCM360_demo_cn0357 application configures the necessary components, processes ADC output value and make all necessary conversions in order to provide the gas concentration. A UART interface (9600 baud rate and 8-bits data length) is used to send the results to terminal window: ADC Data Register codes, ADC Input Voltage volts, and Gas Concentration Parts Per Million(PPM) are the outputs provided in the terminal window.





At the start of the project, the software computes the necessary parameters and configure the digital rheostat(AD5270) of the TIA. The required parameters are the sensor sensitivity and sensor range. These can be modified by changing the values of the constants SENSOR_SENSITIVITY and SENSOR_RANGE found in the CN0357.h header file of the project. See the “Project Structure” section for more details.


Once configuration is complete, the software remains in a loop and continuously reads data from the ADC. Data can be read from a terminal by pressing the <Enter> key on the computer's keyboard.

Demo Requirements

The following is a list of items needed in order to replicate this demo.

  • Hardware
    • EVAL-ADICUP360
    • EVAL-CN0357-ARDZ
    • Electrochemical Gas Sensor (included with CN0357)
    • Mirco USB to USB cable
    • PC or Laptop with a USB port
  • Software
    • ADuCM360_demo_cn0357 software
    • CrossCore Embedded Studio (2.7.0 or higher)
    • ADuCM36x DFP (1.0.2 or higher)
    • CMSIS ARM Pack (4.3.0 or higher)
    • Serial Terminal Program
      • Such as Putty or Tera Term

Setting up the hardware

  1. To program the base board, set the jumpers/switches as shown in the next figure. The important jumpers/switches are highlighted in red.
  2. Connect the EVAL-CN0357-ARDZ to the Arduino connectors P2, P5, P6, P7, P8 of the EVAL-ADICUP360 board.
  3. Connect an acceptable 7V-12V power supply into the P11 barrel jack of the EVAL-ADICUP360

Extremely important to plug in an acceptable power supply to the barrel jack P11 to supply power for the EVAL-CN0357-ARDZ. The boards will not work if you try only to power it from the DEBUG_USB or the USER_USB.

  1. Plug in the USB cable from the PC to the EVAL-ADICUP360 base board via the Debug USB.(P14)

Obtaining the source code

We recommend not opening the project directly, but rather import it into CCES and make a local copy in your workspace.

The source code and include files of the ADuCM360_demo_cn0357 can be found on Github:


CrossCore Embedded Studio Application Source Code:

ADuCM360_demo_cn0357 at Github

For more information on importing, debugging, or other tools related questions, please see the tools user guide.

Configuring the Software Parameters

  • Sensor Range - SENSOR_RANGE - maximum value of the gas conentration (ppm) that can be detected by the electrochemical gas sensor being used (CN0357.h).
    #define SENSOR_RANGE     2000 
  • Sensor Sensitivity - SENSOR_SENSITIVITY - sensitivity (nA/ppm) of the electrochemical sensor being used (CN0357.h).
    #define SENSOR_SENSITIVITY  65   

Outputting Data

Serial Terminal Output

  1. In order to view the data, you must flash the program to the EVAL-ADICUP360.
  2. Once complete you will need to switch the USB cable from the DEBUG USB (P14) to the USER USB (P13).
  3. Then follow the UART settings below with the serial terminal program.


Following is the UART configuration.

  Select COM Port
  Baud rate: 9600
  Data: 8 bit
  Parity: none
  Stop: 1 bit
  Flow Control: none


  1. The user must press the <ENTER> key every time they want new results.

How to use the Tools

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.

Importing

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.

Debugging

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.

Project structure

The ADuCM360_demo_cn0357 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 SPI1, UART via P0.6/P0.7; SPI, UART read/write functions, AD7790 control, AD5270 control and gas concentration computation.

In the src and include folders you will find the source and header files related to CN0357 software application. The Communication.c/h files contain SPI and UART specific data, the AD7790.c/h files contain the ADC control, the AD5270.c/h files contain the rheostat control and the CN0357.c/h files contain configurations and computations specific to the gas detector application.


The RTE folder contains device and system related files:

  • Device Folder – contains low levels drivers for ADuCM360 microcontroller.(try not to edit these files)
  • system.rteconfig - Allows the user to select the peripherial components they need, along with the startup and ARM cmsis files needed for the project.



End of Document

resources/eval/user-guides/eval-adicup360/reference_designs/demo_cn0357.txt · Last modified: 12 Dec 2017 21:41 by Brandon