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_cn0414 [09 Nov 2018 11:52] – [Available commands] Andrei Drimbareanresources:eval:user-guides:eval-adicup3029:reference_designs:demo_cn0414 [03 Mar 2021 02:55] (current) – [Obtaining the Source Code] adding in .Hex files Brandon Bushey
Line 1: Line 1:
 ====== PLC Arduino Shield Input Demo ====== ====== PLC Arduino Shield Input Demo ======
  
-The **ADuCM_demo_cn0414** project provides a solution to control a **PLC** or **DCS** input system using the **EVAL-CN0414-ARDZ** and the **EVAL-ADICUP3029**. It uses an **ADC** with 4 differential voltage channels and 4 current channels and boasts low power **Open-Wire Detection** capabilities and **HART** communication. It has a 32kb EEPROM memory that can also be used to identify the board and is controlled via a command line interface (**CLI**).+The **ADuCM3029_demo_cn0414** project provides a solution to control a **PLC** or **DCS** input system using the **EVAL-CN0414-ARDZ** and the **EVAL-ADICUP3029**. It uses an **ADC** with 4 differential voltage channels and 4 current channels and boasts low power **Open-Wire Detection** capabilities and **HART** communication. It has a 32kb EEPROM memory that can also be used to identify the board and is controlled via a command line interface (**CLI**).
  
 ===== General Description/Overview ===== ===== General Description/Overview =====
Line 7: Line 7:
 The **ADuCM_demo_cn0414** project uses **EVAL-CN0414-ARDZ** to provide a complete, fully isolated and highly flexible, four channel analog input system. The **EVAL-CN0414-ARDZ** is suitable for programmable logic controllers (**PLC**) and distributed control system (**DCS**) applications that require multiple voltage inputs. It boasts **open wire detection** and has **HART**-compatible, 4 mA to 20 mA current inputs, all protected from transient overvoltage or overcurrent events, suitable for the most harsh industrial environments. The **ADuCM_demo_cn0414** project uses **EVAL-CN0414-ARDZ** to provide a complete, fully isolated and highly flexible, four channel analog input system. The **EVAL-CN0414-ARDZ** is suitable for programmable logic controllers (**PLC**) and distributed control system (**DCS**) applications that require multiple voltage inputs. It boasts **open wire detection** and has **HART**-compatible, 4 mA to 20 mA current inputs, all protected from transient overvoltage or overcurrent events, suitable for the most harsh industrial environments.
  
-The circuit can be divided into the following parts: the ADC, the input channels, the HART modem and the memory.  +The circuit can be divided into the following parts: the ADC, the input channels, the HART modem and the memory.
-FIXME! MAYBE LINK TO APP NOTE+
  
 The **ADC** is the core of the **EVAL-CN0414-ARDZ** shield. It is an [[adi>AD4111]] with 8 single or 4 differential voltage channels and 4 current channels. The input channels in this application are configured as 4 differential voltage channels and the current channels. The application maintains 8 internal registers, one for each channel, that are updated periodically, on a timer interrupt, with the latest conversion results. This way, on a single read, the user can have the data on a channel without waiting for a conversion. The **ADC** is the core of the **EVAL-CN0414-ARDZ** shield. It is an [[adi>AD4111]] with 8 single or 4 differential voltage channels and 4 current channels. The input channels in this application are configured as 4 differential voltage channels and the current channels. The application maintains 8 internal registers, one for each channel, that are updated periodically, on a timer interrupt, with the latest conversion results. This way, on a single read, the user can have the data on a channel without waiting for a conversion.
-FIXME! MARKS DIAGRAM+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_timer_diagram.png?nolink |Timer diagram}}
 Alternatively the user can request a burst read of up to 2000 samples returned at the ADC output data rate. Alternatively the user can request a burst read of up to 2000 samples returned at the ADC output data rate.
 The application uses the **ADCs Open-Wire Detection** capabilities for the voltage channels. When activated this option also tracks the state of the channel connection on every read and gives a warning when a channel is disconnected. The application uses the **ADCs Open-Wire Detection** capabilities for the voltage channels. When activated this option also tracks the state of the channel connection on every read and gives a warning when a channel is disconnected.
Line 29: Line 28:
     * 24V and 1A limited power supply (**optional**)     * 24V and 1A limited power supply (**optional**)
   * Software   * Software
-    * [[https://gitlab.analog.com/Platformation/EVAL-ADICUP3029/tree/cn0414_demo_dev/projects/ADuCM3029_demo_cn0414| AduCM3029_demo_cn0414 demo application]] FIXME!  -  LINK+    * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0414 | AduCM3029_demo_cn0414 demo application]]
     * CrossCore Embedded Studio (2.8.0 or higher)     * CrossCore Embedded Studio (2.8.0 or higher)
     * ADuCM302x DFP (3.2.0 or higher)     * ADuCM302x DFP (3.2.0 or higher)
Line 38: Line 37:
 ===== Setting up the Hardware ===== ===== Setting up the Hardware =====
  
-  - Connect **EVAL-CN0414-ARDZ** board to the **EVAL-ADICUP3029**.{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:eval_cn0414_ardz_hard_setup1.jpg?nolink | Hard setup 1}} +  - Connect **EVAL-CN0414-ARDZ** board to the **EVAL-ADICUP3029**
-  - Connect a micro-USB cable to P10 connector of the EVAL-ADICUP3029 and connect it to a computer.{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:eval_cn0414_ardz_hard_setup2.jpg?nolink | Hard setup 1}}+  - Set the jumpers into the position shown below. This is the standard position and only works for one board systems.{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_jumper_pos2.jpg?nolink |Standard jumper position}} 
 +  - 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:eval_cn0414_ardz_hard_setup3.jpg?nolink |Hardware setup example}}
  
 ===== Configuring the Software ===== ===== Configuring the Software =====
Line 57: Line 57:
 ===== Outputting Data ===== ===== Outputting Data =====
  
-==== Serial Terminal Output ==== +{{page>/wiki/common#serial_terminal_setup&nofooter&noheader}}
- +
-The program outputs data and **CLI** interface to a serial terminal through **UART**. +
- +
-  - In order to view the data, you must flash the program to the EVAL-ADICUP3029. +
-  - 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 +
-\\ +
-The terminal program must interpret new line as **LF** and **local echo** must be enabled.+
  
 ==== Available commands ==== ==== Available commands ====
Line 78: Line 63:
 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** or **h** after initial calibration sequence will display the list of commands and their short versions. Bellow is the short command list:
  
-^ Command                   ^ Description  +^ Command                   ^ Description 
-| //h//                  | Display available commands | +^ General commands 
-| //f//                  | Set frequency to the specified value\\ <//freq//> = value of the new frequency\\ 1Hz to 4MHz frequency is possible. +| //h//                  | Display available commands
-| //d//                  Set duty cycle to the specified value\\ <//duty//> = value of the new duty cycle\\ The duty cycle is from 0 representing 0% and 10000 representing 100%. Example: 5234 = 52.34%. | +| //stts//               | Display parameters of the application. | 
-| //r//                  | Read and display the value of the ADC | +^ Internal register commands ^ 
-| //ad//                 Activate PWM dither functionality |  +| //r//                  | Display voltage or current on the selected channel.\\ <//chan//> = channel to be shown 
-| //rd//                 Deactivate PWM dither functionality |  +| //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. | 
-| //df//                 Set dither frequency to the given value\\ <//freq//> = value of the new frequency\\ Recommended to be maximum the PWM frequency divided by 10. |  +^ HART commands ^ 
-| //da//                 Set dither amplitude\\ <//duty//> = value of the amplitude in duty cycle variation\\ Any value between 0 and 10000, same as duty cycle. Recommended to be lower than the lowest value needed for the duty cycle to be 0 or full scale. |  +| //he//                 Enable HART channel. |  
-| //ap//                 Activate PID controller |  +| //hd//                 Disable HART channel. |  
-| //rp//                 Deactivate PID controller |  +| //hcc//                Select wanted channel.\\ <//chan//> = Channel to be selected. |  
-| //kp//                 Set PID Kp constant\\ <//kp//> = value of the new Kp constant\\ From zero to maximum number represented by a 32 bit float value. |  +| //ht//                 Transmit string through HART.\\ <//string//> = string to be transmitted. |  
-| //ki//                 Set PID Ki constant\\ <//ki//> = value of the new Ki constant\\ From zero to maximum number represented by a 32 bit float value. |  +| //hg//                 Send the received buffer through UART connection. |  
-| //kd//                 Set PID Kd constant\\ <//kd//> = value of the new Kd constant\\ From zero to maximum number represented by a 32 bit float value. |  +| //hcz//                Send command zero with the specified number of FFs in the preambule.\\ <//pbsize//> = size of the preambule (no. of 0xFFs in the beginning). |  
-| //spf//                | Set PID sampling frequency\\ <//freq//> = value of the new frequency\\ Recommended to be at most equal with the dither frequency. |  +| //hpt//                Send command zero with the specified number of FFs in the preambule.\\ <//byte//> = byte to send in loop. |  
-| //sps//                | Set PID set point(hold value)\\ <//sp//> = new hold value in A or 0.01%(duty cycle)\\ From 0 to 1 amperes or from 1 to 10000 as duty cycle. |  +^ ADC commands ^ 
-| //dson//               | Set digital solenoid high |  +| //arr//                Display value of ADC register of the given address.\\ <//reg//> = address of the register. |  
-| //dsof//               Set digital solenoid low |  +| //awr//                Change value of the ADC register of the given address.\\ <//reg//> = address of the register.\\ <//val//> = new value of the register. |  
-| //pss//                | Set and activate proportional solenoid\\ <//val//> = value of the current or duty cycle\\ from 0 to 1 amperes. |  +| //ags//                | Get a specific number of samples from the given channel.\\ <//ch//> = selected chanel.\\ <//nr//> = number of channels; cannot exceed 2048. |  
-| //rst//                | Reset controller, parameters and faults |  +| //aso//                | Set sample rate.\\ <//sps//> = selected sample rate option.\\ If it is smaller than channel update rate multiplied by 80 can cause unpredictable behaviour. |  
-| //stts//               Show application status and parameters |  +| //asf//                | Set filter option.\\ <//filter//> = selected filter option. |  
-| //clb//                Run calibration sequence +| //aep//                Enable post filter. |  
 +| //adp//                | Select postfilter.\\ <//opt//> = selected postfilter option. |  
 +| //asp//                | Reset controller, parameters and faults |  
 +| //aowe//               Enable open wire detection. |  
 +| //aowd//               Disable open wire detection. |  
 +^ EEPROM commands ^ 
 +| //de//                 | Discover EEPROM I2C addresses if there are any. 
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:wiki_pic.png?nolink | Terminal example}}+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:eval_cn0414_console.png?nolink | Terminal example}}
  
  
  
-===== Obtaining the Source Code =====+===== Obtaining the Software =====
  
-We recommend not opening the project directly, but rather import it into CrossCore Embedded Studios and make a local copy in your workspace+There are two basic ways to program the ADICUP3029 with the software for the CN0414. 
 +  - Dragging and Dropping the .Hex to the Daplink drive 
 +  - Building, Compiling, and Debugging using CCES
  
-The source code and include files of the FIXME!**file_name_of_demo** can be found here:+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
  
-<WRAP round 80% download>+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.  
  
-FIXME!  -  This will be either a link to a Git repository or a pack file somewhere, but make sure this is accessible to the customer.  We want them to take our code and use it because that means they are going to use our hardware, and we get paid when that happens.+The software for the **ADuCM3029_demo_cn0414** can be found here:
  
-[[https://github.com/analogdevicesinc/EVAL-ADICUP360/tree/master/projects/ADuCM360_demo_cn0398AduCM360_demo_cn0398 at Github]]+<WRAP round 80% download> 
 +Prebuilt CN0414 Hex File 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/releases/download/Latest/ADuCM3029_demo_cn0414.hex| AduCM3029_demo_cn0414.Hex]] 
 +Complete CN0414 Source Files 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0414AduCM3029_demo_cn0414 Source Code]]
    
 </WRAP> </WRAP>
- 
- 
 ===== How to use the Tools ===== ===== How to use the Tools =====
  
Line 134: Line 129:
 ==== Project Structure ==== ==== Project Structure ====
  
-FIXME!  -  Add textpictureimagesthat describe the project structure Any software flow diagrams or decision trees can be added her to help customers understand how the applications are structures.+The program is composed of two main parts: 
 +  Board setup with initial values. 
 +  - Main process. 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_main_flowchart.png?nolink | Main flow chart}} 
 + 
 +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:cn0414_board_setup_flow.png?nolink | Board setup flow chart}} 
 + 
 +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 flagthe 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 functionalityThe 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:cn0414_process_flow.png?nolink | Process flow chart}} 
 + 
 +The flow chart below represents the way the channel registers are updatedOnly one channel is active at any one time (the channel that must be read). 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0414_update_channel_flow.png?nolink | Update channel flow chart}}
  
 // End of Document // // End of Document //
  
  
resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0414.1541760742.txt.gz · Last modified: 09 Nov 2018 11:52 by Andrei Drimbarean