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-adicup3029:reference_designs:demo_cn0503 [16 Apr 2020 16:08] – [make internal link internal] Andrei Drimbareanresources:eval:user-guides:eval-adicup3029:reference_designs:demo_cn0503 [20 Sep 2022 15:25] (current) – [Hardware User Guide and Demo Guides] adding nitrate demo link Brandon Bushey
Line 1: Line 1:
-<note important> +====== Optical Platform Setup Demo (w/ EVAL-CN0503-ADRZ) ======
-THIS IS A TEMPLATE.\\ \\  +
- +
-THE GOAL IS TO CREATE A DOCUMENT CUSTOMERS WILL USE WHEN SETTING UP THEIR CFTL DEMO, SO THEY DON'T ASK YOU SO MANY QUESTIONS.  IT'S DESIGNED TO HELP YOU GET STARTED WRITING YOUR REFERENCE DEMO USER GUIDE. +
- +
-ALL OF THE CONTENT IS PLACEHOLDER INFORMATION, SO YOU WILL NEED TO POPULATE RELEVANT INFORMATION TO YOUR CFTL.  SOME(OR SEVERAL) OF THE SECTION HEADERS MAY NOT APPLY TO YOU, SIMPLY REMOVE THEM.  ALSO I MAY NOT HAVE CAPTURED EVERYTHING RELATIVE TO YOUR BOARD, SO ADDING INFORMATION IS ACCEPTABLE. +
- +
-DON'T FORGET TO CREATE A MEDIA FOLDER SPECIFIC TO YOUR DEMO FOR ANY IMAGES, FILES, OR DOCUMENTS YOU WISH TO INCLUDE.  THIS WILL HELP US KEEP THE WIKI ORGANIZED AND ENSURE YOUR CONTENT DOESN'T GET REMOVED. +
-</note> +
- +
-====== Optical Platform Demo (w/ EVAL-CN0503-ADRZ) ======+
  
 The **ADuCM3029_demo_cn0503** project provides a solution to get multiple liquid parameters (for example turbidity, pH, fluorescence, etc.) using the **EVAL-CN0503-ARDZ** and the **EVAL-ADICUP3029**. It uses a a complete multimodal The **ADuCM3029_demo_cn0503** project provides a solution to get multiple liquid parameters (for example turbidity, pH, fluorescence, etc.) using the **EVAL-CN0503-ARDZ** and the **EVAL-ADICUP3029**. It uses a a complete multimodal
Line 20: Line 10:
 The application configures the device to stimulate **LED**s and read the **PD**s in 4 time slots, each corresponding to one of the optical paths present on the board. It enables 2 ADC channels per time slot to measure the light beam before and after passing through the substance. This means that a packet of 8 samples of data come from the **ADC** once per sampling period.  The application configures the device to stimulate **LED**s and read the **PD**s in 4 time slots, each corresponding to one of the optical paths present on the board. It enables 2 ADC channels per time slot to measure the light beam before and after passing through the substance. This means that a packet of 8 samples of data come from the **ADC** once per sampling period. 
  
-FIXME add diagram+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_data_gather.png |}}
  
 The samples can then be plugged into a user defined equation that can include any of the samples and any random constant to generate a ratio, which the application defines as the **'absolute ratio'**. Before being displayed or used any further the **absolute ratio** is filtered by a **block average filter** and a **rolling average filter** to digitally increase the **SNR** and take out unwanted frequencies. The bandwidth of the **rolling average filter** can be set by the user. The samples can then be plugged into a user defined equation that can include any of the samples and any random constant to generate a ratio, which the application defines as the **'absolute ratio'**. Before being displayed or used any further the **absolute ratio** is filtered by a **block average filter** and a **rolling average filter** to digitally increase the **SNR** and take out unwanted frequencies. The bandwidth of the **rolling average filter** can be set by the user.
Line 46: Line 36:
  
   - Set up the the **EVAL-CN0503-ARDZ** as shown in the [[resources:eval:user-guides:circuits-from-the-lab:cn0503#assembling_the_mechanical_fixtures | Hardware User Guide]].   - Set up the the **EVAL-CN0503-ARDZ** as shown in the [[resources:eval:user-guides:circuits-from-the-lab:cn0503#assembling_the_mechanical_fixtures | Hardware User Guide]].
-  - Connect the board to the **EVAL-ADICUP3029** via the Arduino headers. FIXME add picture +  - Connect the board to the **EVAL-ADICUP3029** via the Arduino headers. {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_arduino.jpg |}} 
-  - Connect a micro-USB cable to P10 connector of the EVAL-ADICUP3029 and connect it to a computer. The final setup should look similar to the picture below. FIXME add picture+  - Connect a micro-USB cable to P10 connector of the EVAL-ADICUP3029 and connect it to a computer. The final setup should look similar to the picture below. {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_system_pc.jpg |}}
  
 ===== Configuring the Software ===== ===== Configuring the Software =====
  
-The configuration parameters can be found in the **config.h** file. +The **ADuCM3029_demo_cn0503** does not need any software configurationIt can be built and run as is.
- +
-**vref** - Reference voltage of the **ADC**. If the internal reference is used this value must be **2.5V**. If an external reference is used then this value must be the value of the external reference. +
-^ Referece                  ^ vref value         ^ +
-| internal                  | 2.5                | +
-| external                  | Actual reference voltage | +
- +
-<code> +
-   /* Reference voltage of the ADC */ +
-   float vref = 2.5; +
-</code>+
  
 ===== Outputting Data ===== ===== Outputting Data =====
Line 69: Line 49:
 ==== Available commands ==== ==== Available commands ====
  
-Typing **help** or **h** after initial calibration sequence will display the list of commands and their short versions. Bellow is the short command list:+Typing **help** after the application has started will display the list of commands:
  
 ^ Function ^ Command ^ Description ^ Example ^ ^ Function ^ Command ^ Description ^ Example ^
-General commands ^  ^  ^  ^ +Application commands ^  ^  ^  ^ 
-|  | //h//                  | Display available commands. |   | +|  | //HELP//                | Display available commands. |   | 
-|  | //stts//               Display parameters of the application. |  +|  | //REG? XXX//            Read an ADPD register.\\ <//XXX//> = register address in hexadecimal REG? 10A - read register 0x10A 
-^ Internal register commands ^  |  |  +|  | //REG XXX YYYY//        | Write an ADPD register.\\ <//XXX//> = register address in hexadecimal\\ <//YYYY//> = register new value in hexadecimal | REG 10A 301 - write 0x301 to register 0x10A 
-|  | //r//                  Display voltage or current on the selected channel.\\ <//chan//> = channel to be shown |  | +|  | //MODE?//               Read the data display modeReturn a 4 character code:\\ //CODE// - raw data is displayed;\\ //ARAT// - absolute ratio is displayed;\\ //RRAT// - relative ratio is displayed;\\ //INS1// - data processed for instrument 1 is displayed;\\ //INS2// - data processed for instrument 2 is displayed. |  | 
-|  | //sur//                Change channel update rate.\\ <rate> new channel update rate in Hz.\\ If it is bigger than output data rate divided by 80 can cause unpredictable behaviour. |  +|  | //MODE XXXX//           Set the data display mode.\\ //XXXX// 4 character code to describe the data display modeThe options are:\\ //CODE// - raw data is displayed;\\ //ARAT// - absolute ratio is displayed;\\ //RRAT// - relative ratio is displayed;\\ //INS1// - data processed for instrument 1 is displayed;\\ //INS2// - data processed for instrument 2 is displayed. | MODE CODE - set display mode to raw codes 
-^ HART commands ^  |  |  +|  | //STREAM X//            | Start calculating and displaying a stream of data.\\ //X// = If 0 or not present enter continuous streaming mode; if X>0 stream data for X values. | STREAM 10 - stream for 10 values of the output. 
-|  | //he//                 Enable HART channel. |  | +|  | //IDLE?//               Queries the idle condition. |  | 
-|  | //hd//                 Disable HART channel. |  +|  | //IDLE x//              If X=0 or not listed only the terminal stream is terminated, but the application continues sampling. If X=1 stop sampling altogether. | IDLE 0 - stop streaming, but keep sampling. 
-|  | //hcc//                Select wanted channel.\\ <//chan//> = Channel to be selected. |  | +|  | //ALRM?//               Query alarm status; if returned 0 no alarm is present;\\ If bit 0 of the returned value is 1 instrument 2 value is below lower threshold;\\ If bit 1 of the returned value is 1 instrument 2 value is above higher threshold. |  | 
-|  | //ht//                 Transmit string through HART.\\ <//string//string to be transmitted. |  +|  | //DEFn? XXXX//          Query operation parameters.\\ //n// = ID of the required optical path (can be from 0 to 8).\\ //XXXX// = the operation parameter to be queried. The following options exist:\\ //ARAT// = absolute ratio expression in reverse polish notation (RPN);\\ //RFLT// = the digital low pass filter bandwidth applied to the absolute ratio measurements;\\ //ALRM// = the high and low alarm threshold for the INS2 measurements;\\ //RATB// = baseline ratio used in calculating the relative ratio;\\ //INS1// = the coefficients of the fifth order polynomial used to calculate the first instrument measurements;\\ //INS2// = the coefficients of the fifth order polynomial used to calculate the second instrument measurements. | DEF0? ARAT - query the abslute ratio expression for optical path 0 
-|  | //hg//                 Send the received buffer through UART connection. |  | +|  | //BOOT//                Perform a software reset. |  | 
-|  | //hcz//                | Send command zero with the specified number of FFs in the preambule.\\ <//pbsize//size of the preambule (no. of 0xFFs in the beginning). |  +|  | //ODR?//                | Query the Output Data Rate of the STREAM command. |  | 
-|  | //hpt//                Send command zero with the specified number of FFs in the preambule.\\ <//byte//byte to send in loop. |  +|  | //ODR XX.XX//           | Sets Output Data Rate for the STREAM command.\\ //XX.XX// = The new ODR in Hz. It can have only certain values and will round down to them:\\ ODR options between 5 Hz and 0.01 Hz and can be calculated by 5/ODR = integer number. | ODR 2.5 - set output data rate to 2.5 SPS 
-^ ADC commands |  |  | +|  | //RATMASK?//            Query the active channels mask. Returns a hexadecimal 8 bit number that has 1 for every active channel and 0 for every hidden channel.\\ For example if 1 - only optical path 0 is turned on; if 3 - Optical paths 0 and 1 are turned on and the rest are hidden; etc. | | 
-|  | //arr//                Display value of ADC register of the given address.\\ <//reg//address of the register|  | +|  | //RATMASK XX//          | Set the active channels mask.\\ //XX// = New optical path mask. | RATMASK F - turn on optical paths 0, 1, 2 and 3 and leave the rest(4, 5, 6 and 7) off 
-|  | //awr//                | Change value of the ADC register of the given address.\\ <//reg//address of the register.\\ <//val//= new value of the register | +|  | //FL_HELP//             | Display the tooltip for the flash commands. |  | 
-|  | //ags//                Get a specific number of samples from the given channel.\\ <//ch//selected chanel.\\ <//nr//number of channels; cannot exceed 2048. |  +|  | //PCB-LEDn YY.Y XXX.X// | Do an automatic calibration of the specified PCB LED current so that the corresponding ADC channels returns a percentage of the saturation.\\ //n// = LED ID from the PCB.(1, 2, 3 or 4)\\ //YY.Y// = percentage of ADC saturation.\\ //XXX.X// = maximum LED current. If left not specified will default at 338 mA. | PCB-LED1 45.8 190.5 - calibrate LED 1 so that the cresponding optical path(s) return 45.8% from the ADC saturation, but limit the current to 190.5 mA. | 
-|  | //aso//                | Set sample rate.\\ <//sps//selected sample rate option.\\ If it is smaller than channel update rate multiplied by 80 can cause unpredictable behaviour.  +^  ^ DEFn args ^ Set operation parameters.\\ //n// = ID of the required optical path (can be from 0 to 8).\\ //args// = operation parameters and their new value.  ^ 
-|  | //asf//                | Set filter option.\\ <//filter//selected filter option. |  | +|  | //DEFn ARAT RPN//       Set the absolute ratio expression;\\ //RPN// = new ARAT expression| DEF0 ARAT A2A1/ - set the optical path 0 absolute ratio to be calculated as (slotA_ch2 / slotA_ch1); | 
-|  | //aep//                Enable post filter. |  | +|  | //DEFn RFLT XX.XX//     | Set the digital filter bandwidth, in Hz, used for the absolute ratio measurement;\\ //XX.XX// = new digital filter bandwidth in Hz. | DEF1 RFLT 0.5 - set the optical path 1 digital filter bandwidth to 0.5 Hz. Not all values are possible, query the parameter to get the actual value set; 
-|  | //adp//                Select postfilter.\\ <//opt//selected postfilter option. |  | +|  | //DEFn ALRM XXXX YYYY// | Set high and low alarm thresholds for instrument 2 measurements;\\ //XXXX// = new alarm high threshold;\\ //YYYY// = new alarm low threshold; DEF0 ALRM 25 15 - set optical path 0 high alarm threshold to 25 and low alarm threshold to 15; 
-|  | //asp//                Reset controller, parameters and faults |  | +|  | //DEFn RATB X.XXXXX//   | Set baseline ratio for to calculate relative ratio of the signal path;\\ //X.XXXXX// = new baseline ratio| DEF2 RATB 2.3 - set the baseline ratio as 2.3 for signal path 2; | 
-|  | //aowe//               Enable open wire detection. |  | +|  | //DEFn INS1 X.XXE+XX Y.YYE+YY ...// | Set the fifth order polynomial coefficients for calculating instrument 1, ordered from lowest to highest power; | DEF0 INS1 0 1 0.54 1.23e+0 5.48e-4 44.22 - set coefficients for optical path 0; 
-|  | //aowd//               Disable open wire detection. |  | +|  | //DEFn INS2 X.XXE+XX Y.YYE+YY ...// | Set the fifth order polynomial coefficients for calculating instrument 2, ordered from lowest to highest power; | DEF4 INS2 0 1 0.54 1.23e+0 5.48e-4 44.22 - set coefficients for optical path 4; | 
-^ EEPROM commands ^  |  |  +^ Flash commands ^  ^  ^  ^ 
-|  | //de//                 Discover EEPROM I2C addresses if there are any. |  |+|  | //FL_CLEARBUF//  | Clear the software buffer. |  | 
 +|  | //FL_LOAD X//    Load the software buffer with data from flash configuration page.\\ //x// = 0 to load from User Update page; 1 to load from the Manufacture Default page. |  | 
 +|  | //FL_PROGRAM X// | Program the flash configuration page with data from the software buffer.\\ //x// = 0 to program the User Update page; key to program the Manufacture Default page. |  | 
 +|  | //FL_ERASE X//   Erase the flash configuration page.\\ //x// = 0 to erase the User Update page; key to erase the Manufacture Default page. |  | 
 +|  | //FL_APPLY//     Settings currently in the software buffer are applied to the application and device. |  | 
 +|  | //FL_WRITE CMD// | Save a specific device or application parameter into the software buffer.\\ //cmd// = register or application command to input the relevant parameter.\\ For register commands the buffer contains an array of register-value pairs that will be written in order to the device. Calling this function with a register command will add a new register-value pair at the end of the array.\\ The only application command supported by this command is the def command. Calling the DEF command will update that value into the software buffer. It can be later applied to the application. | FL_WRITE REG 10A 3355 - write the register 0x10A to the value 0x3355.\\ FL_WRITE DEF2 RFLT 0.01 - set filter bandwidth of ration 2 to 0.01Hz 
 +|  | //FL_READ CMD//  Read a specific device or application parameter value from the software buffer.\\ //cmd// = register or application command to input the relevant parameter.\\ For register commands the buffer contains an array of register-value pairs that will be written in order to the device. Calling this function with a regiter command will display the value of the first occurrence of the register.\\ The only application command supported by this command is the def command. Calling the DEF command will read that value from the software buffer. | FL_READ REG? 10A - return the first value of the register 0x10A\\ FL_READ DEF2? RFLT - display the setting of the ration 2 filter bandwidth from the software buffer. |
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:eval_cn0414_console.png?nolink | Terminal example}}+===== Obtaining the Software =====
  
-===== Obtaining the Source Code =====+There are two basic ways to program the ADICUP3029 with the software for the CN0503. 
 +  - Dragging and Dropping the .Hex to the Daplink drive 
 +  - Building, Compiling, and Debugging using CCES
  
-We recommend not opening the project directly, but rather import it into CrossCore Embedded Studios and make local copy in your workspace+Using the drag and drop method, the software is going to be version that Analog Devices creates for testing and evaluation purposes This is the EASIEST way to get started with the reference design
  
-The source code and include files of the **ADuCM3029_demo_cn0414** can be found here:+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_cn0503** can be found here:
  
 <WRAP round 80% download> <WRAP round 80% download>
- +Prebuilt CN0503 Hex File 
-[[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0414AduCM3029_demo_cn0414 at Github]] +  [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/releases/download/Latest/ADuCM3029_demo_cn0503.hexAduCM3029_demo_cn0503.Hex]] 
- +Complete CN0503 Source Files 
-[[| AduCM3029_demo_cn0414.HEX]]+  [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0503| AduCM3029_demo_cn0503 Source Code]]
    
 </WRAP> </WRAP>
Line 131: Line 121:
  
 The program is composed of two main parts: The program is composed of two main parts:
-  - Board setup with initial values.+  - Initialization routine.
   - Main process.   - Main process.
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_main_flowchart.png?nolink Main flow chart}}+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_main.png |}} 
 + 
 +The platform initialization includes the carrier clock and power initialization as well as initialization for **DMA**, **GPIO**, **SPI**, **I2C**, **UART** and **flash** cores. Then the program initializes the ADPD device driver with default values and applies this configuration to the chip. After this it will perform the clock calibration for the ADPD device and will apply the configuration saved in the flash pages in the following order: manufacturer page and user page. If the manufacturer page is not initialized it will initialize it. Applying the user page after the manufacturer default will only change the specific configurations mentioned in the user page, leaving the rest untouched.
  
-Board setup initializes **UART**, **SPI** and **I2C** communication and verifies if there is an active **EVAL-CN0414-ARDZ** board connected by reading the AD4111 ID register. Here is also initialized the update timer for the internal channel registers.+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_intialization.png |}}
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_board_setup_flow.png?nolink | Board setup flow chart}}+The main process of the application runs into a loop and is responsible for taking data out of the device and displaying it and for implementing the user **CLI** using the serial **UART** interface.
  
-The main process routine implements the **CLI** and calls the commands input by the user. This routine also checks the flags asserted in the asynchronous events (the update channel register flag, the HART received flag and the floating channel flags) and calls the appropriate handler methods. There is also a flag asserted by the channel register update rate and the **ADC** output data rate. If the update rate would be too close to the output data rate, the actual update rate might slow down to be possible for the program to maintain all functionality. The update rate may never be bigger or equal to the **ADC** output data rate divided by 8 (for 8 channels).+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0503_main_process.png |}}
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_process_flow.png?nolink Process flow chart}}+==== Interacting with the CLI ==== 
 +  Run commands directly from putty 
 +  - Use example scripts from [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0503/scripts|this folder]] and see the [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/blob/master/projects/ADuCM3029_demo_cn0503/scripts/README.md|readme file]] to learn how to use them.
  
-The flow chart below represents the way the channel registers are updated. Only one channel is active at any one time (the channel that must be read).+===== Hardware User Guide and Demo Guides =====
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_update_channel_flow.png?nolink Update channel flow chart}}+  * [[resources:eval:user-guides:circuits-from-the-lab:cn0503|EVAL-CN0503-ARDZ Hardware User Guide]] 
 +  * [[resources:eval:user-guides:circuits-from-the-lab:cn0503:fluorescence|Optical Platform: Fluorescence Measurement Demo (ADICUP3029 + EVAL-CN0503-ADRZ)]] 
 +  * [[resources:eval:user-guides:circuits-from-the-lab:cn0503:colorimetry|Optical Platform: pH Measurement Demo (ADICUP3029 + EVAL-CN0503-ADRZ)]] 
 +  * [[resources:eval:user-guides:circuits-from-the-lab:cn0503:turbidity|Optical Platform: Turbidity Measurement Demo (ADICUP3029 + EVAL-CN0503-ADRZ)]] 
 +  * [[:resources:eval:user-guides:circuits-from-the-lab:cn0503:nitrate-measurement|Optical Platform: Nitrate Measurement Demo (ADICUP3029 + EVAL-CN0503-ADRZ)]]
  
 // End of Document // // End of Document //
resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0503.1587046120.txt.gz · Last modified: 16 Apr 2020 16:08 by Andrei Drimbarean