This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:eval:user-guides:eval-adicup3029:reference_designs:demo_cn0503 [16 Apr 2020 16:08] – [make internal link internal] Andrei Drimbarean | resources: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 |
- | 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. | + | |
- | + | ||
- | ALL OF THE CONTENT IS PLACEHOLDER INFORMATION, | + | |
- | + | ||
- | DON'T FORGET TO CREATE A MEDIA FOLDER SPECIFIC TO YOUR DEMO FOR ANY IMAGES, FILES, OR DOCUMENTS YOU WISH TO INCLUDE. | + | |
- | </ | + | |
- | + | ||
- | ====== 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, | The **ADuCM3029_demo_cn0503** project provides a solution to get multiple liquid parameters (for example turbidity, pH, fluorescence, | ||
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 | + | {{ : |
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 **' | 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 **' | ||
Line 46: | Line 36: | ||
- Set up the the **EVAL-CN0503-ARDZ** as shown in the [[resources: | - Set up the the **EVAL-CN0503-ARDZ** as shown in the [[resources: | ||
- | - Connect the board to the **EVAL-ADICUP3029** via the Arduino headers. | + | - Connect the board to the **EVAL-ADICUP3029** via the Arduino headers. |
- | - 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. | + | - 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. |
===== 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 configuration. It 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 | + | |
- | ^ Referece | + | |
- | | internal | + | |
- | | external | + | |
- | + | ||
- | < | + | |
- | /* Reference voltage of the ADC */ | + | |
- | float vref = 2.5; | + | |
- | </ | + | |
===== Outputting Data ===== | ===== Outputting Data ===== | ||
Line 69: | Line 49: | ||
==== Available commands ==== | ==== Available commands ==== | ||
- | Typing **help** or **h** after initial calibration sequence | + | Typing **help** after the application has started |
^ Function ^ Command ^ Description ^ Example ^ | ^ Function ^ Command ^ Description ^ Example ^ | ||
- | ^ General | + | ^ Application |
- | | | //h// | Display available commands. | | | + | | | //HELP// | Display available commands. | | |
- | | | //stts// | + | | | //REG? XXX// | Read an ADPD register.\\ <// |
- | ^ Internal register commands ^ | + | | | //REG XXX YYYY// |
- | | | //r// | Display voltage or current on the selected channel.\\ <//chan//> = channel to be shown | | | + | | | //MODE?// |
- | | | //sur// | Change channel update rate.\\ < | + | | | //MODE XXXX// |
- | ^ 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// | + | | | //IDLE?// |
- | | | //hd// | + | | | //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.\\ <// | + | | | //ALRM?// |
- | | | //ht// | + | | | //DEFn? XXXX// | Query operation parameters.\\ //n// = ID of the required optical path (can be from 0 to 8).\\ //XXXX// = the operation parameter |
- | | | //hg// | + | | | //BOOT// | Perform a software reset. | | |
- | | | //hcz// | Send command zero with the specified number | + | | | //ODR?// | Query the Output Data Rate of the STREAM command. | | |
- | | | //hpt// | Send command zero with the specified | + | | | //ODR XX.XX// |
- | ^ ADC commands | + | | | //RATMASK?// | Query the active channels mask. Returns a hexadecimal 8 bit number |
- | | | //arr// | Display value of ADC 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 | + | | |
- | | | //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 |
- | | | //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// |
- | | | //aep// | Enable post filter. | | | + | | | //DEFn RFLT XX.XX// |
- | | | //adp// | Select postfilter.\\ <//opt//> = selected postfilter option. | | | + | | | //DEFn ALRM XXXX YYYY// | Set high and low alarm thresholds for instrument 2 measurements; |
- | | | //asp// | Reset controller, parameters and faults | + | | | //DEFn RATB X.XXXXX// |
- | | | //aowe// | + | | |
- | | | //aowd// | + | | | //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// | + | | | // |
+ | | | //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// | ||
+ | | | //FL_APPLY// | ||
+ | | | //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. | ||
- | {{ : | + | ===== Obtaining the Software ===== |
- | ===== Obtaining | + | There are two basic ways to program |
+ | - Dragging and Dropping the .Hex to the Daplink drive | ||
+ | - Building, Compiling, and Debugging using CCES | ||
- | We recommend not opening | + | 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 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 |
+ | |||
+ | The software for the **ADuCM3029_demo_cn0503** can be found here: | ||
<WRAP round 80% download> | <WRAP round 80% download> | ||
- | + | Prebuilt CN0503 Hex File | |
- | [[https:// | + | |
- | + | Complete CN0503 Source Files | |
- | [[| AduCM3029_demo_cn0414.HEX]] | + | |
</ | </ | ||
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. | ||
- | {{ : | + | {{ : |
+ | |||
+ | 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. | + | {{ : |
- | {{ : | + | 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). | + | {{ : |
- | {{ : | + | ==== Interacting with the CLI ==== |
+ | | ||
+ | - Use example scripts from [[https:// | ||
- | 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: |
+ | * [[resources: | ||
+ | * [[resources:eval:user-guides:circuits-from-the-lab:cn0503: | ||
+ | * [[resources: | ||
+ | * [[: | ||
// End of Document // | // End of Document // |