Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:eval:user-guides:eval-adicup360:reference_designs:demo_cn0396 [31 Oct 2016 15:08] – [Debugging the ADuCM360_demo_cn0396 project] Veronica Lupeiresources:eval:user-guides:eval-adicup360:reference_designs:demo_cn0396 [14 Mar 2021 10:02] (current) – [Obtaining the Source Code] adding in .Bin file Zuedmar Arceo
Line 1: Line 1:
-======4 – Wire Electrochemical Dual Toxic Gas Demo======+====== 4 – Wire Electrochemical Dual Toxic Gas Demo ======
  
-The **ADuCM360_demo_cn0396** is a dual toxic gas detector demo project, for the EVAL-ADICUP360 base board with additional EVAL-CN0396-ARDZ shield, created using the  GNU ARM Eclipse Plug-ins in Eclipse environment+The **ADuCM360_demo_cn0396** is a dual toxic gas detector demo project, for the EVAL-ADICUP360 base board with additional EVAL-CN0396-ARDZ shield, created using the CrossCore Embedded Studios Interactive Development Environment.(IDE) 
  
-\\ 
 ===== General description ===== ===== General description =====
-\\ 
  
-The **ADuCM360_demo_cn0396** project uses the [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0396-ARDZ.html|EVAL-CN0396-ARDZ shield]] which is a single-supply, low noise, portable gas detector, using a **4-electrode electrochemical** sensor, for simultaneous detection of two distinct gases - for this example is used the Alphasense COH-A2 sensor, which detects carbon monoxide(**CO**) and hydrogen sulfide(**H2S**).+The **ADuCM360_demo_cn0396** project uses the [[adi>cn0396|EVAL-CN0396-ARDZ shield]] which is a single-supply, low noise, portable gas detector, using a **4-electrode electrochemical** sensor, for simultaneous detection of two distinct gases - for this example is used the Alphasense COH-A2 sensor, which detects carbon monoxide(**CO**) and hydrogen sulfide(**H2S**).
  
-The **EVAL-CN0396-ARDZ** board provides a potentiostatic circuit for biasing the electrochemical sensor, along with dual programmable TIA's and 16-bit Sigma-Delta ADC. The TIA's convert the small currents passing in the sensor to a voltage that can be read by the [[http://www.analog.com/ad7798|AD7798]] a 3-channel, low noise, low power 16-bit ADC that converts the analog voltage into digital data. The **16-bit** ADC outputs are received via SPI interface of the EVAL-ADICUP360 board. An [[http://www.analog.com/ADT7310|ADT7310]] digital **temperature sensor** is also included to measure ambient temperature in order for correction of temperature effects.+The **EVAL-CN0396-ARDZ** board provides a potentiostatic circuit for biasing the electrochemical sensor, along with dual programmable TIA's and 16-bit Sigma-Delta ADC. The TIA's convert the small currents passing in the sensor to a voltage that can be read by the [[adi>ad7798|AD7798]] a 3-channel, low noise, low power 16-bit ADC that converts the analog voltage into digital data. The **16-bit** ADC outputs are received via SPI interface of the EVAL-ADICUP360 board. An [[adi>ADT7310|ADT7310]] digital **temperature sensor** is also included to measure ambient temperature in order for correction of temperature effects.
  
 {{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_1.png?650 |}} {{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_1.png?650 |}}
Line 24: Line 22:
 {{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_3.png?800 |}} {{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_3.png?800 |}}
  
-\\+===== Demo Requirements ===== 
 + 
 +The following is a list of items needed in order to replicate this demo. 
 +  * Hardware 
 +    * EVAL-ADICUP360 
 +    * EVAL-CN0396-ARDZ 
 +    * Electrochemical Gas Sensor (included with CN0396) 
 +    * Mirco USB to USB cable 
 +    * PC or Laptop with a USB port 
 +  * Software 
 +    * ADuCM360_demo_cn0396 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 ===== ===== Setting up the hardware =====
-\\ 
  
-Connect the **EVAL-CN0396-ARDZ** to the Arduino connectors **P4, P5, P6, P7, P8** of the **EVAL-ADICUP360** board. +  - To program the base board, set the jumpers/switches as shown in the next figure. The important jumpers/switches are highlighted in red.{{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0216_hw_config.png?500 |}} 
 +  - Connect the **EVAL-CN0396-ARDZ** to the Arduino connectors **P2, P5, P6, P7, P8** of the **EVAL-ADICUP360** board. 
 +  - Set the jumpers on EVAL-CN0396-ARDZ board, as shown in the picture below.{{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_4.png?600 |}} 
 +  - Plug in the USB cable from the PC to the EVAL-ADICUP360 base board via the Debug USB.(P14)
  
-<note important>Extremely important to plug in an acceptable power supply to the barrel jack **P11** to supply power for the **EVAL-CN0396-ARDZ**.  The boards will not work if you try only to power it from the DEBUG_USB or the USER_USB.</note>+===== Obtaining the Source Code =====
  
-In order to program the base board you need to use the **DEBUG USB**, and you will need to use the **USER USB** to communicate with the serial terminal program. The important jumpers and switches configurations are highlighted in red.+There are two basic ways to program the ADICUP360 with the software for the CN0396. 
 +  - Dragging and Dropping the .Bin to the MBED drive 
 +  - Building, Compiling, and Debugging using CCES
  
-{{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0216_hw_config.png?600|}}  +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.
-\\+
  
-The ADuCM360_demo_cn0396 uses **UART** connection via **P0.6/P0.7** and **SPI1** channel of the ADuCM360 to communicate with EVAL-CN0396-ARDZ board. The **CS1** for //AD7798// is configured on **P0.3**the ** CS2** for //AD5270// is configured on **P1.4** and the **CS3** for //ADT7310// on **P1.2**. See jumper setup in the picture below:+Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needsbut will be a bit more advanced and will require you to download the CrossCore toolchain.
  
-{{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_4.png?600|}} +The software for the **ADuCM360_demo_cn0396** demo can be found here:
-\\ +
-\\ +
-===== Obtaining the source code ===== +
-\\+
  
-We recommend not opening the project directly, but rather import it into Eclipse and make a local copy in your Eclipse workspace+<WRAP round 80% download> 
 +Prebuilt CN0396 Bin File 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP360/releases/download/Release-1.0/ADuCM360_demo_cn0396.bin| ADuCM360_demo_cn0396.Bin]] 
 +Complete CN0396 Source Files 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP360/tree/master/projects/ADuCM360_demo_cn0396| ADuCM360_demo_cn0396 Source Code]]
  
-The source code and include files of the **ADuCM360_demo_cn0396** can be found on Github:+</WRAP>
  
-<WRAP round 40download+<WRAP center round info 80%> 
- +For more information on importing, debugging, or other tools related questions, please see the [[/resources/eval/user-guides/eval-adicup360/tools/cces_user_guide |tools user guide.]] 
-[[https://github.com/analogdevicesinc/EVAL-ADICUP360/tree/master/projects/ADuCM360_demo_cn0396ADuCM360_demo_cn0396 at Github]] +
- +
 </WRAP> </WRAP>
  
 +===== Configuring the Software Parameters =====
  
-\\ +  * **Sensor Range** - <fc #008000>CO_RANGE</fc> & <fc #008000>H2S_RANGE</fc>  - maximum value of the gas concentration (ppm) that can be detected by each of the electrodes of the electrochemical gas sensor being used (//CN0396.h//). 
-===== Importing the ADuCM360_demo_cn0396 project ===== +<code> 
-\\ +    #define CO_RANGE   1000 
-The necessary instructions on how to import the **ADuCM360_demo_cn0396** project form the projects examples in the Git repository, can be found in [[resources:eval:user-guides:eval-adicup360:quickstart:eclipse_user_guide#how_to_import_existing_projects_from_the_git_repository|How to import existing projects from the GIT Repository]] page.+    #define H2S_RANGE  200 
 +</code>
  
-\\+  * **Sensor Gas Sensitivity** - <fc #008000>CO_SENS</fc> & <fc #008000>H2S_SENS</fc> - sensitivity (nA/ppm) of each of the 2 electrodes of the electrochemical sensor being used (//CN0396.h//). 
 +<code> 
 +    #define CO_SENS    (75 * pow(10, -9))  
 +    #define H2S_SENS   (800 * pow(10, -9))  
 +</code>
  
-===== Debugging the ADuCM360_demo_cn0396 project =====+  * **Maximum Sensor Gas Sensitivity** - <fc #008000>MAX_CO_SENS</fc> & <fc #008000>MAX_H2S_SENS</fc> - sensitivity (nA/ppm) of each of the 2 electrodes of the electrochemical sensor being used (//CN0396.h//). 
 +<code> 
 +    #define MAX_CO_SENS  (100 * pow(10, -9))  
 +    #define MAX_H2S_SENS (1000 * pow(10, -9)) 
 +</code> 
 + 
 +  * **Terminal refresh** - //DISPLAY_REFRESH// parameter - how often to refresh the output data - input time value in [msec] (//CN0396.h//). 
 +<code> 
 +    #define DISPLAY_REFRESH        500 
 +</code> 
 + 
 +===== Outputting Data ===== 
 + 
 +==== Serial Terminal Output ==== 
 + 
 +  - In order to view the data, you must flash the program to the EVAL-ADICUP360.   
 +  - Once complete you will need to switch the USB cable from the DEBUG USB (P14) to the USER USB (P13).   
 +  - Then follow the UART settings below with the serial terminal program. 
 +\\  
 + 
 +Following is the UART configuration. 
 +    Select COM Port 
 +    Baud rate: 115200 
 +    Data: 8 bit 
 +    Parity: none 
 +    Stop: 1 bit 
 +    Flow Control: none
 \\ \\
- * A debug configuration must be set up for this project in order to have the possibility to program and to debug the **ADuCM360_demo_cn0396** project. To do this, follow the instructions from [[resources:eval:user-guides:eval-adicup360:quickstart:eclipse_user_guide#setting_up_a_debug_configuration_for_the_project|Setting up a Debug Configuration Page.]] 
  
-        Make sure the target board is connected to the computer (via **DEBUG USB**) and using the tool bar, navigate to the small Debug icon{{:resources:eval:user-guides:eval-aducm360-ardz:quickstart:bug.png?30|}} and select the debugging session you created. The application will programmed and the program execution will stop at the beginning of the main() function. +  * The data output refreshes in the console window at the rate of the "display_refresh" parameter with the following results.
-  +
-{{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_5.png?700 |}}+
  
- * Use step-by-step execution or directly run the program+{{ :resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_demo_3.png?800 |}} 
-  + 
-After completion of the steps above the program will remain written into the system flash and it will run by default every time the board is powered up.+===== 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 [[resources:eval:user-guides:eval-adicup360:tools|Tools Overview page.]] 
 + 
 +==== Importing ==== 
 + 
 +For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup360:tools:cces_user_guide#how_to_import_existing_projects_into_your_workspace|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 [[resources:eval:user-guides:eval-adicup360:tools:cces_user_guide#how_to_configure_the_debug_session_for_an_aducm360_application|How to configure the debug session]] section.
  
-\\ 
 ===== Project structure ===== ===== Project structure =====
-\\ + 
-The **ADuCM360_demo_cn0396** project use ADuCM36x C/C++ Project structure. +The **ADuCM360_demo_cn0396** is a C project which uses 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, AD7798 control, AD5270 control and gas concentration computation.+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, AD7798 control, AD5270  and ADT7310 control; gas concentration computation.
  
-In the **src** and **include** folders you will find the source and header files related to CN0396 software  application. The //Communication.c/h// files contain SPI and UART specific data, the //AD7798.c/h// files contain the ADC control, the //AD5270.c/h// files contain the rheostat control, the //ADT73100.c/h// files contin the temp sensor control, and the //CN0357.c/h// files contain configurations and computations specific to the gas detector application.+In the **src** and **include** folders you will find the source and header files related to CN0396 software  application. The //Communication.c/h// files contain SPI and UART specific data, the //AD7798.c/h// files contain the ADC control, the //AD5270.c/h// files contain the rheostat control, the //ADT73100.c/h// files contain the temperature sensor control, and the //CN0396.c/h// files are for the gas calculations.
 \\ \\
  
-{{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_software_dir.png?nolink&340 |}} +{{:resources:eval:user-guides:eval-adicup360:reference_designs:cn0396:cn0396_software_dir.png?250 |}}
-\\ +
-In the appropriate header files you can **configure** next **parameters**: +
-\\+
 \\ \\
  
-  * **Sensor Range** - <fc #008000>CO_RANGE</fc> & <fc #008000>H2S_RANGE</fc>  - maximum value of the gas conentration (ppmthat can be detected by each of the electrodes of the electrochemical gas sensor being used (//CN0396.h//). +The **RTE** folder contains device and system related files: 
-<code> +            * **Device Folder** – contains low levels drivers for ADuCM360 microcontroller.(try not to edit these files
-    #define CO_RANGE   1000 +            * **system.rteconfig** - Allows the user to select the peripherial components they need, along with the startup and ARM cmsis files needed for the project
-    #define H2S_RANGE  100 +\\ 
-</code> +
- +
-  * **Sensor Sensitivity** - <fc #008000>CO_SENS</fc> & <fc #008000>H2S_SENS</fc> - sensitivity (nA/ppm) of each of the 2 electrodes of the electrochemical sensor being used (//CN0396.h//). +
-<code> +
-    #define CO_SENS    (75 * pow(10, -9))  +
-    #define H2S_SENS   (700 * pow(10, -9))  +
-</code> +
 \\ \\
-The **system** folder contains system related files (try not to change these files): 
-            * **ADuCM360** – contains low levels drivers for ADuCM360 microcontroller. 
-            * **CMSIS** – contains files related to ADuCM360 platform, such as: //ADuCM360.h// (registers definitions), //system_ADuCM360.c/h// (system clock), //vectors_ADuCM360.c// (interrupt vector table). 
-            * **cortexm** – contains files for system management (start-up, reset, exception handler). 
  
-\\ +// End of Document //
-  +
-{{navigation EVAL-ADICUP360#demo_cn0336|Data Acquisition for Input Current Demo#.:|Reference Designs#none}}+
resources/eval/user-guides/eval-adicup360/reference_designs/demo_cn0396.1477922920.txt.gz · Last modified: 31 Oct 2016 15:08 by Veronica Lupei