Home

EARTH PEOPLE TECHNOLOGY (EPT), Inc

image

Contents

1. Organize v Open with Burn New folder di ip Name j Date modified Type Size nios2eds amp itk34 dll 11 7 20126 55 PM Application extens 43 KB dJi quat itk34 pdb 3 3 2009 5 16 PM Program Debug D 187 KB D jam2 jam 7 2012 8 26 PM JAM File 265 KB di bin64 _ jam2 icjam 7 2012 8 26PM JAMFile 264 KB J common jtag_atlantic dll 11 7 2012 8 26 PM Application extens 17 KB k cnp amp jtag client dll 7 2012 8 26 PM Application extens 131 KB di drivers jtag hw mbftdi blaster dll 1 26 2013 4 00 PM Application extens 60 KB di dsp_builder jtag_hw_pli blaster dll 11 7 2012 8 26 PM Application extens 26 KB Ji eda amp jtag_hw_usb blaster dll 7 2012 8 26PM Application extens 15 KB bo extibs32 amp jtag_hw_virtual_chain dll 11 7 2012 8 26PM Application extens 27 KB bb libraries 2 jtag pli blaster vpi dll 11 7 20128 26 PM Application extens KB d Imf E jtagconfig exe 11 7 20128 26 PM Application 2 KB di designs 1 jtagserver exe 11 7 2012 8 26PM Application 192 KB sopc builder amp liblzma dll 7 2012 6 56 PM Application extens 132 KB HD altera inspectorlogzip Imgrd exe 2 1 2010 5 42PM Applicat 1 360 KB Mo RS NES LS LDM 527 VD jtag hw mbftdi blaster dll Date modified 1 26 2013 4 00 PM Date created 2 10 2013 4 21 PM c Application extension Size 59 5 KB The DLL is installed and the JTAG server should recognize it Go to the section Programming the
2. c c T Active block vqm Active transfer vqm Active trigger vqm Active transfer library vqm eptWireOr v mem array v read control logic v write control logic v EPT 570 AP M4 Top v Category General Files Libraries 4 Operating Settings and Conditions Voltage Temperature 4 Compilation Process Settings Early Timing Estimate Incremental Compilation Physical Synthesis Optimizations 4 EDA Tool Settings Design Entry Synthesis Simulation Formal Verification Board4 evel 4 Analysis amp Synthesis Settings VHDL Input Verilog HDL Input Default Parameters Fitter Settings TimeQuest Timing Analyzer Assembler Design Assistant SignalTap II Logic Analyzer Logic Analyzer Interface PowerPlay Power Analyzer Settings SSN Analyzer B as Select the design files you want to indude in the project Click Add All to add all design files in the project directory to the project File name Add echnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src write control logic v Verilog HDL File Technology EPT USB CPLD Development System CD Projects_HDL EPT_Transfer_Test src read_control_logic v Verilog HDL File Remove fechnology EPT USB CPLD Development System CD Projects_HDL EPT_Transfer_Test src mem_array v Verilog HDL File echnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src eptWireOR v Verilog HDL File Up fechno
3. endif timescale ins ips Module Declaration f e t e ette eo the thtet tete hethtet tuve h htt stbtevett eots e te tev t tevec PF Go iilii d module ept EPMS70 Transfer Test top wire 22 3 1 0 input wire 1 0 aa input wire 1 0 be in a active transfer library 88 be in bc out bd inout UC IN UC OUT TEST SIGNAL 1 STATE OUT TEST BUS ENDPOINT STATE OUT ENDPOINT TEST BUS uc out m EPT LIBRARY TOP INST aa bc in bc out bd inout UC IN UC OUT data byte ready ft 245 state machine register decode endpoint registers state endpoint write to host eptWireOR N wireOR UC OUT uc out m T active trigger uc Elk ACTIVE TRIGGER INST CLK 66 A EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual The interface from the library to the user code is two uni directional buses UC_IN 22 0 and UC OUT 20 0 The UC IN 22 0 bus is an output bus from the library input bus to the Active Modules that is used channel data address length and control information to the Active Modules The UC OUT 21 0 bus is an input bus to the library output bus from the Active Modules that is used to communicate data address length and control information to the Active Modules The control buses aa 1 0 bc in 1 0 bc out 2 0 and bd 1nout 7 0 are used to channel data and control si
4. Block Controls Block Send Block LoopBack Block Receive BLOCK amp Repititions J a 56 BLOCK16 5 iie a Stop Ra Address 4 Length Bytes Transferred Press the PCB switches on the EPT 570 AP to view the Switch Controls in action 7 The Development Process There is no standard for developing embedded electronics The best method is the one that works for the user These methods can range from a top down approach where the design is written down first and all code is written then compile execute and test Or a bottom up approach can be pursued where a small piece of the project is assembled and verified i e I2C communication to a sensor Then the next piece is assembled and verified i e collect sensor data in a storage buffer and connected to the first And so on until the whole design is complete Or you could use any combination of these two extremes 7 1 Designing a Simple Data Collection Sampler The Data Collection Sampler is a very simple introductory project that will guide the user in the creation of an overall design using the Arduino Programming Language Verilog HDL and C Language These elements will run on the Arduino Platform EPT 570 AP M4 CPLD and a Windows 7 PC respectively Page 100 f EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual bh baee OEE HSER TE 4 TT OT TT TT embed dama titi Hil The first order of business is to layout the desig
5. MessageBox Show message return 6 y Register the read callback function RegisterCallBack btnOpenDevice Enabled false btnCloseDevice Enabled true return 6 Next the callback function 1s populated This function will be called from the Active Host dll When the EPT Device has transferred data to the PC the callback function will do something with the data and command Page 138 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Actual callback function which will read messages coming from the EPT device unsafe void EPTReadFunction Int32 device id Int32 device channel byte command byte payload i byte message data Select current device EPT AH SelectActiveDeviceByIndex device id Add command and device channel to the receive object EPTReceiveData Command command amp COMMAND DECODE gt gt 3 EPTReceiveData Address device channel Check if the command is Block Receive If so use Marshalling to copy the buffer into the receive abject if EPTReceiveData Command BLOCK OUT COMMAND i EPTReceiveData Length data size EPTReceiveData cBlockBuf new Byte data size Marshal Copy new IntPtr message EPTReceiveData cBlockBuf 6 data size T else i EPTReceiveData Payload payload EPTParseReceive H Because the callback function communicates directly with the dll and must pass pointers from the dll to the C marshaling must be use
6. Next we are ready to compile and synthesize 7 1 9 CPLD Compile Synthesize the Project The Quartus II application will compile synthesize the user code active transfer library and the active EndTerms The result of this step 1s a file containing the CPLD code with pof First we need to create a project in the Quartus II environment Follow the directions in the section Compiling Synthesizing and Programming CPLD Bring up Quartus II then use Windows Explorer to browse to c altera xxx quartus qdesigns create a new directory called EPT Data Collector Page 123 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual c Open Quartus II by clicking on the icon css Under Quartus Select File gt New Project Wizard The Wizard will walk you through setting up files and directories for your project New Project Wizard Directory Name Top Level Entity page 1 of 5 What is the working directory for this project C altera 12 1sp1 quartus qdesigns EPT Data Collector What is the name of this project EPT 570 AP U2 Top What is the name of the top evel design entity for this project This name is case sensitive and must exactly match the entity name in the design file EPT 570 AP U2 Top Use Existing Project Settings EI EI EED Ge At the Top Level Entity page browse to the c altera xxx quartus qdesigns EPT_Data_Collector directory to store your project
7. USB CPLD Development System User Manual G gt fr Date modified Type T Name od f Arduino Data Collector Codeino 10 23 2012831 AM INO File Recent Places Desktop a me L Libraries pe Arduino Data Col File Edit Sketch Tools Help Arduino_Data_Collector_Code Earth People Technology Inc Data Collector Random Seed Platform Uno int count 0 int ledPin 13 void setup DDRD B11111111 Set Port D as outputs PORTD Bllllllll Turn on Port D pins pinMode 0 OUTPUT pinMode ledPin OUTPUT Arduino Uno on COMAS e Click the Verify button Arduino Data Collector i Sa File Edit Sketch Tools Help o Verify Arduino Data Collector Code ik Earth People Technology Inc Data Collector Random Seed Platform Uno int count 0 int ledPin 13 void setup DDRD B11111111 Set Port D as outputs PORTD Bllllllll Turn on Port D pins pinMode A0 OUTPUT pinMode ledPin OUTPUT 3 cmd TA Re Arduino Uno on COMAS e The sketch will compile Page 108 E93 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual e If there are no errors the compiling will complete successfully Arduino Lina on COMME Now we are done with compiling and ready to program the Arduino 7 1 6 Programming the Arduino Programming the Arduino is the process of downloading the
8. gt BE Ritter 61 76 80 0 4 p La TimeOuest Timing Analyzer newe Se Cee E v9 4 i Compile Design v M Analysis amp Synthesis P gt Fitter Place amp Route v v B Assembler Generate programming files O0 M TimeQuest Timing Analysis of M EDA Netlist Writer 3 Program Device Open Programmer m AN DJ a a P lt lt Search gt gt Type ID Message 0h x gt WD 332146 Worst case recovery slack is 7 215 b qp 332146 Worst case removal slack is 2 495 gt dp 332146 Worst case minimum pulse width slack is 7 309 dp 332001 The selected device family is not supported by the report metastability command d 332102 Design is not fully constrained for setup requirements qp 332102 Design is not fully constrained for hold requirements gt WD Quartus II 64 Bit TimeQuest Timing Analyzer was successful 0 errors 5 warnings M WD 293000 Quartus II Full Compilation was successful 0 errors 41 warnings Lj Messages m V System A Processing 101 If the synthesis fails you will see the failure message in the message window Note that in addition to fatal errors the compile process can produce warnings which do not necessarily prevent execution of the code but which should be corrected eventually At this point the project has been successfully compiled synthesized and a pro
9. lt ewes gt lt ewes 5 evre 5 Figure xx Active Block To Host Timing 15 15 ns CLOCK 66 MHz l esc 7 15 15 ns 1080 ns H TRANSFER_RECEIVED 15 15 ns i 1110 ns Ans 30 3n TRANSFER TO DEVICE RE Figure xx Active Block To Device Timing 5 Compiling Synthesizing and Programming CPLD ANU S RYA ex OUARTUS I The CPLD on the EPT 570 AP M4 can be programmed with the Active Transfer Library and custom HDL code created by the user Programming the CPLD reguires the Page 49 EARTHPEODPLE TECHNOLOGY USB CPLD Development System User Manual use of the Quartus II software and a standard USB cable There are no extra parts to buy just plug in the USB cable Once the user HDL code is written according to the syntax rules of the language Verilog and VHDL it can be compiled and synthesized using the Quartus II software This manual will not focus on HDL coding or proper coding techniques instead it will use the example code to compile synthesize and program the CPLD 5 1 Downloading and Installing Quartus The first thing to do in order build a project in Quartus 1s to download and install the application You can find the latest version of Quartus at https www altera com download dnl index jsp Click on the Download Windows Version ND 8 RYAN MEASURABLE ADVANTAGE XY ARS EY ton gt Download Center Documentation amp myAltera Logout Y End Markets Technology Trai
10. In the window on the left go to Projects and Solutions Locate the Show advanced build configurations check box Check the box c B TN OER o EE b Environment Projects location f a Projects and Solutions c users nelsonstrfgr documents visual studio 2010 Projects m General f Build and Run e Cu m EP Tot 7 c users nelsonstrfgr documents visual studio 2010 Templates ProjectTemp m gt Debugging User item templates location gt Database Tools c users nelsonstrfgr documents visual studio 2010 Templates ItemTemplat m gt Text Templating gt Windows Forms Designer Always show Error List if build finishes with errors achitadi aa Explorer Always show 56 Save new projects when created Warn user when the project location is not trusted E Show Output window when build starts Prompt for symbolic renaming when renaming files Go to Build gt Configuration Manager Page 131 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 4 E Dz a Co ector File Edit View Refactor Project Build Debuc he a GR ass S Rebuild Solution M Publish Data Collector Ay Solution Explorer Form1 cs Design od Solution Data Collector 1 project Parameters 4 amp Data Collector public const byte TRIGGER OUT COMMAND E Properties public const byte TRANSFER OUT COMMAND public const byte BLOCK OUT COMMAND x QUIE gay xoajool gt lt j References EE acti
11. TECHNOLOGY Control Panel Home 8 View basic information Hy Device Manager Windows edition Mj Remote settings System protection el Advanced system settings Service Pack 1 Get more features with a new edition of Windows 7 System Manufacturer Model Rating Processor System type 64 bit Operating System rowers sfere Dut is available for this Display Gateway support Website Computer name domain and workgroup settings Computer name See also Full computer name Action Center Windows Update Computer description Workgroup Performance Information and Tools Windows activation Windows 7 Home Premium Copyright 2009 Microsoft Corporation All rights reserved USB CPLD Development System User Manual about your computer Gateway X2370 ff Windows Experience Index AMD A8 3820 APU with Radeon tm HD Graphics 2 50 GHz B usable Gateway D S Online support Gateway DkTp A8 Change settings Gateway DkTp A8 WORKGROUP First we need tell C Express to produce 64 bit code if we are running on a x64 platform Go to Tools gt Settings and select Expert Settings c EPT Transfer Te File Edit View Project Build Debug Data Tools Window Help AA Sddlis aala HIE amp al TF oF l zz E tj B c Program cs T Connect to Database Code Snippets Manager Choose Toolbox Items A a 2t ic orer R 3 ae GY Extensi
12. Choose homegroup and sharing options Adjust screen resolution Hardware and Sound Clock Language and Region View devices and printers A B Addad v Change keyboards or other input methods p Ease of Access k rograms Let Windows suggest settings i Uninstall a program Optimize visual display Click on System 9 Control Panel System and Security v Search Control Panel Control Panel Home Action Center System and Security Review your computer s status and resolve issues lj Change User Account Control settings Network and Internet Troubleshoot common computer problems Restore your computer to an earlier time Hardware and Sound Windows Firewall Programs Check firewall status Allow a program through Windows Firewall User Accounts and Family Safety j System Appearance and w View amount of RAM and processor speed Check the Windows Experience Index ive AR Allow remote access Seethe name of this computer Device Manager Clock Language and Region m Windows Update Ease of Access Turn automatic updating on or off Checkforupdates View installed updates Power Options Require a password when the computer wakes Change what the power buttons do Change when the computer sleeps Backup and Restore Back up your computer Restore files from backup Windows Anytime Upgrade Get more features with a new edition of Windows 7 Check under System NS ystem type Page 80 EARTHPEOPLE
13. EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual EARTH PEOPLE TECHNOLOGY Inc USB CPLD DEVELOPMENT SYSTEM FOR THE ARDUINO MEGA User Manual The EPT USB CPLD development system provides an innovative method of developing and debugging programmable logic code It also provides a high speed data transfer mechanism between an Arduino board and a host PC The EPT USB CPLD development system provides a convenient user friendly work flow by connecting seamlessly with Altera s Quartus II software The user will develop the code in the Quartus environment on a Windows Personal Computer The programmable logic code is loaded into the CPLD using only the Quartus Programmer tool and a standard USB cable The Active Host SDK provides a highly configurable communications interface between Arduino and host It connects transparently with the Active Transfer Library in the CPLD code This Active Host Active Transfer combination eliminates the complexity of designing a USB communication system No scheduling USB transfers USB driver interface or inf file changes are needed The EPT USB CPLD development system is a unique combination of hardware and software Circuit designs software and documentation are copyright 2012 Earth People Technology Inc Microsoft and Windows are both registered trademarks of Microsoft Corporation Altera is a trademark of the Altera Corporation All other trademarks referenced herein are the proper
14. Type in a name for your project EPT 570 AP M4 Top Follow the steps up to Add Files At the Add Files box click on the Browse button and navigate to the project Data Collector install folder in the dialog box Browse to the Wrojects HDIAEPT 570 AP Data Collector EPT_570_AP_M4_Top folder of the EPT USB CPLD Development System CD Copy the files from the sre directory Active transfer vqm Active trigger vqm Active transfer library vqm eptWireOr v EPT 570 AP M4 Top v Page 124 E95 EARTIHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Add the files _ Settings EPT_570_AP_M4 Top EE UND c ms Genera Files Libraries Select the design files you want to include in the project Click Add All to add all design files in the project directory to the project 4 Operating Settings and Conditions Voltage File name uus d Temperature 4 Compilation Process Settings File Name Type Library Design Entry Synthesis Tool HDL Version U pert Early Timing Estimate fsrc eptWireOR v Verilog HDL File Default Incremental Compilation src EPT 570 AP M4 Top v Verilog HDL File Default Physical Synthesis Optimizations srcfactive trigger vqm Verilog Quartus Mapping File 4 EDA Tool Settings srcfactive transfer library vqm Verilog Quartus Mapping File Design Entry Synthesis srcfactive transfer vqm Verilog Quartus Mapping File Simulation Board Level 4 Analysis amp Synthesis S
15. When the wizard completes the C Express main window will look like the following Page 129 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual using system using System Drawing using System Collections using System Windows Forms using System Data using System Threading using System Runtime InteropServices using System Diagnostics Elnamespace Data Collector 1 E public partial class Data Collector System Windows Forms Form 1 l E public Data Collector dcs These statements setup the namespace and the class for the project There are several other files that are created by the wizard such as Form1 Designer cs Program cs Forml resx We don t need to go into these support files we will just focus on the Forml cs as this is where all the user code goes The project environment must be set up correctly in order to produce an application that runs correctly on the target platform Visual C Express defaults new projects to 32 bits If you OS is a 64 bit platform use the following directions to set up a 64 bit project First we need tell C Express to produce 64 bit code if we are running on a x64 platform Go to Tools gt Settings and select Expert Settings File Edit View Project Build Debug Data Tools Window Help T G i g p 33 Al 4 us Connect to Database EPT 570 AP Data Collector JA F EF SI Ad Solution Explorer vn nm Cod
16. 12 1 Build 177 Introduction Welcome to the Altera Installer The Altera Installer guides you through the process of installing Altera software To continue click Next For more information about Altera software go to the Design Software Support website ATERN For technical support go to the www altera com mysupport website x For online documentation on software installations click here For Altera Installer command line options click here Introduction Allow Altera Installer to report statistics to Altera to improve quality Click the checkbox to agree to the license terms Then click Next G Altera Installer 12 1 Build 177 D Erm End User License Agreement To continue installing the software you must agree to the terms of the software license agreement below This document contains three separate licensing agreements identified as LICENSE TXT FILE for Nios II v12 1 EDS MegaCore Function License Agreement and Quartus II Version 12 1 Standard License Agreement Acceptance of the terms and conditions of this document serves as an acceptance of each of the three licensing agreements as i if they were individually and separately accepted The terms and conditions of each of the three separate licensing agreements in this document is deemed to be the terms and conditions of a standalone licensing agreement and governs its respective licensing agreement without modifying the ter
17. 188 transfer out detect l b0 189 end 190 else 191 H begin 192 if transfer to device reset 143 transfer out detect 1 BD 194 else 1f TRANSFER OUT EN 195 H begin 196 transfer out byte TRANSFER OUT BYTE 197 transfer out detect 1 bl 198 end 193 end 200 end 201 202 jf f 203 T Reset transfer to device reset 04 jf f 205 always 8 posedge CLE 66 or negedge reset 206 begin 207 if reset 208 begin 209 transfer to device reset lt 1 b0 210 end 211 else 212 begin 213 if transfer out detect 214 transfer to device reset lt l bi d15 else 216 transfer to device reset lt 1 b0 217 end 216 end To receive a byte the Active Host will send a byte using it s dll The user code must monitor the transfer_received port The transfer_received port will assert high for one clock cycle 66 MHz when a byte is ready for reading on the transfer_to_device port User code should use an asynchronous always block to detect when the Page 44 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual transfer received port is asserted Upon assertion the user code should read the byte from the transfer to device port into a local register 0 ff 2 2 2 2 1 l Transfer to Host z jf f always posedg
18. 22 JY 818 start transfer block out reg 813 transfer received block in rcv 821 transfer ready block byte ready 823 uc addr 3 h4 824 uc length BLOCK COUNT 8 826 transfer to host block out byte 827 transfer to device block in data 829 STATE OUT block state out 830 IEST BUS block out test bus 832 j To send a block it s best to have buffer filled in a previous transaction Then assert the start_transfer bit This method is opposed to collecting and processing data bytes after the start_transfer bit has been asserted and data is being sent to the Host Once the buffer to send is filled with the requisite amount of data the address and buffer length should be written to the uc_addr and uc_length ports Set the start_transfer bit high the user code should monitor the transfer_ready port At the rising edge of the transfer_ready port the byte at transfer_to_host port is transferred to the USB chip Once this occurs the user code should copy the next byte in the buffer to transfer to host port On the next rising edge of transfer ready the byte at transfer to host will be transferred to theUS B chip This process continues until the number of bytes desicribed by the uc length have been transferred into the USB chip Page 46 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 542 jf f 543 Registers to start Block Transfer Out
19. 544 j f 245 always posedge CLE 66 or negedge RST 346 begin 547 if RST 54H begin 549 block out reg lt 1 hb0 550 start block transfer reg lt 1 b0 Fal end 552 else HS begin 354 itf start block transfer amp start block transfer reg Og start block transfer reg lt 1 bl 5226 else if start block transfer reg amp block out reg aaf i begin 558 block out reg lt 1 b1 559 end 560 else if block out counter gt BLOCK COUNT 8 sel 4 begin 562 block out reg lt 1 bO 563 Start block transfer reg lt 1 bO 564 end 565 end 566 end 567 568 j f 569 Data for Block Transfer Out 570 j f G71 always posedge CLK 66 or negedge RST 572 begin 573 if RST add imi begin j ads block out counter lt D tn e 3 aif else 578 I begin 57 if block byte ready 280 begin 361 block out counter lt block out counter i dl 582 end 5083 else 1f block out counter gt BLOCK COUNT 8 584 fF begin 585 block out counter lt 0 586 end 587 end 288 end Page 47 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual To receive a buffer from the Host the user code should monitor the transfer_received port for assertion When the bit is asserted the next rising edge of transfer_ready will indicate
20. EventArgs e i EPT AH CloseDeviceByIndex device index btnOpenDevice Enabled true btnCloseDevice Enabled false lblDeviceConnected Text Application Exit l private void btnCancel Click object sender EventArgs e i EPT AH CloseDeviceByIndex device index btnOpenDevice Enabled true btnCloseDevice Enabled false lblDeviceConnected Text Application Exit 4 This is all that is needed for the Data Collector project The Arduino will generate a random 8 bit word It then transmits that word to the CPLD using the AO WRITE_ENABLE signal The CPLD transmits the 8 bit word to the PC using the ACTIVE TRANSFER module of the Active_Transfer Library The dll reads the 8 bit word into local memory It then calls the Callback function EPTReadFunction The 8 bit is finally displayed to screen using the MessageBox Show 7 1 13 PC Compiling the Active Host Application Building the Data_Collector project will compile the code in the project and produce an executable file It will link all of the functions declared in the opening of the Data_Collector Class with the Active Host dll The project will also automatically link the FTD2XX dll to the object code Follow section Assembling Building and Executing a NET Project on the PC Browse to the Projects_ActiveHost_xxBit EPT_Data_Collector Data_Collector folder of the EPT USB CPLD Development System CD Copy the following files into the project e Active transfer
21. Four 74LVC245 bidirectional voltage translator bus transceiver 32 user Input Outputs Four Green LED s accessible by the user Two PCB switches accessible by the user All connectors to stack into the Arduino 2560 Mega Two 13x2 connectors for accepting the FT2232H Mini Module Page 8 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual EPT 570 AP M4 OVERVIEW TI USB DP USB INTERFACE LEVEL HEADER TO ACTIVE HOST EET TRANSLATOR TO ARDUINO 3 3V TRANSLATOR SN74LVC4245A 8 PIN te VBUS TO 5V 5V TO 3 3V CR POWER POWER SUPPLY SUPPLY BSCILLATOR bud oT ALTERA E 8 BIT BUS prev 8 BIT 5V COMPATIBLE HEADER LEVEL TRANSLATOR D DIR 3 5 E oon e 8 BIT BUS 8 BIT 5V COMPATIBLE HEADER LEVEL TRANSLATOR PR 4 O SWITCHES ZZZ Page 9 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 1 2 1 High Speed USB Communications The EPT 570 AP M4 USB CPLD Development system connects an FT2232H Dual High Speed USB 480 Mbits sec chip to the CPLD The CPLD uses a dedicated channel on the FT2232H for high speed transfers to the PC Using the EPT Active Transfer Library sustained speeds of 8 Mbytes sec can be achieved The transfers are bi directional 1 2 2 Inputs and Outputs There are 32 Inputs Outputs which are 5 Volt tolerant The I O s are organized as three 8 bit directional ports Each port must be defined as input or output This means that all 8 bits of a
22. MAX V ModelSim Altera Starter Edition Free gt Summary Click Next to accept the defaults Page 55 A EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Altera Installer 12 1 Build 177 ele Installation Please wait while the Altera software is installed E Downloading Quartus II Web Edition Free includes Nios II EDS I 1 Products Downloaded Installed 4 Quartus II Web Edition Free includes Nios II EDS Quartus II Web Edition Free includes Nios II EDS Quartus II software 64 bit Arria II GX Cyclone II Cyclone II III LS Cyclone IV E Cyclone IV GX Cyclone V Legacy Families MAX II MAX V ModelSim Altera Starter Edition Free Start Quartus II 12 1 _ Get Quartus II Subscription License Create Desktop Shortcuts Quartus II Web Edition Free and Nios II SBT Nios II GCC4 Toolchain ModelSim Altera Starter Edition Free Installation L Rate your installation experience lt Back ren Cancel Wait for the download to complete The file is 3 5 GB so this could take a couple of hours depending on your internet connection When installation is complete the following window appears P Installation Please wait while the Altera software is installed Installation successful 200 Products Downloaded Installed AERA 4 Quartus II Web Edition Free includes Nios II EDS Quartus II
23. Save Selected Items As Save All Ctrl Shift S Export Template Page Setup Print Ctrl P Recent Files Recent Projects and Solutions At the New Project window select the Windows Forms Application Then at the Name box type in EPT_Transfer_Test Sort by Default 1 ER Search Installed Templates Installed Templates y T Visual C 2 ype Visua dg Windows Forms Application Visual C A project for creating an application with a WPF Application TE Sy ET Er Windows Forms user interface se Console Application Visual C et Class Library Visual C WPF Browser Application Visual C cil Empty Project Visual C EPT_Transfer_Test The project creation is complete Page 78 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual File Edit View Project Debug Data Tools Window Help gt o eme EPT Transfer Test Project Properties SS amp od Solution EPT Transfer Test 1 project d s Al El rd i rd LEM 3EPT Transfer Test G A za Properties Sj References Project File EPT Transfer Test csproj ES Formi cs Program cs Gi Solution Explorer K ar ET The name of the file containing build configuration and other information about t folder The default location is c Users lt Users Name gt documents visual studio 2010 Projects Organize v New folder b MEER Date modified Type gt ActiveHost 1 0 0
24. amp New Ctrl n a Open Cti o Close Ctrl F4 i New Project Wizard E Open Project Ctrl J Save Project Close Project Download ll Save Ctrl s Save As Save All Ctrl Shift S File Properties Create Update gt Export AQ Page Setup ILA Print Preview IE Print Ctrl P Recent Files gt Recent Projects gt Exit Alt4F4 E system JV Processing JU Extra Info V Info J Warning V Critical Warning J Error J Location Starts the New Project Wizard At the Top Level Entity page browse to the c altera xxx quartus qdesigns EPT_Transfer_Test directory to store your project Type in a name for your project EPT 570 AP M4 Top New Project Wizard Directory Name Top Level Entity page 1 of 5 What is the working directory for this project C altera 12 1sp1 auartus adesians EPT Transfer Test What is the name of this project EPT 570 AP M4 Top What is the name of the topdevel design entity for this project This name is case sensitive and must exactly match the entity name in the design file EPT 570 AP M4 Top i Use Existing Project Settings Page 58 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Select Next At the Add Files window Browse to the Projects HDIAEPT Transfer Test src folder of the EPT USB CPLD Development System CD Copy the files from the src directory a Settings EPT_570_AP_M4 Top
25. check box Check the box Data Collector x Elai A Application Now we are ready to start coding Forml Designer cs Forml cs F General Build Conditional compilation symbols Ba EE Define DEBUG constant Debug Define TRACE constant Resources Settings Optimize code Reference Bate Errors and warnings Signing Warning level EN cR Suppress warnings Publish Treat warnings as errors i None All Next we add two classes for our device One class stores the information useful for our device for Transmit to the EndTerms such as address of module length of transfer etc Page 135 EC a EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Create an array of the Transfer Class for device Transfer EPTTransmitDevice new Transfer 8 The next class is used to store parameters for receiving data from the device Create a Receive object of the Transfer Class Transfer EPTReceiveData new Transfer The first function called when the Windows Form loads up 1s the Data Collector Load This function is called automatically upon the completion of the Windows Form so there is no need to do anything to call it Once this function is called it in turn calls the ListDevices Main object loader private void Data Collector Load object sender System EventArgs e Call the List Devices function ListDevices T The ListDevices function calls the EPT AH Open fu
26. ct Program cs sa2unos eieg gy xoqjoo Add gt Add Reference Add Service Reference Set as StartUp Project Debug gt Cut Ctrl X Ti Paste Ctrl V X Remove Del Verify that the Platform label has Active x64 selected from the drop down box File Edit View Project Build Debug Data Tools Window Help iaa gUll aoa e gy h Release 64 EPT_570_AP_Data_Collector Gl 9 53 2 B By VEE il Dl 2 f rd EE FH EI Solution Explorer ax EPT Transfer Test X Forml1 cs Design z EIS S dd Solution EPT Transfer Test 1 project Application 3 4 i3 EPT Transfer Test Configuration Platform Active x64 M E b E Properties Build E b sj References E General M gt El Formi cs Build Events i z Program cs Debug Conditional compilation symbols Define DEBUG constant Resources v Define TRACE constant Setti We Allow unsafe code Reference Paths 7 Optimize code Signing Errors and warnings Security Warning level 4 7 Publish Suppress warnings Treat warnings as errors 9 None All Specific warnings Next unsafe code needs to be allowed so that C can be passed pointer values from the Active Host Click on the Build tab and locate the Allow unsafe code check box Check the box Page 85 gt EARTHPEOPLE TECHNOLOGY USB CPLD Development System Us
27. ur int startStopBit DO int count DO int ledPin 1335 int infin 195 int C Enable 37 void setup i 1 DORA Bllllllll Set Port A as outputs PORTA BIlIlllllll Turn on Port A pins pinMode C Enable OUTPUT binModeiledPin OUTPUT pinModefinFin OUTPUT randomSeed analokRead 13 void loop i 1 Sample the Start Stop switch from the EPT 570 AP startStopBit digitalRead inFfin delay S00 Delay 500 ms it startStopBit 1 Write a random number from O to 299 ta the input of the EPT 570 AP PORTA random 255 Page 105 A EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Set the Write Enable Pin High digitalWrite C Enable HIGH Set the LED Pin High digitalWrite ledPin HIGH delay 500 Delay 500 ms Set the LED Pin Low digitalWriteiledPin LOW Set the Write Enable Pin Low digitalWrite C Enable LOW Notice that PORTA equals the return of random 255 The parameter passed to the random function is the maximum decimal value of the return value In our case we want the maximum value to be an 8 bit value B11111111 Oxff 255 decimal Also note that the C_Enable write enable signal for the CPLD has back to back instructions turning it on then off immediately Because the ATMega328 chip takes approximately 160 clock cycles to execute the digitalWrite function and affect the Pin at C_Enable this produces a write enable pulse
28. 12 10 2012 10 16 Application extens 27 KB b RE eo E EPT_570_AP_Active_Transfer exe 2 4 20139 07PM_ Application 30 KB b ESE KEER EPT 570 AP Active Transfer pdb 2 4 2013 9 07 PM Program Debug D 52 KB b S m EPT 570 AP Active Transfer vshost exe 2 4 2013 8 57 PM Application 12 KB i Bin l 8 EPT 570 AP Active Transfer vshostexe B8 31 200912 40 AM MANIFEST File 1KB b EE amp ftd2xx dll 4 13 201210 05 AM Application extens 214 KB X EPT 570 AP Active Transfer J bin Debug E Ji 64 AJ X64 Ji obj db Properties a Service References J EPTActiveHostConsoleClient 2 items selected State BB Shared Size 239 KB Shared with Everyone Homegroup wi Date modified 4 13 2012 10 05 AM 1 Date created 2 4 2013 8 54 PM 3 Active Host Application The Active Host SDK is provided as a dll which easily interfaces to application software written in C C or C It runs on the PC and provides transparent connection from PC application code through the USB driver to the user CPLD code The user code connects to Endterms in the Active Host dll These host Endterms have complementary HDL Endterms in the Active Transfer Library Users have seamless bi directional communications at their disposal in the form of e Trigger Endterm e Transfer Endterm e Block Endterm User code writes to the Endterms as function calls Just include the address of the individual module there are eight individually addressable modules of
29. 143 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Arduino Data Collector Code M4 Arduino 10 E EX File Edit Sketch Tools Help Arduino Data Callectar Code M4 7 Copyright Earth People Technology Inc 2015 Data Collector Random Seed Platform EFPT 570 AP HM4 f int startStopBit 0 int count n int ledFin 13 int infin 19 int C Enable 37 void setup i 1 DDRA Bllllllll fet Port A as outputs PORTA amp Bllllllll Turn on Port A pins pinMode C Enable OUTPUT pinModelledFin OUTPUT pinMode inPin8 OUTPUT Arduino Uno on COKA4 The Arduino IDE will compile the project then transmit the machine level code into the ATMega328 SRAM to start the program When this is complete the Yellow L LED will blink about once per second MADE IN ITALY WE au an RX EE gt N LLTTEDEEETETETEETTEEETEET Uv v z H gt a 1 a gt canga 0 0 y Ak RESET 3 3V V GND 3 GND z Vin Page 144 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual If this LED is blinking at the rate of once per second the Arduino and the Data Collector project are ready for the EPT 570 AP M4 code The CPLD should already be programmed with its Data Collector Project If it isn t follow the instructions in section 3 1 10 Open the EPT Data Collector on the PC by brows
30. 64 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Products Earth People Technology EPTUSB CPLD Development System CD Projects HOL EPT Transfer Test Altera EPMS MA gt 4s Search Altera PMS70 M Organize v Open Share with v Bum New folder Dy EPT Projects Folders Name Date modified Type N EPT USB CPLD Development System CD N Arduino IDE 4 amp Documentation J db 3 14 20131233 AM File folder d incremental db 3 3 201310 52 PM File folder Je output files 3 14 2031221 AM File folder gt ad ia Es L EPT S70 AP MA Topjdi 3 14 201312 21 AM JDI File Projects Aardt 640 a EPT 570 AP M Top apf 3 3 2013 8 25PM QPF file i EPT_570_AP_M4_Top qsf 3 3 2013 10 51 PM QSF File E dT d Deense rare 3 14 2013 1233 AM _ WSFie Bi EPT Data Coliecto L CO EPLSTOL AP Md Top sdc IPM SDC File d EPT Transfer Test Je Altera EPMS70 MA Ji db d incremental db J output files e Altera EPMS70 U2 J se v EPT 570 AP MA Top sdc State B Shared Size 3 17 KB Shared with Homegroup SOC File Date modified 3 3 2013 10 31 PM Date created 3 3 2013 10 52 PM Copy the file and browse to c altera xxx quartus qdesigns EPT_Transfer_Test directory Paste the file SE m i gt i Search EPT_Transfer_Test p Name Date modified Type db 3 14 2013 12 41 AM File folder EPT_570_AP_M4_Top qpf 3 14 2013 12 36AM QPF File EPT 570 AP M4 Top qsf 3 14 201312
31. Adding the DLL s to the Project Locate the EPT USB CPLD Development System CD installed on your PC Browse to the Projects_ActiveHost folder choose either the 32 bit or 64 bit version depending on whether your OS is 32 or 64 bit Open the Bin folder copy the following files e ActiveHostXxX dll o ftd2xxXX dll and install them in the bin x64 x64 folder of your EPT_Transfer_Test project Page 94 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual GO di EPT USB CPLD Development System CD Projects ActiveHost 64Bit EPT Transfer Test EPT Transfer Test bin x64 Release UE AAR SS H Organize v m Open with Share with v Burn New folder JE Arduino IDE Name Date modified Type Size d Documentation EE p Di amp ActiveHost64 dll 3 2 2013 9 44 PM Application extens 27 KB rivers N EPT Transfer Test exe 3 2 2013 11 28 PM Application 28 KB J Projects ActiveHost 32Bit zo H d EPT Transfer Test pdb 3 2 201311 28 PM Program Debug D 56 KB Projects ActiveHost 64Bit EX ae n EPT_Transfer_Test vshost exe 3 2 2013 11 21PM Application 12 KB Ji ActiveHost 1 0 0 8 3 Es _ EPT Transfer Test vshost exe manifest 8 31 2009 12 40 AM MANIFEST File 1KB J EPT Data Collector 3 ftd2 964 dll 1 18 2013 3 54 PM Application extens 252 KB p EPT_Transfer_Test 3 J EPT Transfer Test amp bin sa d Debug d Release de 4 Debug Release
32. CPLD of this manual for testing of the programming If the driver is not found in the Programmer Tool Hardware Setup box see the JTAG DLL Insert to Quartus II Troubleshooting Guide 2 3 Active Host Application DLL To use the Active Host Application Software the Active Host DLL and the ftd2xx DLL must be included in the Microsoft Visual project The Active Host Application Software will allow the user to create a custom applications on the PC using the EndTerms to perform Triggers and Data Transfer to from the EPT 570 AP The methods and parameters of the Active Host DLL are explained in the Active Host Application section Locate the Projects ActiveHost 64Bit and Projects_ActiveHost_32Bit folders on the EPT USB CPLD Development System CD Page 21 Io EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Products Earth People Technology EPT USB CPLD Development System CD Projects ActiveHost 64Bit Organize v Include in library v Burn 4 EPT USB CPLD Development System CD gt J Arduino IDE P Documentation D n Drivers gt Projects ActiveHost 32Bit New folder gt Projects ActiveHost 64Bit b n Projects Arduino gt Ji Projects HDL Quartus Programmer J ESwitch b J FTDI Linear Tech gt jo NXP k 4 items m Name ActiveHost 1 0 0 7 s EPT 570 AP Data Collector EPT Transfer Test EPTActiveHostConsoleClient Date modified 2 9 2
33. Clean up any resources being used ummar param n dis true if managed resources should be disposed other pcetucked cane void getoer disposing if disposing amp amp components null t components Dispose Wl Solution Explorer Ta Error List Errors 2 Warnings i 0 Messages Description Column Project z Z Error List FALETIS Ready Ln7 Col 23 Ch 23 INS 6 2 3 Adding Controls to the Project Although the C language is very similar to C Code there are a few major differences The first is C NET environment is event based A second is C utilizes classes This guide will keep the details of these items hidden to keep things simple However a brief introduction to events and classes will allow the beginner to create effective programs Event based programming means the software responds to events created by the user a timer event external events such as serial communication into PC internal events such as the OS or other events The events we are concerned with for our example program are user events and the timer event The user events occur when the user clicks on a button on the Windows Form or selects a radio button We will add a button to our example program to show how the button adds an event to the Windows Form and a function that gets executed when the event occurs The easiest way to add a button to a form is to double click the Form1 cs in the Solution Explorer Click on the
34. Debugging User item templates location gt Database Tools c users nelsonstrfgr documents visual studio 2010 Templates ItemTemplat m gt Text Templating gt Windows Forms Designer Always show Error List if build finishes with errors achitadi aa Explorer Always show 56 Save new projects when created Warn user when the project location is not trusted E Show Output window when build starts Prompt for symbolic renaming when renaming files Go to Build gt Configuration Manager Page 82 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Build Debug Data Tools Window Help NA dd A ES Build Solution s b e a EF PGE 12 Tp ap Rebuild Solution 3 pa j Ay Solution Explorer Di Publish EPT_Transfer_Test DEI sd Solution EPT Transfer Test 1 4 Al EPT Transfer Test gt Sa Properties gt ij References b Forml cs c Program cs project ud Formi sa 1nos eje ali xoqjoo In the Configuration Manager window locate the Active solution platform label select New from the drop down box Configuration Active solution configuration Active solution platform Project contexts check the project configurations to build or dep PT Project Configuration Edit EPT Transfer Test Debug In the New Solution Platform window click on the drop down box under Type or select the new platform
35. E Ji amd64 B Js 386 gt Static ad Temp UU emT m os dil CAUsers Y Browse V Include subfolders gt Let me pick from a list of device drivers on my computer This list will show installed driver software compatible with the device and all driver software in the same category as the device Browse for driver software on your computer Search for driver software in this location Include subfolders gt Let me pick from a list of device drivers on my computer This list will show installed driver software compatible with the device and all driver software in the same category as the device The next window is the Windows Security notice The EPT driver is not signed by Windows Click on the Install this driver software anyway Dx Windows Security 69 Windows can t verify the publisher of this driver software Don t install this driver software You should check your manufacturer s website for updated driver software for your device Install this driver software anyway Only install driver software obtained from your manufacturer s website or disc Unsigned software from other sources may harm your computer geteel information v See details Windows will add the EPT_2 08 24 driver to the System Registry Page 17 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual e Windows has successfully updated yo
36. EPT_570_AP_M4_Top EPT 570 AP M4 Top Chain4 cdf File Edit View Processing Tools Window Help 57 Search altera com S Hardware Setup EPT Blaster v1 3b MBUSB 0 Mode Progress O O E Enable real time ISP to allow background programming for MAX II and MAX V devices Checksum Usercode Program Verify Blank Examine Security Era Configure Check Bit Click on the Change File button and browse to the output files folder Page 72 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Select New Programming File RR EN OOO UHH 2 Type Date Modified Fil der 3 13 2013 10 00 22 PM Fil der 3 13 2013 9 38 49 PM Fil der 3 13 2013 10 00 21 PM Fil der 3 13 2013 9 42 12 PM Z Add Device fii up jbc ekp jc pu Down Click on the EPT 570 AP M4 Top pof file to select it W Select New Programming File ZZ C altera 12 1sp1 quartus gdesigns EPT_Transfer_Test output_fles OQ O Q 7 A My Comp Qu EPTSTOAP MA Toppof gt Size Type Date Modified File name EPT 570 AP M4 Top pof Files of type Programming Files sof pof jam jbc ekp jic Click the Open button in the lower right corner Next selet the checkbox under the Program Configure of the Programmer Tool The checkboxes for the CFM and UFM will be selected automatically Page 73
37. FIFO for receiving data from the CPLD to the Host PC The module uses the 5 Vbus from the Host USB for self power The FT2232H Mini Module provides its own 12 MHz clock and 3 3V and 1 8V power supplies The 43 3V power supply output is used by the EPT 570 AP base board for all of its 3 3V power budget Figure 4 contains an illustration of the FT2232H board Page 11 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 1 3 Active Host EndTerms The Active Host SDK is provided as a dll which easily interfaces to application software written in C C or C It runs on the PC and provides transparent connection HOST APPICATION EPM570 CPLD USER APPLICATION TRIGGER ENDTERM C WINDOWS FORM C CONSOLE TRANSFER censo EE rs ACTIVE USER CODE ARE TRIGGER ENDTERM ACTIVE LIBRARY 8 BIT DATA BUS HOST E USB BUS TRANSFER ENDTERM DLL DRIVER ARDUINO k BLOCK ENDTERM i 6 BIT CONTROL BUS from PC application code through the USB driver to the user CPLD code The user code connects to Endterms in the Active Host dll These Host Endterms have complementary HDL Endterms in the Active Transfer Library Users have seamless bi directional communications at their disposal in the form of e Trigger Endterm e Transfer Endterm e Block Endterm User code writes to the Endterms as function calls Just include the address of the individual module there are eight individually add
38. Ji bin 3 2 201311 29 PM File folder g Documentation red p obj 3 2 2013 11 29 PM File folder d Drivers i j Ji Properties 3 2 201311 29 PM File folder di Projects_ActiveHost_32Bit 3 p a k E s active transfer x64 cs 3 2 201311 28 PM Visual C Source f 7 KB 4 Projects ActiveHost 64Bit e 2 58 EPT Transfer Test csproj 3 2 201311 28 PM Visual C Project f 5 KB Jj ActiveHost 1 0 0 8 E Ga EPT Transfer Test csproj user 2 7 2013 11 11 PM Visual Studio Proj 1KB J EPT_Data_Collector ARE Formi cs 2 1 2013 11 36 PM Visual C Source f 19 KB amp Formi Designer cs 2 1 201311 36 PM Visual C Source f 36 KB 4 EPT Transfer Test d Bi bi EA Formi resx 2 4 2013 9 05 PM NET Managed Re 6 KB in B bi Program cs 2 7 2013 11 34 PM Visual C Source f 1 KB 05 d Properties J EPTActiveHostConsoleClient d Projects Arduino d Projects HDL n Quartus Programmer Y k 10 items State 2 Shared 4 EPT Transfer Test 6 2 1 Changing Project Name If you named your project something other than EPT_Transfer_Test you will have to make changes to the cs files above This is because Visual C Express links the project files and program files together These chages can be made by modifying the following 1 Change namespace of Forml cs to new project name 2 Change class of Forml cs to new project name 3 Change constructor of Forml cs to new project name A EPT FT2232 Interfac
39. NG eN DE Ao ns 89 6 2 3 Adding Controls to the PrOIOGL iese es es es SE ese EE sd 90 6 2 4 Adding the DLL s to the Project esse ees nnns 94 6 25 Buld The Profe Gl ss EE AA Ee AD De EE N oH SEU EE AD rer 95 626 Tel EIE Di je l ee eo EER De EER DA ae RE EG ee EG GR de Oe UE 96 7 The Development Pro es8 sae Ge SE EA ie AD niii ei 100 7 1 Designing a Simple Data Collection Sampler iese ee 100 7 1 1 The Arduino Microcontroller Board iss sesse ee 101 Rte ale Wat Gere OF ses E ee Ee 101 AE EE EA EE UK EO TEE 101 7 1 3 Select I O s for Fast Throughput on Arduino esse ee ee ee 102 7 1 4 Coding the Arduino Data Sampler iese ese ee ee RE Ee 103 PIE EG aN COE OD AE OE EE EE N 106 7 1 6 Programming the ArduinO sesse sesse ee ee RE ee 109 7 1 7 CPLD Active Transfer Coding and Initiation sess 111 7 1 8 CPLD Define the User Design sesse ee ee ee ee 112 7 1 9 CPLD Compile Synthesize the Project sesse sees ee 123 TAAQ CPLD Program ihe C PED ss eis oe ductus ut EN de Ed 128 did DE DCS ii the PrO i esse EE Um T 129 ld PE ETE Hi POSE ee m T T 129 7 1 13 PC Compiling the Active Host ApplicatlOn sesse sesse sesse sees ee ee ee ee 14 7 1 14 Connecting the Project Together ee ee ee ee Re 143 dd desire die Di eel RR ERG ee ER hone ant meant ibm tomi ee ER Ge USE 146 8 Hyper Serial Port HSP Application sesse sesse esse ee ee ee ee ee ee ee ee ee ee
40. Run 0 Assignment Analysis J Tasks MAX II oes ITTI TI E TTT TTT EPM570T100C5 uu ehh e RRA HR NA TRANE Rd EH 08000000 gt lt 01 gt L lt eeeeeeeeee x le EF C Export Pin Assignments 4 m s eeocooAVOOOOVOAeeeooAveeco Named v K gt Edit Node Name 2 LB BYTE A 7 2 LB BYTE A 6 2 LB BYTE A 5 2 LB BYTE Afd 2 LB BYTE A 3 2 LB BYTE A 2 2 LB BYTE A 1 2 LB BYTE A 0 2 LB BYTE B 7 2 LB BYTE B 6 2 LB BYTE B 5 2 LB BYTE B 4 2 LB BYTE B 3 2 LB BYTE B 2 2 LB BYTE B 1 2 LB BYTE BIO 2 LB BYTE C 7 2 LB BYTE C 6 2 LB BYTE C 5 2 LB BYTE C 4 2 LB BYTE C 3 2 LB BYTE C 2 2 LB BYTE C 1 2 LB BYTE C 0 2 LB BYTE D 7 amm c m mms Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Unknown Direction Location PIN 61 PIN 58 PIN 57 PIN 56 PIN 55 PIN 54 PIN 53 PIN 52 PIN 73 PIN 72 PIN 71 PIN 70 PIN 69 PIN 68 PIN 67 PIN 66 PIN 86 PIN 87 PIN 89 PIN 91 MP h2 h HMM NNN NNN NNN h3 h3 HD NNN NNN h MM VO Bank I O Standard 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV defau
41. Select x64 Page 83 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual LI MM CIN Active solution configuration Active solution platform 186 Project contexts check the project configurations to build or deploy Project EPT_Transfer_Test Type or select the new platform Any CPU Itanium Create new project platforms Click the Ok button Verify that the Active Solution Platform and the Platform tab are both showing x64 onfiguration Manage mee Active solution configuration Active solution platform Project contexts check the project configurations to build orldeploy Project Configuration Platform Build EPT Transfer Test Release v 64 iy Also select Release under Active solution configuration Click Close Then using the Solution Explorer you can right click on the project select Properties and click on the Build tab on the right of the properties window Page 84 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual File Edit View Project Build Debug Data Tools Window Help Wee aa e E Je A PERI dm op a os Fl BF one ST SIE St at ot Ge 2a 2 DR EE EE EE EE EI EE Ee EE EE Oe EE ee sd Solution EPT Transfer Test 1 project 4 ZA EPT Transfer Test gt Sa Properties i Build gt La References Rebuild EE Forml cs Publish
42. Select this option if you want the Altera Installer to retrieve installation files from the Internet Specify how you are connected to the Internet No proxy recommended Installer sal 2 Manual proxy configuration Web Proxy Port Username Password a Click Next to accept the defaults G Altera Installer 12 1 Build 177 H MEUS Select Destination Specify the software destination directory Destination Directory c altera 12 1 Available Space Temporary Directory for installation files C Users NELSON 1 AppData Local Temp Available Space Remove saved installation files after completion Download only and install later Program Folder Specify the Program Folder Altera 12 1 Build 177 Copy 2 Existing Folders gt Select Destination Accessories Administrative Tools Altera Altera 12 1 Build 177 Altera 12 1sp1 Build 243 AMD VISION Engine Control Center AUPEO Barnes amp Noble Brother 4 ad RB So Pr E px At the Select Products Window de select the Quartus II Supbscription Edition by clicking on its check box so that the box is not checked Then click on the check box by the Quartus II Web Edition Free Page 54 EARTHPEOPLE TECHNOLOGY USB CPLD Development ystem User Manual j Altera Installer 12 1 Build 177 H TET Select products Select the software products you want to install P
43. TECHNOLOGY USB CPLD Development System User Manual Click Next accept the license agreement Click Next LA Microsoft Visual C 2010 Express Setup al Microsoft O Visual CF 2010 Express Installation location cannot be changed Click here for more information Install in folder C Program Files x86 Microsoft Visual Studio 10 01 The following items will be downloaded and installed Microsoft Visual Studio 2010 Express Prerequisites x64 e Microsoft Visual C 2010 Express Disk space requirements C 767 MB Total download size 47 MB Visual C 2010 Express will install This may take up to twenty minutes depending on your internet connection L Microsoft Visual C 2010 Express Setup i sl x Setup complete Microsoft Q9 Visual CF 2010 Express Microsoft Visual C 2010 Express has been installed successfully i Visit Microsoft Update to download the latest service packs and security updates The installed successfully window will be displayed when Visual C Express is ready to use Once the application is installed open it up Click on File gt New Project Page 77 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual le Microsoft Visual C 2010 Expre Edit View Debug Tools Window Help J A 7 2c Be El z 5 Open Project Ctrl Shift O j Open File Ctrl O Close Close Solution Save Selected Items Ctrl S
44. These buses are the NE active transfer library ACTIVE TRANSFER LIBRARY INST aa aa bc in bc in bc out bc out bd inout bd inout OC IN UC IN UC OUT UC OUT Finally we instantiate the Active EndTerms For the Data Collection project we only need active transfer and active trigger EndTerms The uc out port for both modules must be shared Since they both drive this bus a bus wide wired or circuit is used so that they don t drive each other The active transfer EndTerm has a port for the address uc addr This allows the PC to address up to 8 different modules Just add a three bit address to this port and the PC must add this same address to communicate with this module Page 122 EARTHPEODPLE TECHNOLOGY USB CPLD Development System User Manual wire 22 2 1 0 uc out m eptWireOR N 2 wireOR UC OUT uc out m active trigger uc clk uc reset uc in uc out uc out trigger to host trigger to device j active transfer uc clk uc reset uc in uc out uc out Start transfer transfer received uc addr transfer to host transfer to device ACTIVE TRIGGER INST CLK IN RST UC IN UC OUT uc out ml 0 22 22 TY trigger out trigger in byte ACTIVE TRANSFER INST CLE IN RST UC IN UC OUT uc out ml 1 22 22 J transfer out transfer in received 3 h2 transfer out byte transfer in byte
45. Tools Window Help 5 Le E lm Search altera com Hardware EPT Blaster v1 3b MBUSB 0 ae GE wes SEER Enable real time ISP to allow background programming for MAX II and MAX V devices pu Down File Device output files EPT 570 A EPM570T100 CFM UFM Checksum 002CDD25 Usercode Configure FFFFFFFF Program Verify Blank Check ai 4 Examine Security Era Bit Page 74 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual At this point the EPT 570 AP is programmed and ready for use To test that the CPLD is properly programmed bring up the Active Host Test Tool Click on one of the LED s and verify that the LED selected lights up Press one of the switches on the board and ensure that the switch is captured on the Active Host Test Tool Now you are ready to connect to the Arduino MEGA and write some code to transfer data between microcontroller and PC 6 Assembling Building and Executing a NET Project on the PC The Active Host Application DLL is used to build a custom standalone executable on the PC that can perform Triggers and Transfer data to from the EPT 570 AP A standalone project can be range from a simple program to display and send data from the user to from the Arduino MEGA Or it can more complex to include receiving data processing it and start or end a process on the Arduino This se
46. Web Edition Free includes Nios II EDS s Quartus II software 64 bit Arria II GX The Altera Installer finished installing the Quartus II Web Edition Free includes Nios II EDS ModelSim Altera Starter Edition Free software version 12 1 SESSE Start Quartus II 12 1 Get Quartus II Subscription License Create Desktop Shortcuts Quartus II Web Edition Free and Nios II SBT Nios II GCC4 Toolchain ModelSim Altera Starter Edition Free Installation Rate your installation experience Bak jeans Cancel Click Ok then click Finish The Quartus II is now installed and ready to be used 5 2 Setting up the Project and Compiling Once the HDL code Verilog or VHDL is written and verified using a simulator a project can be created using Quartus II Writing the HDL code and simulating it will be Page 56 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual covered in later sections Bring up Quartus II then use Windows Explorer to browse to c altera xxx quartus qdesigns create a new directory called EPT Transfer Test ty Search gdesigns E v Open Include in library v Share with v Burn New folder v Hl J bin Name z Ji bin64 EPT Transfer Test 3 13 2013 8 52 PM File folder common B fir filter 3 3 2013 1 38 AM File folder c Vd p incr_comp_makefile 3 3 2013 1 38 AM File folder IJ vhdl_verilo
47. Web Edition Home gt Support gt Downloads gt Thank you for downloading MegaCore IP Library ModelSim Altera Altera Design Suite v12 1 for Windows Altera Installer ModelSim Altera Starter If the file download window as shown in figure 1 did not appear please Nios II EDS Legacy Tools follow download troubleshooting steps below DSP Builder Next Steps OS Support Figure 1 Download window Get licenses Archives file Download o Security Warming Get licensing and installation Service Packs support Design Software Do you want to run or save this file Licensing Get and Manage Licenses Name software_name exe Licensing FAQ Type Application file size License Daemon Software From altera com Programming Software Jam STAPL Software Drivers Cable amp Adapter Drivers While files from the Intemet can be useful this file type can potentially harm your computer F you do not trust the source do not Board Layout and Test run or save this software What s the nek BSDL Models SPICE Models IBIS Models Download Troubleshooting Steps Schematic Review Worksheets 1 Disable your pop up blocker Layout Review Worksheets If a yellow pop up blocker bar appears just below your Internet Explorer menu bar see Figure 2 click on Cadence PCB Libraries the yellow bar and select Temporarily Allow Pop ups Any third party pop up blockers must also be Mentor Graphics PCB Libraries disabled to download a file Gerber Files Figure 2
48. Windows Explorer Pop Up Blocker Legacy Software MAX PLUS II Si Pop up blocked To see this pop up or additional options click here x Other Legacy Software e You may also by pass the pop up blocker by clicking this link Download your file now 2 The download window as shown in figure 1 will appear Click Run to initiate the Altera Installer Click on the Allow Once button The next window will appear It is the Download Manager Page 51 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual JN DS Va About the Download Manager The Download Manager provides a more effective more efficient way to download files than you normally see with a browser especially for large files or file sets It can pause and restart downloads even you tum your computer of and on again After you initiate a download by clicking the link below a security warning appears From the security warning window click Install to continue downloading your file The Download Manager will install and begin to download the requested file Your File Now Ethe Download Manager falls to start or if you do not accept the security cemfcate you can download the file without using the Downioad Manager Internet Explorer Security zi Tl DL This program w open outside of Protected mode Internet protect your computer Uf vou de rat wat tis website do not open ths program Hi vis D Publishers Akamai Technologies Inc
49. X button to launch the Toolbox Page 90 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual E File Edit View Project Debug Data Tools Window Help aau Fadl aala e a tooltip Re RIA HIE s alm wal Sl ER TE oe oe S SAAIER RI WW Solution Explorer dE Fomlcs FormlDesigner cs ES ie z gt All Windows Forms I J Solution EPT Transfer Test 1 project ud Active Host 4 c EPT Transfer Test j l Pointer b Em Properties gt ba References EE active transfer cs 4 amp Formi cs Formi Designer cs 3 Form1 resx Program cs Button CheckBox CheckedListBox ComboBox 1a101dx3 aseqejeg DateTimePicker Label LinkLabel ListBox ListView MaskedT extBox MonthCalendar NotifyIcon NumericUpDown PictureBox Dr gt a ogame di Solution Explorer E ProgressBar D E Re fal bl Ed E e Error List O okor 2 Warnings D 0 Messages Description Line Column Project rr Error List SAME Locate the button on the Toolbox grab and drag the button onto the Form1 cs Design and drop it near the top Page 91 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual roject Debug Data Format Tools Window Help 4 4a 0 D 9 tooltip IE 3e D i op at a l ES ik ooe Se S St a et a isi mg Solution Explorer 4X Forml cs Form1 Designer cs Forml cs Design X BEANS E 2 gt All Windows Forms 2d Sol
50. abd active trigger ACTIVE TRIGGER INST 4 BEd sync fifo BLOCK IN FIFO FB Flow Settings f Flow Non Default Global Settings f Flow Elapsed Time FB Flow OS Summary Z Flow Log gt L3 Analysis amp Synthesis gt Lg Fitter Family Device ES Flow Summary Flo usi Quartus I 64 Bit Version Revision Name Top level Entity Name Timing Models Total logic elements Successful Thu Mar 14 00 50 53 2013 124 Build 243 01 31 2013 SP 1 SJ Web Edition EPT 570 AP M4 Top EPT 570 AP M4 Top MAXII EPM570T100C5 Final 554 570 97 Total pins 61 76 80 Total virtual pins 0 UFM blocks 0 1 0 gt Lg Assembler gt 3g TimeQuest Timing Analyzer gt 0 EDA Netlist Writer abd mem_array U_MEM_ARRAY cea D S 1 meam cmm Compile Design gt Br Analysis amp Synthesis b B Fitter Place amp Route gt B Assembler Generate programmin gt gt TimeQuest Timing Analysis b 2999229 EDA Netlist Writer wW Program Device Open Programmer a BEP P lt lt Search gt gt Type ID Ww 332102 Design is not fully constrained for hold requirements gt WD Quartus II 64 Bit TimeQuest Timing Analyzer was successful 0 errors i RRR RRR ode eode RRR eode ER dee ode dede ode ode dede oe ode eode eode ode eode ode ode de egeo ode eoe eode eo vn EIE Message 6 warnings Running Quartus II 64 Bit EDA Netlist
51. callback function is registered at initialization When the CPLD transmits a block using its EndTerm the callback function 1s called in the Page 24 A EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual user application The incoming Transfers are stored in a circular buffer in memory This allows the user code to fetch the transfers with out losing bytes 3 4 Active Host DLL The Active_Host DLL is designed to transfer data from the CPLD when it becomes available The data will be stored into local memory of the PC and an event will be triggered to inform the user code that data is available from the addressed module of the CPLD This method of automatically moving data from the user code Endterm in the CPLD makes the data transfer transparent ACTIVE TRANSFER ACTIVE HOST LIBRARY DLL The data seamlessly appears in Host PC memory from the Arduino The user code will direct the data to a control such as a textbox on a Windows Form The transparent receive transfer path is made possible by a Callback mechanism in the Active Host dll The dll calls a registered callback function in the user code The user code callback can be designed to generate any number of events to handle the received data The user application will access the CPLD by use of functions contained in the Active Host dll The functions to access the CPLD are e EPT AH Open EPT AH QueryDevices EPT AH GetDeviceName EPT AH OpenDeviceB
52. each Endterm Immediately after writing to the selected Endterm the value is received at the HDL Endterm in the CPLD The Trigger Endterms are used as switches The user code can set a Trigger bit in the CPLD and cause an event to occur The Transfer Endterm sends one byte to the CPLD The Block Endterm sends a block of bytes By using one of the Active Host Endterms the user can create a dynamic bi directional and configurable data transfer design Page 23 fb EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual HOST APPICATION EPM570 CPLD USER APPLICATION TRIGGER ENDTERM C WINDOWS FORM C CONSOLE TRANSFER Cos mm is ACTIVE USER CODE TRANSFER TRIGGER ENDTERM ACTIVE a LIBRARY 8 BIT DATA BUS HOST dat USB BUS TRANSFER ENDTERM DLL DRIVER i i ARDUINO BLOCK ENDTERM 6 BIT CONTROL BUS 3 1 Trigger EndTerm The Trigger EndTerm is a software component that provides a direct path from the users application to the commensurate Trigger EndTerm in the CPLD The Trigger has eight bits and is intended to be used to provide a switch at the opposite End Term They are fast acting and are not stored or buffered by memory When the user code sets a Trigger it is immediately passed through to the opposite EndTerm via the USB driver When receiving Trigger the user application is required to respond to a callback from the Active Host dll 3 2 Transfer Byte EndTerm The Transfer EndTerm is a software
53. index exit j USB High Speed Transfer Bl v The device_index variable is used to store the index of the device selected from the combo box This variable is passed into the EPT_AH_OpenDeviceB yIndex This Page 137 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual process is started by the user clicking on the Open button If the function is successful the device name is displayed in the label labelDeviceCnt Next the device is made the active device and the call back function is registered using the RegisterCallBack function Finally the Open button 1s grayed out and the Close button is made active Open the device public unsafe Int32 OpenDevice 1 device index int cmbDevList SelectedIndex if EPT AH OpenDeviceByIndex device index 8 1 String message Could not open device Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceSerial device index MessageBox Show message return 6 I else labelDeviceCnt Text Connected to device Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceSerial device index I Make the opened device the active device if EPT AH SelectActiveDeviceByIndex device index 8 1 String message Error selecting device 4s Marshal PtrToStringAnsi IntPtr EPT AH GetLastError
54. low on the transfer write register will cause the active transfer module to latch the value of transfer write byte into the active transfer library module and sets up the byte transfer to the PC When the LB BYTE B 0 C Enable pin goes low the encoder will reset transfer write reg and transfer write to low The encoder goes back to waiting for the LB BYTE B 0 C Enable to assert high Page 118 EARTHPEODPLE TECHNOLOGY USB CPLD Development System User Manual EE Detect Transfer From Arduino ee always posedge CLE 66 or negedge RST begin if RSTI begin transfer write reg lt 1 b0 transfer write lt 1 b0 transfer write byte lt 0 IR DIR 4 lt 1 bO l1 A to B 0 B to dA IR OE 4 l b0 LB BYTE D O lt start stop cntrl LB BYTE D 7 1 lt 7 bO0000000 end else begin 1f LB BYTE BIO amp transter write reg begin IR OE 4 l b1 LB BYTE D lt 23 hz transfer write reg lt 1 Bl transfer write lt l bl transfer write byte LB BYTE C end else if LB BYTE BIO amp transfer write reg begin transfer write reg lt l bl transfer write lt 1 bO end else if LB BYTE B C amp transfer write reg begin transfer write reg lt l b0 transfer write lt l b0 transfer write byte lt 0 end else begin IR DIR 4 lt l b0 ffl A to B 0 B to A IR OE 4 lt l b0 LB BYTE D 2 lt start stop cntrl LB BYTE D 7 1 lt 7 bO0000000 end end end The 8 bit
55. new compilation 100 00 00 20 If you forget to include a file or some other error you should expect to see a screen similar to this Page 66 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual G Quartus II 64 Bit C altera 12 1sp quartus qdesigns EPT_Transfer_Test EPT_570_AP_M4_Top EPT 570 AP M4 Top pt FT pa File Edit View Project Assignments Processing DOEdA 428 5c esmemm RY SY OV OOH 1X Entity MAX TE EPM570T100C5 4 hbd EPT 570 AP M4 Top abd active transfer ACTIVE TRANSFER INST abd active transfer library ACTIVE TRANSFER L abd active trigger ACTIVE TRIGGER INST gt sync fifo BLOCK IN FIFO abd active block BLOCK TRANSFER INST bd eptWireOR wireOR Compile Design W Analysis amp Synthesis gt Fitter Place amp Route Assembler Generate programmin P TimeQuest Timing Analysis gt EDA Netlist Writer w Program Device Open Programmer Tools Window Help EY Compilation Report EPT 570 AP M4 Top Table of Contents na EB Flow Summary Ef Flow Settings f Flow Non Default Global Settings E5 Flow Elapsed Time f Flow OS Summary 2 Flow Log gt LJ Analysis amp Synthesis Flow Summary Timing Models ci Search altera com ge me Ai AF 3 EG Flow Failed Thu Mar 14 00 48 04 2013 12 1 Build 243 01 31 2013 SP 1 SJ Web Edition EPT_570_AP_M4_Top EPT_570_AP_M4_Top MAXI EPMS70T100C5 Final Ar e aJ
56. that the byte at transfer_to_device is ready for the user code to read Add code snippet showing Active Block Module bytes received by the user code 4 3 Timing Diagram for Active Transfer Methods The Active Transfer Library uses the 66 MHz clock to organize the transfers to Host and transfer to Device The timing of the transfers depends on this clock and the specifications of the USB chip Users should use the timing diagrams to ensure proper operation of user code in data transfer 4 3 1 Active Trigger EndTerm Timing a RT a TRIGGER HOST Each Bit 6 5 ns SETUP TIME CLOCK 66 MHz Figure xx Active Trigger to Host Timing heat 45 4 ns Figure xx Active Trigger to Device Timing TRIGGER TO DEVICE Each Bit 4 3 2 Active Transfer EndTerm Timing hess atl CLOCK 66 MHz OE TS NE UI ee I did N 45 4 ns 15 15 45 4 ns START TRANSFER 0 F NN 1 ae NEE 5 4 ns SAn 5 4 ns 5 4 ns TRANSFER TO HOST Figure xx Active Transfer To Host Timing Page 48 E EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual izz a aoee LT LT LT U LT UU UU UU LU LI TRANSFER_RECEIVED 5 4ns 5 4ns 5 4 ns TRANSFER_TO_DEVICE ER ER Figure xx Active Transfer To Device Timing 4 3 3 Active Block EndTerm Timing 15 15 ns 4 CLOCK 66 MHz 303 1 ns 15 15 ns START_TRANSFER 135 ns 15 15 ns TRANSFER_READY 0 3 ns AT ENS C evro gt BYTE1 Y BYTE2 Y Bytes Y ByrEa gt
57. transceivers are used to connect the 3 3Volt Input Outputs of the CPLD to the 45 Volt Input Outputs of the Arduino These 8 bit transceivers incorporate a Direction bit and an Output Enable bit To guide signals from the CPLD to the Arduino we turn the Direction bit to B to A TR DIR 1 lt DO and the Output Enable on TR OE 1 lt 1 b0 Output Enables are asserted with a zero Page 119 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual The start_stop_cntrl signal is set by using the TRANSFER CONTROL state machine in the following section Next we add a TRANSFER_CONTROL state machine to read the Control Register from the Host PC using the active_transfer EndTerm This state machine will decode the 8 bit control register only after a sequence of three 8 bit bytes in the order of 0x5a 0xc3 Ox7e The operation of the state machine is as follows e The TRANSFER CONTROL state machine will stay in the idle state of the parallel encoder until a byte from the active_transfer transfer_to_device register receives a OxSa e This will cause the transfer_control_state to be changed to TRANSFER CONTROL HDRI e The state machine will stay in the TRANSFER CONTROL HDRI state until the next byte is read from the active transfer e If the byte from transfer to device is a Oxc3 the transfer control state will be changed to TRANSFER CONTROL HDR 2 e If the byte from transfer to device is not a Oxc3 the transfer co
58. unsafe void EPTReadFunction Int32 device id Int32 device channel byte command byte payload i char message char data Select current device EPT AH SelectActiveDeviceByIndex device id Make sure we have data in the system if message null i MessageBox Show Message Marshal PtrToStringAnsi IntPtr message i Because the callback function communicates directly with the dll and must pass pointers from the dll to the C Windows Form the Marshaling scheme must be used Marshaling allows pointer variables created in the dll to be passed into the C It is an advanced topic and will not be covered in this manual 3 4 3 Active Host Triggers The user application can send a trigger to the CPLD by using the EPT AH SendTrigger function First open the EPT device to be used with EPT AH OpenDeviceByIndex Call the function with the bit or bits to assert high on the trigger byte as the parameter Then execute the function the trigger bit or bits will momentarily assert high in the user code on the CPLD private void btnTriggerl Click object sender EventArgs e i H To detect a trigger from the CPLD the user application must subscribe to the event created when the incoming trigger has arrived at the Read Callback function The Read Callback must store the incoming trigger in a local variable A switch statement is used to decode which event should be called to handle the incoming received data e
59. use an embedded processor to communicate with the I2C device and debug communication errors Caution must be used when using this mode HSP does not put any restrictions on using Python scripts and thus user scripts could be generated which could damage the OS Care must used when writing Python scripts in this mode HSP contains an embedded scripting evaluator which enables Python scripts to be used to generate commands to read and write to the CPLD trigger and active transfer modules in the CPLD Details of the Python language are given at http www python org IronPython is an implementation of the Python language for operation within the Microsoft NET environment Details of the IronPython Page 147 B9 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual implementation are given at http www python org Notepad is a useful text editor for generating and editing the Python scripts 8 3 Send Character Timer The Send Character Timer Function allows the user to send a repeating character or string at a timed sequence over the serial port This function utilizes the high resolution property of Windows 7 OS This will allow the timer to reach up to 700 microseconds between characters sent Some caution must be exercised with timed sequences in the Windows 7 OS This operating system is a non deterministic operating system This means it cannot guarantee the timer will expire at 700 microseconds for each sequence 6 4
60. user s compiled code into the Flash memory of the Atmel ATMega328 chip Once the code is downloaded the Arduino IDE resets the chip and the processor starts executing out of Flash memory To program the Arduino e Connect the USB cable from PC to Arduino e Load the Arduino USB driver according to the manual e Plug in your board and wait for Windows to begin it s driver installation process After a few moments the process will fail despite its best efforts e Click on the Start Menu and open up the Control Panel e While in the Control Panel navigate to System and Security Next click on System Once the System window is up open the Device Manager e Look under Ports COM amp LPT You should see an open port named Arduino MEGA COMxx e Right click on the Arduino MEGA COmxx port and choose the Update Driver Software option e Next choose the Browse my computer for Driver software option Page 109 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Finally navigate to and select the MEGA s driver file named ArduinoMEGA inf located in the Drivers folder of the Arduino Software download not the FTDI USB Drivers sub directory Windows will finish up the driver installation from there FE Oe ice Manager 9 je 3 I ol DI File Action View Help je emit HIE EERS 4 g NelsonsTrfgr PC i 3 Batteries AM Computer Disk drives JA Display adapters 43 DVD CD ROM
61. users to write HDL code either Verilog or VHDL that will implement any digital logic circuit The user s HDL code is compiled and synthesized and packaged into a programming file The programming file is programmed into the CPLD using the JTAG channel of the USB to Serial chip the FT2232H The Active Host SDK contains a dll which maintains device connection polling writes and includes a unique receive mechanism that automatically transfers data from EPT 570 AP when data is ready It also alerts the user code when the dll has stored the transfer and the data is available to the software GUI graphical user interface Users do not need to interface with the USB Host Driver or any Windows drivers They need only to include the Active Host dll in their projects The Active Transfer Libraries must be included in the CPLD project to take advantage of the configurability of the Active Host SDK All of the drivers libraries and project source code are available at www earthpeopletechnology com Page 4 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 1 1 Test Driving the Active Host Test Application The EPT 570 AP board comes pre loaded with the EPT_Transfer_Test HDL project in the CPLD This project allows the user to test out the functions of the Active Host API and the board hardware GOU EPT USB CPLD Development System CD Projects ActiveHost 64Bit EPT Transfer Test EPT Transfer Test gt bin
62. x64 Release MEE GE Lr Jj Organize v E Open Share with Burn New folder Arduino IDE Name s Date modified Type Size di Documen tation Te Nite OD n TE S ActiveHost64 dll 3 2 2013 9 44 PM Application extens 27 KB rivers EE x EPT Transfer Test exe 3 2 20311 28 PM Application 28 KB Projects ActiveHost 32Bit eH EPT Transfer Test pdb 3 2 2013 11 28 PM Program Debug D 56 KB Projects ActiveHost 64Bit P EPT_Transfer_Test vshost exe 3 2 2013 11 21 PM Application 12 KB dJ ActiveHost 1 0 0 8 x E i i EPT Transfer Test vshost exe manifest 8 31 2009 12 40 AM MANIFEST File 1KB d EPT_Data_Collector ees s S ftd23964 dll 1 18 2013 3 54 PM Application extens 252 KB J EPT Transfer Test M EPT_Transfer_Test J bin m Debug d Release J 64 d Debug d Release Ji obj P Properties v 1 EPT_Transfer_Test exe State BR Shared Size 28 0 KB Shared with Homegroup F Application Date modified 3 2 2013 11 28 PM Date created 3 2 2013 11 29 PM To test drive the application connect the EPT 570 AP U2 to the Windows PC using Type A to Type Mini B USB cable Load the driver for the board See the section EPT Drivers for instructions on loading the EPT 570 AP driver If the USB driver fails to load the Windows OS will indicate that no driver was loaded for the device Next open a Windows Explorer browser Browse to the Projects_ActiveHost_xxBit EPT_Transfer_Test EPT_Transfer_Tes
63. 0 UC OUT 21 0 TRIGGER IN TRIGGER OUT r5 TRANSFER IN TRANSFER OUT BLOCK IN BLOCK OUT Page 37 B9 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Figure 6 shows how the modules of the EPT Active Transfer Library attach to the overall user project The EPT Active_Transfer_Library vqm Active_Trigger vqm Active_Transfer vqm and Active Block vgm modules are instantiated in the top level of the user project The User_Code v module is also instantiated in the top level The Active_Transfer modules communicate with the User_Code through module parameters Each module is a bi directional component that facilitates data transfer from PC to CPLD The user code can send a transfer to the Host and the Host can send a transfer to the user code This provides significant control for both data transfers and signaling from the user code to PC The Triggers are used to send momentary signals that can turn on or off functions in user code or PC The Active Transfer is used to send a single byte And the Active Block is used to send a block of data The Active_Transfer and Active_Block modules have addressing built into them This means the user can declare up to 8 individual instantiations of Active_Transfer or Active_Block and send receive data to each module separately 4 2 Active Transfer Library The Active Transfer Library contains the command contr
64. 013 3 24 PM 2 9 2013 3 24 PM 2 9 2013 3 23 PM 1 30 2013 8 43 PM Locate the ActiveHost_1 0 0 8 Bin folder and copy the ActiveHost dll and the ftd2xx dll oe N Earth People Technology EPT USB CPLD Development System CD Projects ActiveHost 64Bit ActiveHost 1 0 0 8 gt Organize v E Open with Burn New folder Ji Drivers Name i Date modified Projects_ActiveHost_32Bit 2 yon us 8 ActiveHost dll 1 19 2013 2 56 PM rojects Iveno e 8 ftd2x dll 4 13 2012 11 05 AM ActiveHost 1 0 0 8 Bin Jh EPT 570 AP Data Collector EPT Transfer Test EPTActiveHostConsoleClient J Projects Arduino Projects HOL Quartus Programmer M ESwitch J FTDI m 2 items selected Date modified 4 13 2012 11 05 AM 1 Date created 1 30 2013 8 43 PM es C Size 295 KB n T Save the DLL s in the bin x64 Release folder or bin Release folder for the 32 bit Windows 7 OS of the user project under the Microsoft C Express project See the Active Host Application for instructions on how to add the dll to the Microsoft Cf Express project Page 22 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual a ActiveHost 1 0 0 7 EPT 570 AP Active Transfer EPT 570 AP Active Transfer bin x64 X64 Organize v IM Open with Burn New folder J ActiveHost 1 0 0 4 Name E Date modified Type Size b ee 8j ActiveHost dll
65. 1 28 PM 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 9 2013 8 57 PM 3 10 2013 1 29 PM 3 9 2013 8 58 PM 3 3 2013 10 31 PM 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 10 2013 1 28 PM Type avu rie SUMMARY File RPT File JDI File RPT File SMSG File SUMMARY File PIN File POF File QPF File QSF File BAK File SDC File RPT File SUMMARY File QDF File EPT 570 AP M4 Top sdc Date modified 3 3 2013 10 31 PM SDC File Size 317 KB Date created 3 14 2013 11 33 PM and select the Start Compilation button Page 126 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual This will cause the compile and synthesization process After successful completion the screen should look like the following 3 Quartus II 64 Bit C Jolly Products Earth People Technolo HDL EPT Data Collector EPT 570 AP M4 Top EPT 570 AP M4 Top lel es File Edit View Project Assignments Processing Tools X Window Help a Search altera com Gud 438 5c mmemm MYT Eye OPV OB RES PLOD I Project Navigator Rex Compilation Report EPT 570 AP M4 Top a Entity Table of Contents 28 Flow Summary MAX II EPM570T100C5 yr Successful Thu Mar 14 23 28 43 2013 EPT_570_AP_M4_Top EPT 570 AP M4 Top E Flow Non Default Global Settings ff Flow Elapsed Time Ef Flow OS Summary Flow Log gt 3 Analysis amp Synthesis 283 570 50
66. 201311 28 PM POF File 3 9 2013 8 57 PM OPF File 3 10 20131 29 PM SF File 3 9 2013 8 58 PM BAK File 3 3 2013 10 31 PM SDC File 3 14 201311 28 PM RPT File 3 14 201311 28 PM SUMMARY File 3 10 20131 28 PM QDF File Size 317 KB Date created 3 12 2013 7 47 AM Shared with Homegroup al Copy the file and browse to c altera xxx quartus qdesigns EPT_Data_Collector directory Paste the file c an gt Computer Gateway C altera 121spl quartus qdesigns EPT Data Collector EPT 570 AP M4 Top gt Organize v _ Open Burn New folder Ji bin J bin64 di common J cusp d drivers dsp_builder n eda Jk extlibs32 N libraries di Imf d qdesigns EPT_Data_Collector EPT_Transfer_Test D fir_filter incr comp makefile vhdl verilog tutorial N sopc builder bs Name Lj EF 1 2 U AF IV LUpeHLSITISU _ EPT 570 AP M4 Top fit summary _ EPT 570 AP M4 Top flow rpt _ EPT 570 AP M4 Top jdi _ EPT 570 AP M4 Top map rpt _ EPT 570 AP M4 Top map smsg _ EPT 570 AP M4 Top map summary _ EPT 570 AP M4 Top pin _ EPT 570 AP M4 Top pof EPT 570 AP M4 Top qpf _ EPT 570 AP M4 Top qsf _ EPT 570 AP M4 Top qsf bak _ EPT 570 AP M4 Top sdc _ EPT 570 AP M4 Top sta rpt _ EPT 570 AP M4 Top sta summary _ EPT 570 AP M4 Top assignment defaul Date modified 23 15 2UL12 11 20 Fivi 3 14 2013 11 28 PM 3 14 2013 11 28 PM 3 14 2013 1
67. 313 if lreset Sile fim begin 315 trigger in detect 1 b0 316 end 317 else if trigger in reset 216 o jim begin 319 trigger in detect 1 b0 320 end 321 else if trigger in byte gt 3 h0 322 E begin 323 trigger in detect l bi 324 end 325 end et 32 jf f 328 Store the value of Trigger In 329 f a 330 always posedge CLK 66 or negedge reset 331 begin 332 if resert E begin dad trigger in store lt hor 335 trigger in reg lt 1 b0 336 trigger in reset lt 1 b0 337 end 338 else if trigger in detect amp trigger in reg HS begin 340 if trigger in byte 0 341 trigger in store 7 0 lt trigger in byte 7 0 4342 trigger in reg lt 1l bi 343 end 344 else if trigger in reg ad jim begin 346 trigger in reg lt l1 b0 347 trigger in reset lt l bl 348 end 3459 else if trigger in detect EUM begin 351 trigger in reg lt 1 b0 3592 trigger in reset lt 1 b0 393 end 3594 end 1 age 42 E B EARTHPEOPLE TECHNOL O G Y USB CPLD Development System User Manual 4 2 2 Active Transfer The Active Transfer module is used to send or receive a byte to from the Host This is useful when the user s microcontroller needs to send a byte from a measurement to the Host for display or processing The Active Transfer module is addressable so up to eight individual modules can be instantiated and separately addressed 7517 activ
68. 4 Top General Files Files Libraries 4 Operating Settings and Conditions Fle name ol th E USB CPLD De t System CD Proi HDL Transfer T s Voltage ly Products Earth People Technology EPT velopment Sys Projects HDL EPT Transfer este FO P Add Y Temperature Type Add All 4 Compilation Process Settings y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src write control logic v Verilog HDL File Early Timing Estimate y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src read control logic v Verilog HDL File RONDE Incremental Compilation y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src mem array v Verilog HDL File Physical Synthesis Optimizations y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src eptWireOR v Verilog HDL File 4 EDA Tool Settings y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src EPT 570 AP M4 Topv Verilog HDL File Design Entry Synthesis y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active triggervam Verilog Quartus Mapping Simulation y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active transfer libraryyyqm Verilog Quartus Mapping Properties Formal Verification y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active transfervam Verilog Quartus Mapping Board Level y EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active block vqm Ver
69. 41 AM QSF File EPT 570 AP M4 Top qsf bak 3 14 20131241 AM BAK File EPT 570 AP M4 Top sdc 3 3 2013 10 31PM SDC File extlibs32 libraries Imf qdesigns EPT Transfer Test db fir filter B incr_comp_makefile vhdl verilan tutorial EPT 570 AP M4 Top sdc Date modified 3 3 2013 10 31 PM Date created 3 14 2013 12 45 AM SDC File Size 3 17 KB bd Select the Start Compilation button Page 65 USB CPLD Development System User Manual Quartus I 64 Bit C altera 12 1sp1 quartus qdesigns EPT_Transfer_Te op EPT 570 AP M4 T o e 3X jJ File Edit View Project Assignments Processing Tools Window Help amp Search altera com CO DEdA kc 5c msmeem v 74 Wo c y OO ODA OF Project Navigator 28x Entity dy MAX TE EPM570T100C5 3 EPT 570 AP Md Top 4 Download Subscription Edition Free 30 Day Trial MEASURABLE ADVANTAGE iese ires F Denun SE Tasks 1x me oti Task 4 i Compile Design gt B Analysis amp Synthesis gt gt Fitter Place amp Route b B Assembler Generate programmin ww Buy Software b B TimeQuest Timing Analysis gt B EDA Netlist Writer view Quartus Il 3 Program Device Open Programmer elicit Documentation Type ID Message QD 140120 Import completed 61 assignments were written out of 83 read 0 non global assignments were skipped because of entity a
70. 44C3 3 3 EPMS7UT144C4 3 3 EPMS70T144C5 3 3 21m Companion device amp HardCopy Limit DSP amp RAM to HardCopy device resources Select Next leave defaults for the EDA Tool Settings Page 60 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual New Project Wizard b 4929 x EDA Tool Settings page 4 of 5 Specify the other EDA tools used with the Quartus II software to develop your project Run Tool Automatically N Run this tool automatically to synthesize the Run gatedevel simulation automatically afte Select Next then select Finish You are done with the project level selections i x New Project Wizard e PI 2 259 sl Summary page 5 of 5 When you click Finish the project will be created with the following settings Project directory C altera 12 0sp 1 quartus qdesigns Project name Active Transfer Example Topdevel design entity Active Transfer Example Number of files added Number of user libraries added Device assignments Family name None None None None 0 3 3V EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Next we will select the pins and synthesize the project 5 2 1 Selecting Pins and Synthesizing With the project created we need to assign pins to the project The signals defined in the top level file in this case EPT_570_AP_M4_Top v will connect directly to pin
71. 7 gt a Boards No items match your search jo EPT_570_AP_Active Transfer J EPT_570_AP_Data_Collector gt jo EPT_FT201X_Interface gt Jo EPT_FT2232_Interface gt jo EPT_FT2232H_JTAG gt EPT_FT2232H_SVF_Programmer gt J EPT_FT2232H_USBTransfer 4 EPT Transfer Test m EPT_Transfer_Test jo HSP_FT2232H_FPGA gt jo HSP_FT2232H_SPI EE iul um EE 2 Folder EPT Transfer Test 6 1 1 Setting up the C Express Environment for x64 bit The project environment must be set up correctly in order to produce an application that runs correctly on the target platform If your system supports 64 bit operation perform the following steps Otherwise if your system 1s 32 bit skip to the Section Assembling Files into the Project Visual C Express defaults to 32 bit operation If you are unsure if your system supports you can check it by going to Start gt Control Panel 2 System and Security gt S ystem Page 79 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 5 Search Control Panel Dp Adjust your computer s settings View by Category s System and Security User Accounts and Family Safety Review your computer s status Add or remove user accounts Back up your computer y Set up parental controls for any user Find and fix problems Change the theme Appearance and Personalization Change desktop background Network and Internet d View network status and tasks
72. AG Cabl Update Driver Software N 9 Ports COM amp LPT Disable D 3l Processors Uninstall b E Sound video and game controllers 4M System devices Scan for hardware changes 9 Universal Serial Bus controllers a L sundsd Enhanced PCIto USp Forerdes m F Standard Enhanced PCI to USB Host Controller g Standard OpenHCD USB Host Controller 9 Standard OpenHCD USB Host Controller USB Composite Device USB Root Hub USB Root Hub t i USR Ront Huh Launches the Update Driver Software Wizard for the selected device At the Update Driver Software Window select Browse my computer for driver software Search automatically for updated driver software Windows will search your computer and the Internet for the latest driver software for your device unless you ve disabled this feature in your device installation settings Browse my computer for driver software Locate and install driver software manually Click the Browse button and browse to the Drivers EPT_2 08 24 folder of the EPT USB CPLD Development System CD Click the Ok button Page 16 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual am 2 Ds Update Driver Software FT2232H MiniModule Browse For Folder F Browse for driver software on your computer Search for driver software in this location Documentation 4 Drivers M Arduino 1 0 1 4 EPT_2 08 24
73. AP Gs lt lt Search gt gt Hax Type ID Message Op 12128 Elaborating entity eptWireOR for hierarchy eptWireOR wireOR QD 12128 Elaborating entity active trigger for hierarchy active trigger ACTIVE TRIGGER INST Gp 12128 Elaborating entity active transfer for hierarchy active transfer ACTIVE TRANSFER INST p 12128 Elaborating entity active block for hierarchy active block BLOCK TRANSFER INST e 12006 Node instance BLOCK IN FIFO instantiates undefined entity sync fifo wD 144001 Generated suppressed messages file C altera 12 1sp1 quartus qdesigns EPT Transfer Test output files EPT 570 AP M4 Top m b e Quartus II 64 Bit Analysis amp Synthesis was unsuccessful 1 error e 293001 Quartus II Full Compilation was unsuccessful 3 errors 3 warnings a ee 3 warnings Messages Click Ok the select the Error tab to see the error Page 67 9 00 00 02 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual m f Quartus I 64 Bit C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test EPT_570_AP_U2 Top EPT_570_AP_U2 Tee ee File Edit View Project Assignments Processing Tools Window Help 57 Search altera com Oa X 3 3 amp 5 M ETSOA Va Top MY HEDE ODE ORLA F Project Navigator fax amp Compilation Report EPT 570 AP U2 Top B Entity Table of Contents Ra Flow Summary A MAX I EPM570T100C5 EB Flow Summary Flow Status Flow F
74. Arduino Uno on COM4E EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual e To load the code click on the Upload button Arduino Data Collector Code Arduino 1 0 Arduino Data Collector Code Earth People Technology Inc Data Collector Random Seed Platform Uno int count 0 int ledPin 13 void setup DDRD B11111111 Set Port D as outputs PORTD Bllllllll Turn on Port D pins pinMode A0 OUTPUT pinMode ledPin OUTPUT Arduino Uno on COMAS When the code has completed loading the Arduino IDE will automatically command the processor to start executing the code The L LED will blink at one second intervals MADE IN ITALY LN ae Vv U o z H 2 a a od 7 1 7 CPLD Active Transfer Coding and Initiation The EPT 570 AP will accept the data collected by the Arduino and transfer it to the PC It is designed to plug directly into the Arduino MEGA and there is no need for external wires to be added The Active Transfer Library can be used to send the data to Page 111 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual the PC This library has been designed to make it easy to transfer data to and from the PC via the USB The user must create some interface code between the incoming data and the Active Transfer Library We will now go through exercise of creating the CPLD code for the Data Collector Sampler 7 1 8 CPLD
75. Aters marks n and outside the U S Do not show me the warning for fis program agan oem j Berit alow Click on the Allow button This will bring up the Save As dialog box Save the altera installer external exe to a download file d gt Computer Gateway C Jolly Download Altera Quartus I X dd Search Quartus ll Organize v New folder T E Recent Places Name Date modified eG 11 1sp2 259 quartus free windows exe 6 15 2012 3 18 PM Application eG 12 0sp1 232 quartus free windows exe 8 11 201211 20 AM Application G 12 1_177_quartus_free_windows exe 11 25 2012 10 54 Application G 12 1sp1_243_quartus_free_windows exe 3 3 2013 1 12 AM Application altera installer external exe 5 20 20128 52 PM Application 53 Libraries B Documents d Music i Pictures B Videos wj Homegroup Folly HP DESKTOP 3005 jM Computer amp Gateway C KINGSTON urDrive H SIN malc fd altera installer external exe 7 84 MB 22 19 MB 35 done S ABIERTAS 7 Close window when done Launch when done II Pause Exit 226 When it finishes click the Launch button 25 Altera Download Manager Finished CAII D windo hy when done 5i Launch when done 25 9 9 jan Page 52 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Click Ok and Yes to the following screen Click Next on the Introduction Window a Installer
76. C to be decoded by the Active_Host DLL NE User Switch Trigger ff2 always posedge CLK IN or negedge RST begin if RSTI begin trigger out lt 8 h00 end else begin if 5W USER 1 trigger out lt hol else if 5W USER 2 trigger out lt 8 h02 else if switch reset trigger out lt 8 h04 else trigger out lt 8 h00 end end Page 117 E EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Next we will add the transfer detection signal from the Arduino This block will require three registers e transfer write reg This is a latch register to hold the state of the C Enable e transfer write This register 1s used to start the active transfer single byte write to the PC e transfer write byte This is an 8 bit register to hold the value of the Data Collection output This block will compare the input signal on LB BYTE BIO to a high The LB BYTE B 0 pin is routed to Pin 3 of JS which is routed to the C Enable of the Arduino Data Collector When this bit goes high the priority encoder goes into statement and sets transfer write reg and transfer write high and latches the value on the LB BYTE CT 7 0 pins to the transfer write byte register By setting transfer write reg high the priority encoder goes into statement 2 which will set transfer write register to low and stay in statement 2 of the priority encoder The back to back high and
77. C5 gt ft 245 state machine FT 245 STATE M B Flow Log Se E abd active trigger ACTIVE TRIGGER INST 3 Analysis amp Synthesis eee mna e EE o ER x z Total logic elements 554 570 97 4 y me ae a aid Total pins 61 76 80 abd mem_array U_MEM_ARRAY Assemble p Total virtual pins 0 Gs ee Quartus I 4 UFM blocks 0 1 0 Ay Hierarchy Files a Design Units o Full Compilation was successful 58 warnings Tasks Flow Compilation X C Task 4 i Compile Design Br Analysis amp Synthesis gt Fitter Place amp Route W Assembler Generate programmin i TimeQuest Timing Analysis b EDA Netlist Writer w Program Device Open Programmer 992229 gt gt n Type ID Message Jp 332102 Design is not fully constrained for hold requirements J Quartus II 64 Bit TimeQuest Timing Analyzer was successful 0 errors 6 warnings p p OR EER EER EER 2 2 2 5 I 2 I mci p Running Quartus II 64 Bit EDA Netlist Writer 4 Command quartus eda read settings files off write settings files off EPT 570 AP M4 Top c EPT 570 AP M4 Top 4p 204018 Generated files EPT 570 AP M4 Top vho and EPT 570 AP M4 Top vhd sdo in directory C altera 12 1spi quartus qdesigns p Quartus II 64 Bit EDA Netlist Writer was successful 0 errors 0 warnings ay 293000 Quartus II Full Compilation was successful 0 errors 58 warnings J T M
78. CONTROL BYTE1 transfer control state lt TRANSFER CONTROL IDLE else transfer control state lt TRANSFER CONTROL IDLE TRANSFER CONTROL HDR1 if transfer in byte TRANSFER CONTROL BYTE2 transfer control state lt TRANSFER CONTROL HDR2 else if transfer in byte TRANSFER CONTROL BYTE2 transfer control state lt TRANSFER CONTROL IDLE else transfer control state TRANSFER CONTROL HDR1 TRANSFER CONTROL HDR2 i i i if trans fer in byte TRANSFER CONTROL BYTE3 transfe r cont rol state lt TRANS FER DECODE BYTE else iff transfer in byte I TRANSFER CONTROL BYTE3 transfer control state lt TRANS FER CONTROL IDLE else i i i i transfer control state lt TRANSFER CONTROL HDR TRANSFER DECODE BYTE g i i begin i i start stop cntrl lt transfer in byte oO led reset transfer in byte 2 auitch reset lt Erauafe r din byte 3 1 7 trans fer in loop back lt rans fer in byte 4 transfe r cont rol state lt TRANS FER CONTROL SET end i i i i TRANSFER CONTROL SET begin E transfer control state lt TRANSFER CONTROL IDLE end endcase end else if transfer in received amp transfer in received reg transfer in received reg lt 1 bD end end Page 121 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Next up is the instantiation for the active_transfer_library The ports include the input and output pins and the two buses that connect the active modules
79. Define the User Design In this step we will define the user s code and include modules from the EPT Active Transfer Library The Active Transfer Library contains a set of files with a vm name extension which select particular operations to perform e g byte transfer block transfer trigger The active_transfer_library vqm file must be included in the top level file of the project The function modules will connect to the active_transfer_library and provide a path to connect user code to the library All of these files are available on the Earth People Technology website TRIGGER ENDTERIV ACTIVE TRANSFER LIBRARY SINGLE TRANSFER ENDTERM USER CODE BLOCK ENDTERM We will build our CPLD project using Quartus II software from Altera The primary file defining the user s CPLD project is named EPT_570_AP_M4_Top v It defines the user code and connects the active_transfer_library and active_transfer logic functions In order to route the pins of the Arduino to the CPLD the Pin Planner tool is used This tool allows the user to match internal net names to the pins of the CPLD Our project needs to accept an 8 bit value on the J3 connector and a write enable on Pin 3 of J5 For this we can use the active transier vgm module as the interface to the Page 112 A EARTHPEOPLE TECHNOL O G Y USB CPLD Development System User Manual active transfer library It acce
80. Development System User Manual public void Receive Trigger In object sender EventArgs e 1 switch ept data Payload 1 case BxBl llableswitchl Text Switch 1 n Pressed break case Bx82 llableswitch2 Text Switch 2 n Pressed break case x64 lLableswitchl Text llableswitch2 Text break T The receive callback method is complex however Earth People Technology has created several projects which implement callbacks Any part of these sample projects can copied and pasted into a user s project 3 4 4 Active Host Byte Transfers The Active Host Byte Transfer EndTerm is designed to send receive one byte to from the EPT Device To send a byte to the Device the appropriate address must be selected for the Transfer module in the CPLD Up to eight modules can be instantiated in the user code on the CPLD Each module has its own address private void btnWriteByte Click object sender EventArgs e i int ibyte address to device ibyte Convert ToInt32 tbNumBytes Text address to device Convert ToInt32 tbAddress Text EPT AH SendByte address to device charjibyte T Use the function EPT AH SendByte to send a byte the selected module First open the EPT device to be used with EPT AH OpenDeviceBylndex Then add the address of the transfer module as the first parameter of the EPT AH SendByte function Enter the byte to be transferred in the second parameter Then execute the function the byte will
81. ER OUT or trigger in reset or reset 281 begin 282 if reset 283 trigger to host 6 ho 284 else if trigger in reset 285 trigger to host 8 h0 286 else if TRIGGER OUT gt 8 h0 287 trigger to host TRIGGER OUT 288 end 289 290 j f 291 Reset Trigger Out to Host 292 jf f 293 always posedge CLK 66 or negedge reset 294 begin 295 1f reset 296 begin 297 trigger in reset lt 0 298 end 95 else 300 begin 201 if trigger to host gt 0 302 trigger in reset lt 1 bl 303 else 304 trigger in reset lt 0 305 end 306 end So care should be used if the user code uses byte masks to send triggers It is best to set only the trigger bits needed for a given time when sending triggers The user code must be setup to receive triggers from the Host This can be done by using an asynchronous always block Whenever a change occurs on a particular trigger bit or bits a conditional branch can detect if the trigger bit 1s for that block of code Then execute some code based on that trigger Page 41 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 308 ff 2 2 2 2 2 2 2 2 308 Detect Trigger In 310 ff4 311 always trigger in byte or trigger in reset or reset 312 begin
82. External Trigger The External Trigger function will pause the incoming characters on a serial port until a selected character or string appears on the selected trigger serial stream This allows the user to capture an event that may be difficult to see when a serial stream is continuously updating the serial terminal window Page 148 gt EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual APPENDIX I List of Abbreviations and Acronyms EPT Earth People Technology FIFO First In First Out FTDI Future Technology Device International HSP Hyper Serial Port l2C Inter Integrated Circuit JTAG Joint Test Action Group PC Personal Computer CPLD Complex Programmable Logic Device USB Universal Serial Bus APPENDIX Il Details of the Altera EPM570 CPLD Page 149
83. G EG 32 3 5 Active Host Test Application sees GEE AA De GE AE GEE Ee be 35 Be ACN PATS C0 PICS EM 37 4 EPT Active Transfer System Overview ccccccccccsssseesseeeeeeeeeaeeeeseeeeeeeeeeaaas 37 elwe rise Ibn ee 38 NEE M Bul ETE 40 NAP MEME CIR RC e EN A OE 43 MED eo sees 45 4 3 Timing Diagram for Active Transfer Methods ccccccccccccccesseeeeeeeeeeeeeeees 48 4 3 1 Aftve Trigger EndTerm TIMING ses cie cort oti ee ete cies serbe 48 43 2 Active Transfer End Perin THE asses sies RR is SHE ENG ERG SR EN RS EN dnas 48 4 3 3 Active Block EndTerm Timing essen 49 5 Compiling Synthesizing and Programming CPLD eeeeeeeess 49 5 Downloading and Installing uartuS esse ee ee ee ee AR de ee ee 50 5 2 Setting up the Project and COBIDIDIDP sisie RR ee Ge SE De 56 5 21 sele tins Pins and Synthesizing osse derde AE en ER GE RE SA on rosa 62 52 2 Programming the CPLD iss ssssee as ss alonso o ae sae onkran 69 6 Assembling Building and Executing a NET Project on the PC 75 DI CCU DE ie CCC asic csc OE OO N OE N OE EE eN 75 Page 2 fb EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 6 1 1 Setting up the C Express Environment for x64 bit 79 6 2 Assembling Filesinto the Project sieke IR N de GR Dee 86 VN EE osi revo e ME EU PEE UC 87 622 Add riles ie Proe l os ER MA
84. Ji obj Properties ud 2 2 items selected State BB Shared Size 278 KB Shared with Homegroup C Date modified 1 18 2013 3 54 PM 3 2 Date created 3 2 2013 11 29 PM Save the project 6 2 5 Building the Project Building the EPT Transfer Test project will compile the code in the project and produce an executable file To build the project go to Debug gt Build Solution EPT Transfer Test File Edit View Project Debug Data Tools Window Help gl gt CF d r P Start Debugging F5 PC X ha ae Ife m Build Solution EET dl 4 WW Solution Explorer Step Into Fil Designer cs Form1 cs Design active_transfer cs Toolbox vax EIE J GF step ov no m gt E2 ES ie E3 G E raid PT Transfer Test 39 btnClose Click object sender System EventAn General S 5g Solution EPT_Trar Toggle Breakpoint F9 ock Transfer Control ES uM al EPT Transfer EE gt ic bool BlockTransferInfinite false 2 kl a Properties ic bool BlockTransferReps false 3 E References Clear All DataTips ic bool BlockTransferStop false i 4 Export DataTips Bi active trary 2 late void btnOpen_Click object sender System EventArgs e 4 5 Form1 cs Import DataTips N od Options and Settings Open_Selected_Device Formi r Program cs E private void btnClose Click object sender System EventArgs e Properties vax if m_h
85. LD Development System User Manual Forml1 cs Design t Data_Collector Data_Collector ii TRIGGER OUT COMMAND Ee Solution Data Collector 1 project Parameters 4 da Data Collacter nublic const byte TRIGGER OUT COMMAND 6x1 Ba Prop ES Build blic const byte TRANSFER OUT COMMAND 6x2 blic const byte BLOCK OUT COMMAND 6x4 gt sj Refer Rebuild E activ Mj Publish a E Form Add gt Main object loader a F ivate void Data_Collector_Load object sender System EventArgs e d Prog Add Reference Add Service Reference Call the List Devices function Set as StartUp Project ListDevices Debug gt Cut Ctrl X Th Paste Ctrl V Main connection function Renne Del ivate unsafe Int32 ListDevices Rename Int32 result Properties Int32 num_devices Int32 iCurrentIndex Open the DLL result EPT AH Open null null null if result Verify that the Platform ELE has Active x64 selected from the drop down box Solution Explorer Forml cs active transfer cs Formi cs Design Im 5d Solution Data Collector 1 project Application 4 EI Data Collector Configuration Active Release z Platform Active x64 Y gt Sa Properties Build gt b3 References j General E active transfer cs EC 4 E Forml cs De Conditional compilation symbols Formi Designer cs Define DEBUG constant 4 Program cs R
86. Malayalam Q21WIGo Tamil Siflrp Thai aang Choose Language Microsoft Captions Language Interface Pack CLIP The Microsoft Captions Language Interface Pack CLIP uses tooltip captions to display translations for common user interface elements in the Visual Studio integrated development environment IDE Use CLIP as a language aid to see translations in your own dialect update results in your own native tongue or as a learning tool Arabic amp sll Greek EAAnviKa Hebrew nav Hindi erar Hungarian Magyar Malay se vole Malayalam Q amp X928o Oriya coge Tamil sufi OO Visual CF 2010 Express Welcome to the Microsoft Visual C 2010 Express installation wizard Microsoft Visual C 2010 Express is a fun simple and easy to learn development tool for C programmers interested in creating Windows Forms Windows Presentation Foundation WPF as well as class libraries and console based applications This wizard will guide you through the installation process If this product requires any prerequisites that are not currently installed on this computer you will be able to install those prerequisites as well Help Improve Setup You can submit information about your setup experiences to Microsoft To participate check the box below Yes send information about my setup experiences to Microsoft Corporation i For more information click Privacy Statement E Page 76 EARTHPEOPLE
87. Mp Programmer C altera 12 1spl quartus adesigns EPT Transfer Test EPT 570 AP M4 Top EPT 570 AP M4 Top Chain4 cdf File Edit View Processing Tools Window Help 57 Hardware EPT Blaster v1 3b MBUSB 0 File output files EPT 570 A EPM570T100 CFM UFM 002CDD25 A Click on the Start button to to start programming the CPLD The Progress bar will indicate the progress of programming lp Programmer C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test EPT_570_AP_M4_Top EPT 570 AP M4 Top Chain4 cdf 4 File Edit View Processing Tools Window Help 5 Search altera com ge PUE Hardware Setup PT Blaster v1 3b MBUSB 0 Mode JTAG E Enable real time ISP to allow background programming for MAX II and MAX V devices Poges PEEN a iy Auto Detect Delete By Add File s Change File Iy save File 29 Add Device fi up qoom Fil Device output files EPT 570 A EPM570T100 CFM UFM 002CDD25 Checksum Usercode Program Configure Verify FFFFFFFF Blank Examine Security Erd Check Bit When the programming is complete the Progress bar will indicate success W Programmer Caltera 12 1spl quartus adesigns EPT Transfer TesVEPT 570 AP M4 Top EPT 570 AP M4 Top Chain4 cdf File Edit View Processing
88. OCK ENDTERM at the commensurate EndTerm in the Active Host user application The transfer through the USB is transparent User HDL code doesn t need to set up Endpoints or respond to Host initiated data requests The whole process is easy yet powerful 2 EPT Drivers The EPT USB CPLD Development system requires drivers for any interaction between PC and the EPT 570 AP M4 The communication between the two consists of programming the CPLD and data transfer In both cases the USB Driver is required This will allow Windows to recognize the USB Chip and setup a pathway for Windows to communicate with the USB hardware 2 1 USB Driver The EPT 570 AP uses an FTDI FT2232H USB to Serial chip This chip provides the USB interface to the PC and the serial FIFO interface to the CPLD The FT2232H requires the use of the EPT USB driver To install the driver onto your PC use the EPT 2 08 24 Folder The installation of the EPT 2 08 24 driver is easily accomplished using the Update Driver Software utility in Device Manager Locate the EPT 2 08 24 folder 1n the Drivers folder of the EPT USB CPLD Development System CD using Windows Explorer Page 13 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Jolly Products Earth People Technology EPT USB CPLD Development System CD Drivers gt SE ET New folder z HN 9 Organize Include in library v Share with v Burn d Products Z Earth People T
89. Port 1 fContinue false SN El it will stop in x seconds not sure if this is proper Thread Sleep 8 FT Close m hPort m hPort n gt radNumber Checked true m S Solution Explorer ELSE ST Error List Q 0 Errors jy 2 Wamings i 0 Messages Description D Error List E Msn bnc Ready Ln 58 Col 35 Ch 35 INS The C Express compiler will start the building process If there are no errors with code syntax function usage or linking then the environment responds with Build succeeded Page 95 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual i Error List E Find Results Build succeeded 6 2 6 Testing the Project Once the project has been successfully built it produces an exe file The file will be saved in the Release or Debug folders i QUO EPT USB CPLD Development System CD Projects ActiveHost 64Bit EPT Transfer Test EPT Transfer Test gt bin x64 Release GE Organize v Open Share with v Burn New folder Arduino IDE a Name Date modified Type Size I Documentation p ae B De S ActiveHost64 dll 3 2 2013 9 44 PM Application extens 27 KB rivers d 7 m EPT Transfer Test exe 3 2 2013 11 28 PM Application 28 KB di Projects_ActiveHost_32Bit E j j EPT Transfer Test pdb 3 2 2013 11 28 PM Program Debug D 56 KB Projects ActiveHost 64Bit
90. R m EPT Transfer Test vshost exe 3 2 201311 21 PM Application 12 KB M ActiveHost_1 0 0 8 f EPT Transfer Test vshost exe manifest 8 31 2009 12 40 AM MANIFEST File 1KB Jh EPT_Data_Collector S ftd2o64 dll 1 18 2013 3 34PM Application extens 252 KB J EPT Transfer Test J EPT Transfer Test Ji bin B Debug d Release 64 d Debug Release Ji obj di Properties x EPT Transfer Test exe State 2B Shared Size 28 0 KB Shared with Homegroup Fr Application Date modified 3 2 2013 11 28 PM Date created 3 2 2013 11 29 PM C E rr The EPT_Transfer_Text exe file can now be tested using the EPT 570 AP M4 board To test the file connect the EPT 570 AP M4 to the Windows PC using Type A to Type Mini B USB cable Make sure the driver for the board loads If the USB driver fails to load the Windows OS will indicate that no driver was loaded for the device Go to the folder where the EPT Transfer Test exe file resides and double click on the file The application should load with a Windows form Page 96 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Switch Controls Switches Bytes Transfemed With the application loaded select the USB CPLD board from the dropdown combo box and click on the Open button Page 97 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual a9 EPT Transter Test LLL Ue eee ag EPT USB lt gt Serial amp JTAG Ca
91. StopBit variable stores the state of DigitalPin19 Then a delay of 500 milliseconds is added The delay function pauses the program for the amount of time in milliseconds specified as parameter Next the startStopBit is checked with a conditional switch If the bit 1s set the conditional branch is entered and the random number is sent to the EPT 570 AP If the bit 1s not set the end of the loop function is reached and it branches to the top of the loop We will also add an LED Pin that will blink so that we can have a visual indication that the project is working Page 103 f EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual We want to add a delay so that the data from the generated displays on the Windows PC long enough for our eyes to verify that the data is updating correctly This delay should be one second in total So the data will change then stay stable in the textbox for one second before changing again For the LED to blink correctly it should turn on delay for half a second then turn off and delay for half a second If we don t use half second intervals for the LED blink the LED will appear to not change at all It will look like it stays on all the time or off all the time So the code looks like this Page 104 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual FA Copyright Earth People Technology Inc 2013 Data Collector Random Seed Platform EPT 57 0 AP M4
92. TParseReceive object sender System EventArgs e i switch EPTReceiveData Command i case TRIGGER OUT COMMAND TriggerOutReceive break Case TRANSFER OUT COMMAND TransferOutReceive break case BLOCK OUT COMMAND BLockOutReceive break default break Page 34 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual The EventHandler function EPTParseReceive is called by the Read Callback function The EPTParseReceive function will examine the command of the incoming byte transfer and determine which receive function to call public void Receive Block In object sender EventArgs e i device ept data Address TransferPending false Thread Sleep 5 if device ept data Address ContinuosCountTest false i Thread t new Thread new ParameterizedThreadStart BlockCompare t Start ept data Address if device ept data Address Repititions 8 i Thread u new Thread new ParameterizedThreadStart Display Block In u Start BlockCount else if BlockTransferInfinite device ept data Address ContinuosCountTest i if BlockCount 188 8 i Thread u new Thread new ParameterizedThreadStart Display Block In u Start BlockCount T T For our example project the Receive Block In function writes the Transfer block received to a text block The receive callback method is complex however Earth People Technology has created several projects which 1mplement callbacks Any par
93. TRIGGER IN e TRANSFER IN e BLOCK IN EPT AH SendTrigger char 1 Page 28 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual unsafe void EPTReadFunction Int32 device id Int32 device channel byte command byte payload i T byte message data di Select current device EPT AH SelectActiveDeviceByIndex device id Add command and device channel to the receive object EPTReceiveData Command command amp 8x38 gt gt 3 EPTReceiveData Address device channel Check if the command is Block Receive If so use Marshalling to copy the buffer into the receive object if EPTReceiveData Command BLOCK OUT COMMAND i EPTReceiveData Length data size EPTReceiveData cBlockBuf new Byte data size Marshal Copy new IntPtr message EPTReceiveData cBlockBuf 6 data size UpdateTextBlock T else i EPTReceiveData Payload payload this Invoke new EventHandler EPTParseReceive private void EPTParseReceive object sender System EventArgs e i T switch EPTReceiveData Command i Case TRIGGER OUT COMMAND TriggerOutReceive break Case TRANSFER OUT COMMAND TransferOutReceive break case BLOCK OUT COMMAND BLockOutReceive break default break I The event handler function for the TRIGGER IN s uses a switch statement to determine which trigger was asserted and what to do with it Page 29 A EARTHPEOPLE TECHNOLOGY USB CPLD
94. Writer Command quartus eda read settings files off write settings files off EPT 570 AP M4 Top c EPT 570 AP M4 Top up 204018 Generated files EPT 570 AP M4 Top vho and EPT 570 AP M4 Top vhd sdo in directory C altera 12 1sp1 quartus qdesigns b WD Quartus II 64 Bit EDA Netlist Writer was successful 0 errors 0 warnings WD 293000 Quartus II Full Compilation was successful 0 errors 58 warnings Messages The Programmer Window will open up with the programming file selected Click on the Hardware Setup button in the upper left corner Y Programmer C altera 121spl quartus adesigns EPT Transfer TesVEPT 570 AP M4 Top EPT S70 AP MA Top Chaim cd ts File Edit View Processing Tools Window Help gt Search altera com Cu a vae me Site ele Enable real time ISP to allow background programming for MAX II and MAX V devices Checksum Usercode Blank Check Program Examine Era Configure Verify Security E ipu Start Bit wb Stop sh Auto Detect XX Delete Mice a Change File E Save File 23 Add Device pu Down The Hardware Setup Window will open In the Available hardware items double click on EPT Blaster v1 3b Page 70 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Rn Hardware Setup DS Hardware Settings Select a programming hardware setup to use when pr
95. ailed Wed Mar 13 21 28 50 2013 abd active transfer ACTIVE TRANSFER INST AB Flow Non Default Global Settings Revision Name EPT 570 AP U2 Top abd active transfer library ACTIVE TRANSFER L Ef Flow Elapsed Time fpe Entity Name EPT_570_AP_U2_lop abd active trigger ACTIVE TRIGGER INST EA Flow OS Summary od ote 3 sync fifo BLOCK IN FIFO B Flow Log Device MARTIN g B Timing Models Final abd active block BLOCK TRANSFER INST gt Analysis amp Synthesis abd eptWireOR wireOR Ay Hierarchy BlFies 3 Design units hase Tasks hex Flow Compilation v customize Task x gt B Analysis amp Synthesis gt B Fitter Place amp Route gt BW Assembler Generate programmin b B TimeQuest Timing Analysis gt BW EDA Netlist Writer 3 Program Device Open Programmer TGA aP L9 FY lt lt Search gt gt v Type ID Message 12006 Node instance BLOCK IN FIFO instantiates undefined EQ CET b e Quartus II 64 Bit Analysis amp Synthesis was unsuccessful 1 error Warnings e 293001 Quartus II Full Compilation was unsuccessful 3 errors 3 warnings x 4 gt Compile Design AU X m r Messages 9 00 00 03 The error in this case is the missing file sync fifo Click on the Assignment menu then select Settings then select Files Add the sync fifo v file from the database Settings EPT 570 AP M
96. appear in the ports of the Active Transfer module in the user code on the CPLD To transfer data from the CPLD Device a polling technique is used This polling technique is because the Bulk Transfer USB is a Host initiated bus The Device will not transfer any bytes until the Host commands it to If the Device has data to send to the Host in an asynchronous manner meaning the Host did not command the Device to send data the Host must periodically check the Device for data in it s transmit FIFO If data exists the Host will command the Device to send it s data The received data is Page 30 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual then stored into local memory and register bits are set that will indicate data has been received from a particular address To receive a byte transfer from the Active host dll user code must subscribe to the event created when the incoming byte transfer has arrived at the Read Callback function The Read Callback must store the incoming transfer payload and module address in a local memory block A switch statement is used to decode which event should be called to handle the incoming received data The event handler function will check for any bytes read for that address unsafe void EPTReadFunction Int32 device id Int32 device channel byte command byte payload i byte message data Select current device EPT AH SelectActiveDeviceByIndex device id Add comman
97. ble B Transfer Controls Send Byte 255 Address 2 Receive Byte Multiple Byte 255 Block LoopBack Repititions 1 5 Infinite Bytes Transferred Click on one of the LED buttons in the middle of the window The corresponding LED on the EPT 570 AP M4 board should light up To exercise the Single Byte Transfer End Term click the LoopBack button in the Transfer Controls group Type in several numbers separated by a space and less 256 into the Multiple Byte textbox Then hit the Multi Byte button The numbers appear in the Receive Byte textbox Page 98 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual oJ EPT Transfer Test X j EFT USB lt gt Serial amp JTAG Cab Transfer Controls Send Byte 255 Address 02 Receive Byte 124 42 32 66 Multiple Byte 124 42 92 66 Switch Controls LED Controls Switches ds pogga Block Controls Bytes Transfemed To exercise the Block Transfer EndTerm click the Block8 or Block16 button in the Block Controls group A pre selected group of numbers appear in the Block Receive textbox Page 99 E39 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual uil EPT Transfer Test Le mmm EFT USB lt gt Seral amp lTAG Cab Transfer Controls Send Byte 255 Address 07 Receive Byte Bre LoopBack Multiple Byte 0 ETT Switch Controls LED Controls LED s G G EE Switches Fst
98. called from the Active Host dll This function start a thread to do something with the block data To receive a byte transfer from the callback function user code must subscribe to the event created when the incoming byte transfer has arrived at the Read Callback function The Read Callback must store the incoming transfer payload and module Page 33 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual address in a local memory block A switch statement is used to decode which event should be called to handle the incoming received data The event handler function will check for any bytes read for that address unsafe void EPTReadFunction Int32 device id Int32 device channel byte command byte payload i byte message data Select current device EPT AH SelectActiveDeviceByIndex device id Add command and device channel to the receive object EPTReceiveData Command command amp 8x38 gt gt 3 EPTReceiveData Address device channel f Check if the command is Block Receive If so use Marshalling to copy the buffer into the receive object if EPTReceiveData Command BLOCK OUT COMMAND i EPTReceiveData Length data size EPTReceiveData cBlockBuf new Byte data size Marshal Copy new IntPtr message EPTReceiveData cBlockBuf 60 data size UpdateTextBlock i else i EPTReceiveData Payload payload I this Invoke new EventHandler EPTParseReceive private void EP
99. component that provides a direct path from the users application to the commensurate Transfer EndTerm in the CPLD It is used to transfer a byte to and from the CPLD Eight separate Transfer EndTerm modules can be instantiated 1n the CPLD Each module is addressed by the user application Sending a byte is easy just use the function call with the address and byte value The byte is immediately sent to the corresponding EndTerm in the CPLD Receiving a byte 1s just as easy a callback function is registered at initialization When the CPLD transmits a byte using its EndTerm the callback function is called in the user application The user code must store this byte in order to use it The incoming Transfers are stored in a circular buffer in memory This allows the user code to fetch the transfers with out losing bytes 3 3 Block EndTerm The Block EndTerm is a software component that provides a direct path from the users application to the commensurate Block EndTerm in the CPLD The Block EndTerm is used to transfer a complete block to the CPLD Block size is limited to 1 to 256 bytes Eight separate Block EndTerm modules can be instantiated in the CPLD Each module is addressed by the user application Sending a block is easy just use the function call with the address block length byte array The block is buffered into a circular buffer in memory then transmitted via the USB bus to the Block EndTerm in the CPLD Receiving a block is just as easy a
100. ction will outline the procedures to take an example project and Assemble it Build it and Execute it This guide will focus on writing a Windows Forms application using the C language for the Microsoft Visual Studio with NET Framework This is due to the idea that beginners can write effective Windows applications with the C NET Framework They can focus on a subset of the language which is very similar to the C language Anything that deviates from the subset of the C language presented as in the Arduino implication such as events and controls will be explained as the explanation progresses Any language can be used with the Active Host Application DLL 6 1 Creating a Project Download the latest version of Microsoft Visual C 2010 Express environment from Microsoft It s a free download http www microsoft com visualstudio eng downloads d 2010 express Go to the website and click on the icon next to the Visual C 2010 Express Page 75 EARTHPEOPLE TECHNOLOGY USB CPLD Development ystem User Manual bQj Visual Studio Products ALM Download Buy DOWNLOAD Prerelease software Visual Studio 2010 Express Visual C 2 Express Visual C 2010 Express 2012 editions 2012 Express 2010 Express Additional software Readme Visual C 2010 Express Build custom applications in Visual C a simple powerful type safe and object oriented language that enables rapid application dev
101. cumentation x86 4 di Drivers J Arduino 1 0 1 gt J EPT_2 08 24 4 EPT Blaster J x64 Jh x86 gt Projects ActiveHost 64Bit n Projects Arduino N Projects HOL di Quartus_Programmer k 2 items om If your system is Windows 64 bit follow these directions Windows 64 bit l px cet Open the CAEPT USB CPLD Development System CD Drivers EPT_Blaster x64 folder Select the file jtag hw mbftdi blaster dll and copy it Browse over to C altera 12 1 quartus bin64 Right click in the folder and select Paste Click Ok Open the Quartus II application b i gt Computer Gateway C altera 121 quartus bin64 gt x Organize v m7 Open with Burn New folder dp Name E Date modified Type Size bb nios2eds jam2 jam 11 7 200128 33PM JAM File 265 KB Ji quartus jam2 icjam 11 7 2028 33PM JAM File 264 KB Ji bin 8 jtag atlantic dll 11 7 2012 8 39 PM Application extens 20 KB bs bin64 8 jtag client dll 11 7 20028 38PM Application extens 206 KB Ji common uj amp jtag hw mbftdi blaster dil 1 16 201310 37 PM Application extens 67 KB J cusp jtag hw pli blaster dll 11 7 20128 39 PM Application extens 33 KB Ji drivers jtag hw usb blaster dll 11 7 20028 39PM Application extens 17 KB Jo dsp_builder amp jtag_hw_virtual_chain dll 11 7 20128 38 PM Application extens 34 KB J eda jtag pli blaster vpi dll 11 7 2012 8 39 PM Application exten
102. d Marshaling is an advanced topic and will not be covered in this manual When EPTReadFunction callback is called and passed parameters from the Active Host dll it populates the EPTReceiveData object It then calls EPTParseReceive function This function uses a case statement to call the TransferOutReceive function private void EPTParseReceive 1 switch EPTReceiveData Command 1 case TRANSFER OUT COMMAND TransferOutReceive break default break I l TransferOut Receive creates a string from the EPTReceiveData Payload parameter Then sends the string to the textbox tbDataB ytes Page 139 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual public void TransferOutReceive i string WriteRcvChar WriteRcvChar String Format 180 int EPTReceiveData Payload tbDataBytes AppendText WriteRcvChar Controls such as buttons are added to the Forml cs Design window which allow turning on and off signals These include e btnWriteByte btnTransterReset btnOk btnClose btnResetBlock Refer to section 6 1 4 Adding Controls to the Project for details about using the ToolBox to place controls on a design The btnWriteByte click event calls the EPT AH SendTransferControlIB yte This function is used to turn on off bits in the Control Register in the CPLD code The btnWriteByte will set the start stop cntrl signal 1n the CPLD to one This signal starts the Arduino Data Collec
103. d and device channel to the receive object EPTReceiveData Command command amp 8x38 gt gt 3 EPTReceiveData Address device channel Check if the command is Block Receive If so use Marshalling to copy the buffer into the receive object if EPTReceiveData Command BLOCK OUT COMMAND i EPTReceiveData Length data size EPTReceiveData cBlockBuf new Byte data size Marshal Copy new IntPtr message EPTReceiveData cBlockBuf data size UpdateTextBlock I else i EPTReceiveData Payload payload this Invoke new EventHandler EPTParseReceive Page 31 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual private void EPTParseReceive object sender System EventArgs e i switch EPTReceiveData Command i case TRIGGER OUT COMMAND TriggerOutReceive break case TRANSFER OUT COMMAND TransferOutReceive break case BLOCK OUT COMMAND BLockOutReceive break default break 3 The EventHandler function EPTParseReceive is called by the Read Callback function The EPTParseReceive function will examine the command of the incoming byte transfer and determine which receive function to call public void TransferOutReceive i string WriteRcvChar WriteRcvChar String Format int EPTReceiveData Payload tbDataBytes AppendText WriteRcvChar tbAddress Text String Format x2 uint System Convert ToUInt32 EPTReceiveData Address ToStri
104. detailed in section 3 and subsequent sections 4 Active Transfer Library The Active Transfer Library is an HDL library designed to transfer data to and from the EPT 570 AP via High Speed 480 MB s USB It is a set of pre compiled HDL files that the user will add to their project before building it The description of what the library does and how to use its components are described in this manual ACTIVE HOST APPICATION EPM570 PLD TRIGGER IN TRISCEE ACTIVE TRANSFER TRIGGER IN le USER CODE TRIGGER OUT LIBRARY ay TRIGGER OUT FTD2XX TRANSFERIN amp TRANSFER DLL USB USB BUS E ou aad 8 BIT BUS ARDUINO TRANSFER OUT DRIVER BLOCK IN BLOCK IN BLOCK E aa M BLOCK OUT 4 1 EPT Active Transfer System Overview The Active Transfer System components consist of the following active transfer library vqm active trigger vqm active transfer vqm active block vqm The Active Transfer Library provides the communication to the USB hardware While separate Input and Output buses provide bi directional communications with the plug in modules See Figure 6 for an overview of the EPT Active Transfer system Figure 6 EPT Active Transfer Library Overview INPUT OUTPUT PINS TOP LEVEL ACTIVE TRANSFER LIBRARY USER CODE UC IN 22
105. drives gn Human Interface Devices ug IDE ATA ATAPI controllers JS Imaging devices MY Jungo Keyboards A Mice and other pointing devices Monitors Search for driver software in this location Select the folder that contains drivers for your hardware E di Arduino 2 M arduino 0023 LI D G D Update Driver Software Arduino UNO R3 COM46 Browse for driver software on your computer Network adapters 4 drivers ers or JF Ports COM amp LPT jy FTDI USB Drivers stible v a Arduino UNO R3 COM46 P examples D n Processors p gt Sound video and game controllers Fg taa qi System devices gt pi java D F Universal Serial Bus controllers D d lib gt Js libraries P reference b l a tools Ens llotif ok cam I e Once the driver is loaded we can set the COM Port Click on Tools and select Serial Port then click the available port Py Arduino Data Collect Gal File Edit Sketch Help Auto Format Archive Sketch Fix Encoding amp Reload Serial Monitor Arduino Data P Ctrl Shift M Earth Peopli Board gt Serial Port Data Collec Platform Uj Programmer y Burn Bootloader int count 0 int ledPin 13 void setup DDRD B11111111 PORTD B11111111 Turn on Port D pins Set Port D as outputs pinMode a0 OUTPUT pinMode ledPin OUTPUT doe Me ee ee S 3
106. e 5nippets Manager Ctrl K Ctrl B Form1 Designer cs Form1 cs Formi cs Design ir EA E a cL J Te Choose Toolbox Items S 59 Solution Data Collector 1 project a Extension Manager Data Collect Platform Active x86 Y e 4 x External Tools Sa Properties gt E References Settings Basic Settings N 3 T 1 4 E Formi cs Options LA EN wee j Form1 Designer cs Define DEBUG conste c Program cs Resources Import and Export Settings 4 Define TRACE constan Settings 9 4 Allow unsafe code Reference Paths J Optimize code Signing Errors and warnings Security Go to Tools Options locate the Show all settings check box Check the box Page 130 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 4 Environment Recent files General items shown in Window menu Fonts and Colors Keyboard 10 items shown in recently used lists b Text Editor Debugging Visual experience Automatically adjust visual experience based on client performance Enable rich client visual experience Use hardware graphics acceleration if available Visual Studio is currently using hardware accelerated rendering The visual experience settings automatically change based on system capabilities Show status bar Close button affects active tool window only Auto Hide button affects active tool window only Restore File Associations I Show all settings
107. e EPT FT2232 Interface using System using System Drawing using System Collections using System Windows Forms using System Data using System Threading using System Runtime InteropServices using System Diagnostics 1 jnamespaceftPT FT2232 Interface i 2 public partial class qf i222 eertse System Windows Forms Form i 3 public PT_FT2232_Interface i InitializeComponent for int i 0 i device Length i device i new Transfer 4 Change EPT_Transfer_Test_Load of Form1 cs to new lt project name gt _Load Page 87 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Main object loads private void i i BT FT2232 Interface Load Wject sender System EventArgs e i Call the List Devices function ListDevices 5 Change namespace of Form1 Designer cs to new project name 6 Change clase of ZO Designer cs to new project name i EPT FT2232 Interface EP Jnamespa cs se ee 5 partial class QBI 12232 Interface 6 lt summary gt designer variable summary 59 InitializeCompone inr cs System ComponentModel IContainer components null lt summary gt ta up any resources being used summary lt param name disposing fi true if managed resources should be disposed otherwise false lt i toir override void Dispose bool disposing param gt if disposing amp amp components nul
108. e LLE 66 or negedge reset INE begin if reset amp H begin transfer out lt l b0 B transfer out reg lt l b0 i transfer out byte lt A hD 0 end 1 else E begin 3 if start transfer byte amp transfer out 4 begin 5 transfer out byte lt TRANSFER HOST BYTE 6 transfer out reg lt l bl 7 transfer out lt 1 bl end else if start transfer byte amp transfer out begin transfer out reg lt 1 b0 transfer out lt l bl Pe h dS GR C Oe Bi PRO ha B amp B OF B F5 co io cn kh ud e ET if end else if start transfer byte amp transfer out begin transfer out reg lt 1 bO H Ef transfer out 1 bO end end BY R3 Ki PR BA KA Pm PR PR BA PRO PR PR KA BA PR BA BY KA BA BA BA BY BA BY PR R3 KA Bi PR Pa Ln oof d 5 io co end 4 2 3 Active Block The Active Block module is designed to transfer blocks of data between Host and User Code and vice versa This allows buffers of data to be transferred with a minimal amount of code The Active Block module is addressable so up to eight individual modules can be instantiated and separately addressed The length of the block to be transferred must also be specified in the uc length port Page 45 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 11 active block BLOCK TRANSFER INST 812 813 uc clk CLR 66 814 uc reset RST 815 uc in UC IN 816 uc out uc out ml 2 22
109. e transfer ACTIVE TRANSFER INST 158 755 uc cik CLE 66 760 uc reset reset 761 uc in UC IN 762 uc out uc out ml 1 22 22 J 764 start transfer transfer out reg 765 transfer received transfer in received 766 i mE 767 uc addr 3 h2 769 transfer to host transfer out byte 770 transfer to device transfer in byte To send a byte to the Host select the appropriate address that corresponds to an address on Host side Place the byte in the transfer to host parameter then strobe the start transfer bit Setting the start transfer bit to high will send one byte from the transfer to host byte to the Host on the next clock high signal 66 MHz The start transfer bit can stay high for the duration of the operation of the device the Active Transfer module will not send another byte In order to send another byte the user must cycle the start transfer bit to low for a minimum of one clock cycle 66 MHz After the start transfer bit has been cycled low the rising edge of the bit will cause the byte on the transfer to host parameter to transfer to the host Page 43 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 181 j f 182 Transfer byte to Device 183 j f 184 always TRANSFER OUT EN or reset 185 H begin 186 1 reset 187 EE begin
110. e will require you to sign into your myAltera account If you do not have one follow the directions under the box Don t have an account Page 50 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual MEM 3O m n Download Center Documentation myAltera Account Y Devices Design Tools amp Services End Markets Technology Training Support About Buy myAltera myAltera Account Sign In View myAltera Home Manage Profile Home gt myAltera Account Sign In Change Password Logout User Name Help Forgot Your User Name or Password myAltera Account Help Password Terms and Conditions Remember me Don t have an account Create Your myAltera Account Your myAltera account allows you to file a service reguest register for a class download software and more Enter your email address If your email address already exists in our system we will retrieve the associated information Create Account 7j Rate This Page Once you have created your myAltera account enter the User Name and Password The next window will ask you to allow pop ups so that the file download can proceed ANU 8 RYAN N B MEASURABLE ADVANTAGE FEE gt Download Center Documentation amp myAltera Logout M COMMUNITY Devices Design Tools amp Services End Markets Technology Training Support About Buy Thank you for downloading Quartus II Subscription Edition Quartus II
111. echnology d EPT USB CPLD Development Syste Arduino IDE j Documentation Js Drivers do Arduino 1 0 1 4 EPT 2 08 24 EPT Blaster 4 Projects ActiveHost 64Bit 4 Projects Arduino 4 Projects HDL b A Name Date modified Type Size File folder File folder N File folder 4p Arduino 1 0 1 1 30 2013 8 29 PM do EPT 2 08 24 2 9 2013 3 38 PM Jj EPT Blaster 2 9 2013 3 38 PM m 3 items Windows will attempt to locate a driver for the USB device When it does not find one it will report a error Device driver software was not successfully installed Ignore this error KA lt Products Earth People Technology EPT USB CPLD Development System CD Drivers EPT 20824 Organize v Include in library 4 Products 2 4 Earth People Technology d EPT USB CPLD Development Syste J Arduino IDE 4 Documentation 4 Drivers 4s Arduino 1 0 1 EPT 2 08 24 EPT Blaster Ji Projects ActiveHost 64Bit 4 Projects Arduino d Projects HOL k D n 9 items Go to Start gt Control Panel Share with Burn Name jJ amd64 4 1386 Jy Static Js Temp ftd2xx h Ef ftdibus cat ftdibus inf Ef ftdiport cat t ftdiport inf New folder gt IN Device driver software was not successfully installed N 2 Click here for details Page 14 Date modified 8 23 2012 4 43 PM 1 3 2013 10 26 PM 8 23 2012 4 43 PM 1 3 2013 10 26 PM File folder File folder File fold
112. ee ee ee ee ee ee 147 8 1 Summary of Hyper Serial Port HSP Capabilities esse sesse ss esse ee ee ees ee ee 147 8 2 Embedded Scripting Evaluator esse esse ee es ee ee ee ee ee ee 147 8 3 Send Character Timer ee ee Re ee ee ee nnne 148 ad i e 148 Page 3 E35 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 1 Introduction and General Description The Earth People Technology USB CPLD development system hardware consists of a High Speed 480 Mb s USB to parallel 8 bit bus chip and a CPLD The USB interface provides both JTAG programming of the CPLD and a High Speed transfer path The software consists of the Active Host SDK for the PC The firmware includes the Active Transfer Library which is used in the CPLD to provide advanced functions for control and data transfer to from the Arduino THE EARTH PEOPLE TECHNOLOGY USB CPLD DEVELOPMENT SYSTEM ACTIVE HOST COMMUNICATES EPT 570 AP ACTIVE HOST SDK WITH CPLD USING ENDTERMS ARDUINO _ ACTIVE TRANSFER ARDUINO CODE LIBRARY USERS CODE USERS CPLD CODE COMMUNICAES COMMUNICATES WITH CPLD WITH HOST USING ENDTERMS The user s Arduino code is developed to perform particular functions required by the user such as reading a temperature sensor The code is downloaded to the microcontroller using the Arduino IDE system provided as part of the microcontroller development system The EPT USB CPLD Development System allows
113. elopment System User Manual The randomSeed function must be called during the setup function It takes as input parameter the output of the Analog Pin 1 The output of this Pin will have a small amount of random noise on it Because of this noise the randomSeed function will produce a different seed every time the sketch 1s initialized void setup i randomSeed analogReadil 7 1 3 Select I O s for Fast Throughput on Arduino An 8 bit port is used to connect the 8 bit byte from the random function output to the input of the EPT 570 AP There is also a one bit control line which will be used to inform the CPLD that a byte 1s ready to be written to the USB START STOP PORT A LB BYTE D O eg000000 6000000 00060000 i Arduino Mega 2560 r B LB BYTE BIO JC ENABLE Ed 77 gates onaenade Qo000000 cP Each port is controlled by three registers which are also defined variables in the Arduino language The DDR register determines whether the pin is an INPUT or OUTPUT The PORT register controls whether the pin is HIGH or LOW and the PIN register reads the state of INPUT pins set to input with pinMode The maps of the ATmega328 chips show the ports DDR and PORT registers may be both written to and read PIN registers correspond to the state of inputs and may only be read PORTA maps to Arduino digital pins 0 to 7 DDRA The Port A Data Direction Register read write PORTA The Po
114. elopment with the expressiveness and elegance of C style languages After installation you can try this product for up to 30 days You must register to obtain a free product key for ongoing use after 30 days Download language English Installation options Visual C 2010 Express English ff Install now Click on the Install now hypertext Visual C 2010 Express Build custom applications in Visual C a simple powerful type safe and object oriented language that enables rapid application development with the expressiveness and elegance of C style languages After installation you can try this product for up to 30 days You must register to obtain a free product key for ongoing use after 30 days Download language English Installation options Do you want to run or save vcs web exe 3 10 MB from download microsoft com This type of file could harm your computer icrosoft Visual C 2010 Express Setup Microsoft Captions Language Interface Pack CLIP The Microsoft Captions Language Interface Pack CLIP uses tooltip captions to display translations for common user interface elements in the Visual Studio integrated development environment IDE Use CLIP as a language aid to see translations in your own dialect update results in your own native tongue or as a learning tool Arabic amp ell Greek EM nvik Hebrew nav Hindi R Hungarian Magyar Malay sole ule
115. er File folder Setup Information EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 4l Getting Started fa Connect to a Projector Rolly Documents Calculator Pictures me Sticky Notes Music oi Snipping Tool aa Computer E Paint Control Panel ET XPS Viewer sy Windows Fax and Scan 3 JE Run TightVNC Server A Remote Desktop Connection Devices and Print Default Programs Help and Support gt All Programs Adjust your computer s settings yv Action Center Fa Administrative Tools Backup and Restore E Color Management gi Date and Time Default Programs 4 Device Managgr ET Devices and Printers Device Manager e Ease of Access View and update your hardware s ayer settings and driver software Locate the entry under Other devices Right click EPT USB lt gt Serial amp JTAG Cable and select Update Driver Software Page 15 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual MEE V fem sad JCVICC Manac Fie Action View Help wm Ha mio gE 4 gj HP DeskTop 3005 DM Computer b xc Disk drives p N Display adapters gt 3 DVD CD ROM drives gt 4g IDE ATA ATAPI controllers Ai Monitors 4 Network adapters M NETGEAR WG311v3 54Mbps Wireless PCI Adapter i iu Realtek PCIe GBE Family Controller i jy Other devices ifj EPT USB lt gt Serial amp UTAG Cabir ilg EPT USB lt gt Serial amp UT
116. er Manual Forml Designer cs Forml cs Data Collector Ete ie Application Build Build Events Debug Resources Settings Reference Paths Signing Security Publish General Conditional compilation symbols Define DEBUG constant Define TRACE constant Optimize code Errors and warnings Warning level Suppress warnings Treat warnings as errors i None All Click on the Save All button on the tool bar The project environment is now setup and ready for the project files Close the Project 6 2 Assembling Files into the Project Locate the EPT USB CPLD Development System CD installed on your PC Browse to the EPT_Transfer_Test folder where the Project files reside choose either the 32 bit or 64 bit version depending on whether your OS is 32 or 64 bit copy the cs files and install them in the top level folder of your EPT_Transfer_Test project These files are Active transfer xxx cs Forml cs Forml Designer cs Program cs Page 86 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual wv ER N N lt T w di Earth People Technology EPT USB CPLD Development System CD Projects ActiveHost 64Bit EPT Transfer Test EPT Transfer Test gt c Organize v Include in library v Share with Burn New folder 4 EPT USB CPLD Development System CD Name i Date modified Type Size J Arduino IDE or j
117. er Serial Port which transmits to and from the CPLD via the FT245 Side B channel Note that the Hyper Serial Port does not download any information for storage in the CPLD memory but merely sends and receives signals to and from the active library modules in the CPLD The EPT USB CPLD system permits up to eight separate trigger byte transfer and block transfer modules to be loaded in the CPLD via the Quartus II software system HSP also provides a visual control and interface window with a variety of control options available Details are provided at the HSP website http earthpeopletechnology com where the software may be downloaded to a user s PC 8 1 Summary of Hyper Serial Port HSP Capabilities HyperSerialPort is a serial terminal emulator which has built in tools to assist developers of embedded electronics to quickly diagnose problems associated with the design and programming of microcontrollers It is built on the Microsoft NET Framework 4 0 and designed for Windows 7 32 bit It has been tested also with Windows XP Various embedded electronics evaluation tools are included in HSP These are briefly described in the following sub sections 6 2 Embedded Scripting Evaluator The Embedded Scripting Evaluator allows developers to run Python scripts within the HSP environment This will allow users to develop real time feedback loops to mimic processor to device communications The user could write a script to emulate an I2C device and
118. esources V Define TRACE constant Settings V Allow unsafe code Reference Paths v Optimize code Signing Errors and warnings sey Wing ie RNC Publish m Sunnress warninas Next unsafe code needs to be allowed so that C can be passed pointer values from the Active Host Right click on the Data Collector project in the Solution Explorer Select Properties Page 134 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Data Collector PERFETTE R iy R RS a El El Ale sd Solution Data Collector 1 project 4 5 Data_Collec se2unos e eq gy xoqjoo x UU gt Sa Properti I3 Build gt aj Referenc Rebuild active tr publish 4 L amp Forml c 9j Form Add c Program Add Reference Add Service Reference Set as StartUp Project Debug 5 Cut Ctrl X Th Paste Ctrl V X Remove Del Rename File Edit View Build Debug Tools Window Help Data_Collector active_transfer cs M Data Collector Data Collector using System usina Suetem Collections Generic 2 O203e 2 Form1 Designer cs ComponentModel Data Drawing Ling Text Windows Forms Threading Runtime InteropServices Diagnostics ta Collector artial class Data Collector F ic Data Collector InitializeComponent for int i 0 i lt EPTTransmit EPTTransmitDevice i new Click on the Build tab and locate the Allow unsafe code
119. essages 4 m X System 1 JV Processing 135 100 00 00 22 At this point the project has been successfully compiled synthesized and a programming file has been produce See the next section on how to program the CPLD 5 2 2 Programming the CPLD Programming the CPLD is quick and easy All that is required is a standard USB cable with a Mini Type B connector on one end and the EPT JTAG Driver DLL Connect the EPT 570 AP to the PC open up Quartus II open the programmer tool and click the Start button To program the CPLD follow the steps to install the USB Driver and the JTAG Driver Insert for Quartus II If the project created in the previous sections is not open open it Click on the Programmer button Page 69 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Quartus I 64 Bit C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test EPT_570_AP_M4_Top EPT_570_AP_M4 Top File Edit View Project Assignments Processing Tools Window Help 57 TT TT 428 9 mme MYL OHO OP OO LZ O a o Project Navigator hax amp Compilation Report EPT 570 AP M4 Top x Entity Table of Contents Ra Search altera com Flow Summary diy MAX IE EPM570T100C5 4 Bbd EPT 570 AP M4 Top abd active transfer ACTIVE TRANSFER INST 4 abd active transfer library ACTIVE TRANSFER L gt endpoint registers ENDPOINT REGISTE gt ft 245 state machine FT 245 STATE M
120. ettings VHDL Input Verilog HDL Input Default Parameters Fitter Settings TimeQuest Timing Analyzer Assembler Design Assistant SignalTap II Logic Analyzer Logic Analyzer Interface PowerPlay Power Analyzer Settings SSN Analyzer Continue following the instructions by adding a device and finishing the project instantiation Then bring up the Pin Planner e Under Assignments Select Import Assignments e Atthe Import Assignment dialog box browse to the Wrojects HDIAEPT Data Collector EPT 570 AP U2 Top folder of the EPT USB CPLD Development System CD Select the Quartus Specification file EPT 570 AP MA Top qsf file e Click Ok Under Assignments Select Pin Planner Verify the pins have been imported correctly Next we need to add the Synopsys Design Constraint file This file contains timing constraints which forces the built in tool called TimeQuest Timing Analyzer to analyze the path of the synthesized HDL code with setup and hold times of the internal registers It takes note of any path that may be too long to appropriately meet the timing qualifications For more information on TimeQuest Timing Analyzer see Page 125 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual http www altera com literature hb qts qts_qii53018 pdf GSA_pos 1 amp WT oss_r 1 amp WT oss TimeQuest Timing Analyzer Browse to the Projects HDIAEPT Data Collector VAltera EPM570 MA folder of the EPT USB CPLD Devel
121. everal numbers separated by a space and less 256 into the Multiple Byte textbox Then hit the Multi Byte button The numbers appear in the Receive Byte textbox To exercise the Block Transfer EndTerm click the Block8 or Block16 button in the Block Controls group A pre selected group of numbers appear in the Block Receive textbox Press the PCB switches on the EPT 570 AP to view the Switch Controls in action Page 7 TECHNOLOGY USB CPLD Development System User Manual 1 2 EPT 570 AP The EPT 570 AP board is equipped with an Altera EPM570 CPLD which is programmed using the Altera Quartus II software The CPLD has 570 Logic Elements which is equivalent to 440 Macrocells An on board 66 MHz oscillator is used by the EPT Active Transfer Library to provide data transfer rates of up to 8 Mega Bytes per second Twenty Four I O s from the CPLD are attached to three 8 bit transceivers to provide 5 Volt compatible I O s These 74LVC245 bidirectional voltage translator bus transceivers are controlled by one enable and direction bit per transceiver This means the direction of the individual bits of each transceiver cannot be selected the direction is selected for all eight bits per transceiver There are four green LED s and two Push Buttons that are controllable by the user code The hardware features are as follows Altera EPM570 in the TQFP 100 pin package 66 MHz oscillator for driving USB data transfers and users code
122. g_tutorial 3 3 2031 38AM File folder Date modified Type Size J extlibs32 libraries J imf Ji qdesigns EPT_Transfer_Test J fir filter d incr comp makefile vhdl verilog tutorial sopc builder Eid altera inspector log zip de id EPT Transfer Test Date modified 3 13 2013 8 52 PM File folder Open Quartus II by clicking on the icon e r Quartus I 32i File Edit View Project Assignments Processing Tools Window Help amp Search altera com c D ug esx amp ma amp ooc DRY EE DY BO BE OR Or har M TR n RE w F he he mme Project Navigator Take an Online Training Class for Free Now Available amp Compilation Hierarchy Learn What s New Take Free Online Training ANTERA Sm AOUARTUS II Task Version 12 0 4 b Compile Design gt Analysis amp Synthesis ww Buy Software gt Fitter Place amp Route gt Assembler Generate programming files gt TimeQuest Timing Analysis m 4D Documentation x Y lt lt Search gt gt Type Message Location v Locate 0 00 00 00 Under Quartus Select File gt New Project Wizard The Wizard will walk you through setting up files and directories for your project Page 57 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Quartus II 32 bit J File Edit View Project Assignments Processing Tools Window Help
123. gnals to the USB interface chip These signals are connected directly to input and output pins of the CPLD 4 2 1 Active Trigger The Active Trigger has eight individual self resetting active high signals These signals are used to send a momentary turn on off command to Host User code The Active Trigger 1s not addressable so the module will be instantiated only once in the top level 43 wire 22 3 1 0 uc out m 144 eptWireOR N 2 wireOR UC OUT uc out m Hs 745 active trigger ACTIVE TRIGGER INST 746 747 uc clk CLE 66 748 uc reset RST 749 uc in UC IN 750 uc out uc out ml O 22 22 752 trigger to host trigger to host Tas trigger to device trigger in byte 7 To send a trigger decide which bit or multiple bits of the eight bits you want to send the trigger on Then set that bit or bits high The Active Transfer Library will send a high on that trigger bit for one clock cycle 66 MHZ then reset itself to zero The bit can stay high on the user code and does not need to be reset to zero However if the user sends another trigger using the trigger byte then any bit that 1s set high will cause a trigger to occur on the Host side Page 40 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 2171 j f 278 Detect Trigger Out to Host 279 j f 230 always amp IRIGG
124. gramming file has been produced See the next section on how to program the CPLD Page 127 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 7 1 10 CPLD Program the CPLD The final step is programming the pof file into the CPLD Follow the section Programming the CPLD Connect the EPT 570 AP to the PC Open up Quartus II Open the programmer tool In the upper left corner of the Programmer Tool there is a button labeled Hardware Setup Verify that EPT Blaster v1 3 has been selected If not go to the section JTAG DLL Insert to Quartus II and follow the directions e Check the box under Program Configure e Click the Start button When the programming is complete the Progress bar will indicate success dp Programmer C Jolly Products Earth People Technology EPT USB CPLD Development System CD Projects HDL EPT Data Collect Se Fie Edit View Processing Tools Window Help Device Checksum Usercode Program Verify Blank Configure Check EPT 570 AP M4 Top pof EPMS7UT100 003134D8 FFFFFFFF E CFM E UFM E Page 128 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual At this point the EPT 570 AP is programmed and ready for use 7 1 11 PC Design the Project The final piece of the Data Collection Sampler is the PC application This application will fetch the data from the CPLD of the EPT 570 AP and display it on the screen It
125. ices Int32 iCurrentIndex Open the DLL result EPT AH Open null null null if result 68 i MessageBox Show Could not attach to the ActiveHost library return 6 h Query connected devices num devices EPT AH QueryDevices Prepare the Combo box for population iCurrentIndex cmbDevlist SelectedIndex cmbDevList Items Clear Go through all available devices for device index 8 device index num devices device index i String str str Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index cmbDevList Items Add str i return The user will select the device from the drop down combo box This can be seen when the Windows Form is opened and the cmbDevList combo box is populated with all the Page 26 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual devices The selected device will be stored as an index number in the variable device index ds x eee A USB High Speed Transfer B v a pem Open Cose In order to select the device the user will click on the Open button which calls the Open_Device function The device_index is passed into the EPT AH OpenDeviceBylndex function If the function is successful the device name is displayed in the label labelDeviceCnt Next the device is made the active device and the callback function is registered Finally the Open button is grayed out and the Close button is made act
126. ilog Quartus Mapping 4 Analysis amp Synthesis Settings VHDL Input Verilog HDL Input Default Parameters Fitter Settings TimeQuest Timing Analyzer Assembler Design Assistant SignalTap I Logic Analyzer Logic Analyzer Interface PowerPlay Power Analyzer Settings SSN Analyzer Select the design files you want to include in the project Click Add All to add all design files in the project directory to the project Page 68 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Click Ok then re run the Compile process After successful completion the screen should look like the following Quartus II 64 Bit C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test EPT_570_AP_M4_Top EPT 570 AP M4 Top e xs i e 1 g Search altera com D Lg d o x 3 DM ETAM Top JAY r EFO rg OOguxe9ili Project Navigator ax o Compilation Report EPT 570 AP M4 Top B Entity s Table of Contents nag gt MAX IE EPM570T100C5 E5 Flow Summary Flow Status Successful Thu Mar 14 00 50 53 2013 abd EPT 570 AP M4 Top Flow Settings Quartus I 64 Bit Version 12 1 Build 243 01 31 2013 SP 1 SJ Web Edition BE active transfer ACTIVE_TRANSFERINST f Flow Non Default Global Settings ume nm 4 abd active transfer library ACTIVE TRANSFER L ff Flow Elapsed Time Euse Entity Name EPT_570_AP_M4_Top gt endpoint registers ENDPOINT REGISTE f Flow OS Summary a MEN Device EPM570T100
127. includes user code windows form and the Active Host DLL ACTIVE TRANSFER LIBRARY DLL The Active Host DLL is designed to transfer data from the CPLD when it becomes available The data will be stored into local memory of the PC and an event will be triggered to inform the user code that data 1s available from the addressed module of the CPLD This method from the user code on the PC makes the data transfer transparent The data just appears in memory and the user code will direct the data to a textbox on the Windows Form The Data Collector project will perform the following functions Find EPT 570 AP Device Open EPT 570 AP Device Start the Arduino data collection process Wait for data from EPT 570 AP Display data from EPT 570 AP in textbox 7 1 12 PC Coding the Project The user code is based on the NET Framework and written in C The language is great for beginners as it is a subset of the C language It has the look and feel of the familiar C language but adds the ease of use of classes inheritance and method overloading C is an event based language which changes the method of writing code for this project See the section Assembling Building and Executing a NET Project on the PC for a better description of event based language programming To start the project follow the section Assembling Building and Executing a NET Project on the PC Use the wizard to create project called Data Collector
128. ing to the Data Collector project folder Locate the executable in the bin x64 Release folder Organize v IE Open Share with v Burn New folder _ EPT USB CPLD Development System CD gt Name Date modified Type Size N Arduino_IDE i amp ActiveHost64 dll 3 2 2013 9 44 PM Application extens 27 KB a Documentation m Data_Collector exe 3 3 2013 12 31 AM Application 15 KB di Drivers ES i Data_Collector pdb 3 3 2013 12 31 AM Program Debug D 40 KB a Projects_ActiveHost_32Bit ns den Ba 3 i j I m Data Collector vshost exe 3 3 2013 12 18 AM Application 12 KB Projects ActiveHost 64Bit 3 d Data Collector vshost exe manifest 8 31 2009 12 40 AM MANIFEST File 1KB dJ ActiveHost 1 0 0 8 i s S ftd2 064 dll 1 18 2013 3 54 PM Application extens 252 KB EPT Data Collector di Data_Collector F J bin Debug N Release Je x64 i Release Ji obj Properties J EPT Transfer Test X 1 Data_Collector exe State BB Shared Size 15 0 KB Shared with Homegroup e Application Date modified 3 3 2013 12 31 AM Date created 3 3 2013 12 37 AM Initiate the application by double clicking the application icon in the Release folder of the project The application will open and automatically load the Active Host dll The application will locate the EPT 570 AP M4 device Next the combo box at the top will be populated with the name of the device a Data Collector la EPT USB l
129. ive Open the device public unsafe Int32 OpenDevice device index int cmbDevList SelectedIndex if EPT AH OpenDeviceByIndex device index 8 i String message Could not open device Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceSerial device index MessageBox Show message return 6 t else labelDevicetnt Text Connected ta device Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index Marshal PtrToStringAnsif IntPtr EPT AH GetDeviceSerial device index l Make the opened device the active device if EPT AH SelectActiveDeviceByIndex device index 8 i String message Error selecting device s Marshal PtrToStringAnsi IntPtr EPT AH GetLastError MessageBox Show message return 6 T Register the read callback function RegisterCallBack btnOpenDevice Enabled false btnCloseDevice Enabled true return 6 Page 27 SA CARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 3 4 2 Active Host Read Callback Function The local callback function is populated It resides in the active_transfer cs file This function will be called from the Active Host dll When the EPT Device has transferred data to the PC the callback function will do something with the data and command Actual callback function which will read messages coming from the EPT device
130. kCompare object data i int BlockAddress int data bytel cBuf new Byte device BlockAddress Length if device BlockAddress Repititions 8 amp Idevice BlockAddress TransferPending amp BlockTransferStop i device BlockAddress TransferPending true Buffer BlockCopy block 8 in payload 8 cBuf 8 device BlockAddress Length fixed byte pBuf cBuf i EPT AH SendBlock device BlockAddress Address void pBuf uint device BlockAddress Length Thread Sleep 1 EPT AH SendTransferControlByte char 2 char 2 Thread Sleep 1 EPT AH SendTrigger char 128 Thread Sleep 1 EPT AH SendTransferControlByte char 2 char 8 if BlockTransferInfinite device BlockAddress Repititions 1 else device BlockAddress Repititions I To receive a block transfer from the CPLD Device a polling technique is used by the Active Host dll This 1s because the Bulk Transfer USB is a Host initiated bus The Device will not transfer any bytes until the Host commands it to If the Device has data to send to the Host in an asynchronous manner meaning the Host did not command the Device to send data the Host must periodically check the Device for data in its transmit FIFO If data exists the Host will command the Device to send its data The received data 1s then stored into local memory and register bits are set that will indicate data has been received from a particular address The receive callback function is then
131. l components Dispose base Dispose disposing 7 Change the this Name and this Text in Form1Designer cs to new project name 8 Change this Load in Form1Designer cs to include new project name this this this this this this this this Controls Add this Controls Add this Controls Add this Controls Add this Controls Add this Controls Add this Controls Add this Controls Add this gbTriggerOut btnTrigger3 btnTrigger2 btnTriggerl btnCloseDevice btnOpenDevice cmbDevList LEDBox this Controls Add this this Controls Ads this this z 8 this Load new System ver iandler this PT FT2232 Interface Toy this LEDBox ResumeLayout false this LEDBox PerformLayout this gbTriggerOut ResumeLayout false this gbTransferControl ResumeLayout false this gbTransferControl PerformLayout this groupBox1l ResumeLayout false this groupBox1 PerformLayout this ResumeLayout false this PerformLayout 9 Change namespace in Program cs to new project name 10 Change Application Run in Program cs to new projectname using System using System Collections Generic using System Ling using Sygfem Windows Forms namespace EPT FT2232 Interface 1 static class Program en i lt summary gt n The main entry point for the application lt summary gt sie static void Main i Application Ee EN Application SetCompatjk ault false Applicatio
132. lers MA Monitors amp Network adapters 19 Ports COM amp LPT D Processors 44 Sound video and game controllers 4M System devices 4 I Universal Serial Bus controllers Be F Standard Enhanced PCI to USB Host Controller j 9 Standard Enhanced PCI to USB Host Controller 8 Standard OpenHCD USB Host Controller be F Standard OpenHCD USB Host Controller E USB Composite Device J USB Root Hub USB Root Hub 7 9 USB Root Hub 8 USB Root Hub 8 USB Serial Converter A i Q USB Serial Converter B When this is complete the drivers are installed and the EPT 570 AP can be used with for programming and USB data transfers 2 2 JTAG DLL Insert to Quartus II The JTAG DLL Insert to Quartus II allows the Programmer Tool under Quartus to recognize the EPT 570 AP The EPT 570 AP can then be selected and perform programming of the CPLD The file jtag hw mbftdi blaster dll must be placed into the folder that hosts the jtag server for Quartus This dll is available for Windows XP 32 bit Windows 7 32 bit and Windows 7 64 bit Close out the Quartus II application Locate the Drivers EPT_Blaster folder on the EPT USB CPLD Development System CD Page 19 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Go Products Earth People Technology EPT USB CPLD Development Sys Organize v Include in library New folder 4 EPT USB CPLD Development System CD Name Arduino IDE di Do
133. logy EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src EPT 570 AP M4 Top v Verilog HDL File fechnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active trigger vam Verilog Quartus Mapping File Down echnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active transfer library vqm Verilog Quartus Mapping File echnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active transfer vqm Verilog Quartus Mapping File Properties echnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test src active block vqm Verilog Quartus Mapping File 4 Tm D W Buy Software Ok Cancel Apply Hep Select Next at the Device Family group select MAX II for Family In the Available Devices group browse down to EPM570T100C5 for Name Page 59 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual E New Project Wizard sve Family amp Device Settings page 3 of 5 Select the family and device you want to target for compilation Device family Show in Available devices list pace pevices Pn cont un Speed grade 2 Auto device selected by the Fitter Name filter Specific device selected in Available devices list Show advanced devices HardCopy compatible only amp Other n a Available devices EPMS70T100C3 3 EPMS70T100C4 3 2 EPMS70T100C5 3 3 EPMS7UT 10015 EPMB7UT144A5 3 3 EPMS7UT1
134. lt 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default 3 3 V LV default M Reserved Current Strength 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 16mA default 7 096 00 00 00 Exit the Pin Planner Next we need to add the Synopsys Design Constraint file This file contains timing constraints which forces the built in tool called TimeQuest Timing Analyzer to analyze the path of the synthesized HDL code with setup and hold times of the internal registers It takes note of any path that may be too long to appropriately meet the timing qualifications For more information on TimeQuest Timing Analyzer see http www altera com literature hb qts qts_qii53018 pdf GSA_pos 1 amp WT oss_r 1 amp WT oss TimeQuest Timing Analyzer Browse to the Projects_HDL EPT_Transfer_Test Altera_EPM570_M4 folder of the EPT USB CPLD Development System CD Select the EPT 570 AP M4 Top sdc file Page
135. ms and conditions of other licensing agreements in this document The following provision applies to all three licensing agreements below Altera may store your data and information on its own servers or on servers hosted by third parties If Altera is providing any software to you for use via the Internet such software may also be License stored on our servers or servers hosted by third parties For any information data or software hosted by a third party although every reasonable effort wil be made to keep data and information secure Altera is not liable for data or information that is inadvertently disclosed by the third party or for any system downtime related to the third party servers FOR QUARTUS II VERSION 12 1 ALL DISTRIBUTIONS WEB DOWNLOAD CDS DVDS QUARTUS II VERSION 12 1 STANDARD LICENSE AGREEMENT ALTERA PROGRAM LICENSE SUBSCRIPTION AGREEMENT V I agree to the terms of the license agreement Click Next and accept the defaults Page 53 B EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual G Altera Installer 12 1 Build 177 Y e i Bj Installer Setup Select the location of the installation files Specify the Installation Files Directory Select this option if you want the Altera Installer to retrieve installation files from your hard disk or local network Installer Source Directory Browse Download Installation Files from the Internet
136. n Start with the Arduino and create a simple bit output using a random number generator Next use the EPT Active Transfer Library to create a byte transfer module to read the byte from the Arduino and send it to the Host PC Finally use EPT Active Host to accept the byte transfer from EPT Active Transfer and display in a textbox This is just the hierarchical system level design In the following sections we will fill in the above blocks 7 1 1 The Arduino Microcontroller Board Using the features and capabilities of the Arduino development system the user will develop the source code using the Wiring programming language and download the resulting binary code from the Processing development environment to the Flash memory of the microcontroller 7 1 2 Create Data Generator To keep the design simple no external data source will be used We will create a data source using the Arduino then transmit this data to the EPT 570 AP board To create the data source we will use the random function This function generates pseudo random numbers from a seed value We will give the randomSeed function a fairly random input using the value from the analogRead This will give different values every time the random function is called We will limit the random number output from the function to 8 bits The random function will be called once per iteration of the loop function Page 101 ES EARTHPEOPLE TECHNOLOGY USB CPLD Dev
137. n Run ne EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 6 2 2 Add Files to Project Open the EPT_Transfer_Test project Right click on the project in the Solutions Explorer Select a gt Existing Item File Edit View Project Build Debug Data Tools Window Help ZEN EIER TES Release Jes MR EPT ST te e ala wl FILE we ea aa EE Forml cs Design X ala sd Solution EPT Transfer Test 1 project 4 a EPT Transfer LIE gy xoqjoo gt ie a EE EX Build ba References Rebuild gt EE Formi cs Publish ct Program cs Add Reference Existing Item Add Service Reference B Folder Set as StartUp Project Windows Form Debug gt dj User Control Cut Ctrl X g Class Shift Alt C Paste Ctrl V X Remove Del Rename Properties Alt Enter Browse to the EPT_Transfer_Test project folder and select the active_transfer_xx cs file choose either the 32 bit or 64 bit version depending on whether your OS is 32 or HE AR Click Add EE TA N 4 Ber Transfer_Test ie EPT Transfer Test EPT Transfer Test Search EPT Trai tmi Properties 3 References Organize v New folder 4 EI Fomml cs 3 Formi Designer cs 4 Microsoft Visual C 2010 Express a 2 Formi resx 4e Projects bin Program cs amp J obj Tr Favorites d Properties BE Desktop a active transfer cs d Downloads 4 Formi cs 1 Dropbox 3 Formi Designer c
138. nction to load up the ActiveHost DII Next it calls EPT AH QueryDevices which searches through the registry files to determine the number of EPT devices attached to the PC Next EPT AH GetDeviceNamel is called inside a for loop to return the ASCII name of each device attached to the PC It will automatically populate the combo box cmbDevList with all the EPT devices it finds Page 136 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual List Devices function private unsafe Int32 ListDevices 1 Int32 result Int32 num devices Int32 iCurrentIndex Open the DLL result EPT AH Open null null null if result 6 1 MessageBox Show Could not attach to the ActiveHost library return 6 Query connected devices num devices EPT AH QueryDevices Prepare the Combo box for population iCurrentIndex cmbDevList SelectedIndex cmbDevList Items Clear Go through all available devices for device index 6 device index lt num devices device index 1 String str str Marshal PtrToStringAnsi IntPtr EPT AH GetDeviceName device index cmbDevList Items Add str h return 8 The user will select the device from the drop down combo box This value can be sent to the OpenDevice function using the button Click of the Open button Open the device if EPT AH OpenDeviceByIndex device index false i printf Could not open device s n EPT AH GetDeviceName device
139. ng 4 For our example project the TransferOutReceive function writes the Transfer byte received to a text block The receive callback method is complex however Earth People Technology has created several projects which implement callbacks Any part of these sample projects can copied and pasted into a user s project 3 4 5 Active Host Block Transfers The Active Host Block Transfer is designed to transfer blocks of data between Host and CPLD and vice versa through the Block EndTerm This allows buffers of data to be transferred with a minimal amount of code The Active Host Block module in the User Code is addressable so up to eight individual modules can be instantiated and separately addressed The length of the block to be transferred must also be specified The Block EndTerm is limited to 1 to 256 bytes To send a block first open the EPT device to be used with EPT AH OpenDeviceBylndex Next use the EPT_AH_SendBlock function to send the block Add the address of the transfer module as the first parameter Next place the pointer to the buffer in the second parameter of EPT_AH_SendBlock Add the length Page 32 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual of the buffer as the third parameter Then execute the function the entire buffer will be transferred to the USB chip The data is available at the port of the Active Block module in the user code on the CPLD public unsafe void Bloc
140. ning Support About Buy Devices Design Tools amp Services Design Software Quartus II Subscription Edition Quartus II Web Edition MegaCore IP Library ModelSim Altera ModelSim Altera Starter Nios II EDS Legacy Tools DSP Builder OS Support Download Center Home gt Support gt Downloads gt Download Center e ouAmRmTrUs ModelSim NiosII DSP Builder Archives Service Packs Design Software Licensing Get and Manage Licenses Licensing FAQ License Daemon Software Programming Software Quartus II Programmer Jam STAPL Software Drivers Cable amp Adapter Drivers Board Layout and Test BSDL Models SPICE Models Download the following design software of your choice f Download e Quartus II software v12 1 which includes the We Nem 22 MB 21 MB Nios II Embedded Design Suite EDS and MegaCore intellectual property IP library Subscription Edition 30 day free trial Web Edition free Compare with Subscription Edition PDF Install Subscription Edition Service Pack 1 Install Web Edition Service Pack 1 Read Altera Software v12 1 Installation FAQ Nios II EDS v12 1 ModelSim Altera software ModelSim Altera Starter Edition free ModelSim Altera Edition Compare with ModelSim Altera Starter Edition DSP Builder Please note that the service pack installation process has changed More details Download previous versions of Quartus II software The next pag
141. ntrol state will go back to idle e In the TRANSFER CONTROL HDR 2 state the state machine will stay in this state until the next byte from the active_transfer 1s received e If the byte from transfer to device is a Ox7e the transfer control state will be changed to TRANSFER DECODE BYTE e If the byte from transfer to device is not a Ox7e the transfer control state will go back to idle e Inthe TRANSFER DECODE BYTE state the state machine will stay in this state until the next byte from the active transfer e The next byte transferred from active transfer will be decoded as the Control Register The bits of the Control Register are defined below Bits Control 7 7 Page 120 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual re State Machine Control Register from Transfer In Ta H i e i E Ee always posedge CLK 66 or negedge RST begin if RSTI begin transfer in received reg lt 1 b0 transfer control state TRANSFER CONTROL IDLE transfer in loop back lt 1 bD led reset lt 1 b0 switch reset lt l b0 start stop cntrl lt 1 b0 end else begin if transfer in received amp transfer in received reg begin transfer in received reg lt 1 hl case transfer control state IRANSFER CONTROL IDLE if transfer in byte TRANSFER CONTROL BYTE1 transfer control state lt TRANSFER CONTROL HDR1 else if transfer in byte TRANSFER
142. of 10 microseconds 10 us 71 C EHABLE EE EE N PORT A RANDOM VALUE gt The RANDOM VALUE will be stable before the C Enable asserts thus guaranteeing a successful transfer of data from Arduino to CPLD 7 1 5 Building Arduino Project Building the Arduino project is the process of converting compiling the code you just wrote into machine level code that the processor can understand The Arduino IDE is the software tool that does the compiling The machine level code is a set of basic instructions that the processor uses to perform the functions the user code Browse to the Projects ArduinolArduino Data Collector Code folder of the EPT USB CPLD Development System CD Copy Arduino Data Collector Code M4 ino To compile your code e Open up the Arduino IDE Page 106 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual d gt Computer gt Jolly Laptop PC C Jolly Products Arduino arduino 101 Organize v Open Burn New folder p Download x M n Drivers A rivers d FunctionalSpec examples j License p p Products E d hardware Altera E a i p Aptina mae B Arduino di libraries ef d arduino 1 0 1 di reference J MEGA 2560 Ji tools e arduino exe S cygiconv 2 dll di Uno B Atmel amp y cvawinl dll sketch oct27a Arduino Shared witl File Edit Sketch Tools Help sketch oct27a Page 107 EARTHPEOPLE TECHNOLOGY
143. ogramming devices This programming hardware setup applies only to the current programmer window Available hardware items IRemove Hardware If you successfully double clicked the Currently selected hardware dropdown box will show the EPT Blaster v1 3b W Hardware Setup sow wee as Hardware Settings JTAG Settings Select a programming hardware setup to use when programming devices This programming hardware setup applies only to the current programmer window Currently selected hardware ET Bester vi 3b MBUSB OF Sy a Available hardware items Hardware Server Port Add Hardware EPT Blaster v1 3b Local MBUSB 0 Remove Hardware Click on the Auto Detect button This will verify that the EPT Blaster driver can connect with the EPT 570 AP device Page 71 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual My Programmer C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test EPT_570_AP_M4_Top EPT 570 AP M4 Top Chain4 cdf eB X File Edit View Processing Tools Window Help G2 Search altera com gan 2 PSE wa BE mel E Enable real time ISP to allow background programming for MAX II and MAX V devices Checksum Usercode Program Verify Blank Examine Security Er Bit Configure Check Select the EPM570 under Device lp Programmer C altera 12 1sp1 quartus qdesigns EPT_Transfer_Test
144. ol and data transfer mechanism that allows users to quickly build powerful communication schemes in the CPLD Coupled with the Active Host application on the PC this tools allows users to focus on creating programmable logic applications and not have to become distracted by USB Host drivers and timing issues The Active Transfer Library is pre compiled file that the user will include in the project files TOP LEVEL EPT_EPM570_TRANSFER_Test_top v LIBRARY TRIGGER TRANSFER BLOCK TRANSFER EPT_ACTIVE_TRANSFER_LIBRARY v ACTIVE TRIGGER v ACTIVE TRANSFER v ACTIVE BLOCK v ER SUDE Page 38 i 2 3 4 5 6 B 9 E s Ww Nw HO is 16 17 18 19 20 21 22 23 24 25 26 27 28 28 30 31 32 oul 66s 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 USB CPLD Development System User Manual 9 99992339 93929292292 130 392 23 98 0502 2 3 2 0102 0 523 2 052 2 08 3 2 052 8 08 8 8 2 82 3 8 2 8 4 8945 ft t amp MT dit ji Copyright File Name Revision History DATE VERSION 0775 12 A Earth People Technology Inc 2012 EPT_FI2232_Transfer_Test_top v DETAILS Created RJJ 9 22399 22232 592522 302 080222020 222 002 42 08 2 22 8 00 22 8 3 8 0 402 0 5 8 2 2 E 4 05 0 58 8 0 8 0 ifdef SIM include src define v include Testbench tb define v
145. on Manager d d Solution EPT Transfer Test 1 project mr N la amp EPT Transfer Test gt za Properties ar gt lt j References 8 E Forml cs 5 L CIIM rer AP Data Colector IS Ctrl K Ctrl B Go to Tools gt Options locate the Show all settings check box Check the box Page 81 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 4 Environment Recent files General items shown in Window menu Fonts and Colors Keyboard 10 items shown in recently used lists b Text Editor Debugging Visual experience Automatically adjust visual experience based on client performance Enable rich client visual experience Use hardware graphics acceleration if available Visual Studio is currently using hardware accelerated rendering The visual experience settings automatically change based on system capabilities Show status bar Close button affects active tool window only Auto Hide button affects active tool window only Restore File Associations I Show all settings In the window on the left go to Projects and Solutions Locate the Show advanced build configurations check box Check the box o WEE OER 00 EE b Environment Projects location f a Projects and Solutions c users nelsonstrfgr documents visual studio 2010 Projects m General f Build and Run e Cu m EP Tot 7 c users nelsonstrfgr documents visual studio 2010 Templates ProjectTemp m gt
146. opment System CD Select the EPT 570 AP M4 Top sdc file SR N N EPT USB CPLD Development System CD Projects HDL EPT Data Collector EPT 570 AP MA Top Search EPT 570 AP M4 Top 7 Earth People Technology Organize v _ Open Share with v Burn New folder a Altera M Aptina J Arduino M Atmel Avago jJ DLP M Earth People Technology N EPT IC Project CD J EPT Projects Folders M EPT USB CPLD Development System CD Arduino IDE d Documentation J Drivers J Projects_ActiveHost_32Bit o Projects_ActiveHost_64Bit o Projects Arduino N Projects HDL 7 EPT_570_AP_M4_Top sdc State BB Shared SDC File Date modified 3 3 2013 10 31 PM Name EF 1 27U AF II LUp HLSITISU EPT 570 AP M4 Top fit summary _ EPT 570 AP M4 Top flow rpt _ EPT 570 AP M4 Top jdi _ EPT 570 AP M4 Top map rpt _ EPT 570 AP M4 Top map smsg EPT 570 AP M4 Top map summary EPT 570 AP M4 Top pin _ EPT 570 AP M4 Top pof EPT 570 AP M4 Top qpf EPT 570 AP M4 Top qsf _ EPT 570 AP M4 Top qsf bak EPT 570 AP M4 Top sdc EPT 570 AP M4 Top sta rpt _ EPT 570 AP M4 Top sta summary _ EPT 570 AP M4 Top assignment defaul Date modified Type 2 15 2012 11 20 Fivi JVV rie 3 14 2013 11 28 PM SUMMARY File 3 14 2013 11 28 PM RPT File 3 14 2013 11 28 PM JDI File 3 14 2013 11 28 PM RPT File 3 14 201311 28 PM SMSG File 3 14 201311 28 PM SUMMARY File 3 14 2013 11 28 PM PIN File 3 14
147. port will point in the same direction depending on the direction bit of the transceiver The direction bit can be changed at any time so that a port can change from input to output in minimum setup time of 6 nanoseconds Each port also has an enable pin This enable pin will enable or disable the bits of the port If the port is disabled the bits will float 1 2 3 JTAG The EPT 570 AP M4 uses the second channel of the FT2232H chip as a dedicated CPLD programming port The CPLD must be programmed via JTAG signals and the FT2232H has built in JTAG signals The CPLD can be programmed directly from Page 10 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Quartus II by using the jtag hw mbftdi blaster dlI Just click on the Programmer button and select the EPT Blaster 1 2 4 FT2232H Circuit Board The FT2232H Mini Module board contains an FTDI 2232H dual channel high speed 480 Mb s USB to FIFO first in first out integrated circuit to interface between the Host PC and the CPLD The FT2232H board provides a means of data conversion from USB to serial parallel data and serial parallel to USB for data being sent from the CPLD to the PC Channel A is configured as a JTAG bus and Channel B is configured as an 8 bit parallel bus CPLD Programming commands are transmitted via the JTAG bus channel A Channel B has one dual port 4Kbyte FIFO for transmission from Host PC to the CPLD it also has one dual port 4Kbyte
148. pts a single byte and latches it with a single enable net Because the active transfer library runs at 66 MHz we will need to write some code ensure that the slower C Enable signal from the Arduino can latch the data into the active transfer module INPUT OUTPUT PINS TOP LEVEL ACTIVE TRANSFER USER CODE LIBRARY TRIGGER IN TRIGGER OUT TRANSFER IN j TRANSFER OUT CPLD Coding up the DesignThe first thing to do is to create a top level file for the project The top level file will include the input and outputs for the CPLD These are declared according to the Verilog syntax rules We won t go through all the rules of Verilog here but feel free to explore the language more thoroughly at www asic world com verilog We need to add the inputs and outputs for active_transfer_library user code leds and switches Each port is described as input output or inout It is followed by the net type wire or reg If it is a vector the array description must be added Page 113 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual module EPT 570 AP M4 Top input wire 1 0 aa input wire 1 0 be in output wire 2 0 bc out inout wire 7 0 bd inout output wire 7 0 LB BYTE A XIOL J3 input wire 7 0 LB BYTE B XIOH1 J3 input wire 7 0 LB BYTE C XIOH2 J3 7 output reg 7 0 LB BYTE D COMMS J5 Transceiver Control Signals output wire TR DIR 1 output wire TE OE 1 output
149. r reg 3 0 transfer to host state fIransfer Control registers reg transfer in loop back reg transfer in received reg reg 3 0 transfer control state reg 7 0 transfer control byte Transfer Write from Arduino reg transfer write reg reg transfer write reg 7 0 transfer write byte Reset signals wire reset reg 11 0 reset counter reg reset signal reg Input Output Signals reg start stop cntrl Next add the assignments These assignments will set the direction of the bus transceivers that interface to the Arduino I O s The transceivers also include an output enable bit Page 115 EARTHPEODPLE TECHNOLOGY USB CPLD Development System User Manual df Signal Assignments jf f EERE EER EERE ER RE RR RE RR RE RR ER RR ER RR ER RE RR RE 1 7142 i RR RR DR RR de RR N de RR DR kk assign LB BYTE A 7 0 8 h0 assign IR DIR 1 1 bl 1 A to B 0 B to A assign IR OE 1 1 bl assign IR DIR 2 1 bi 1 A to B 0 B to A assign IR OE 2 1 BO assign TR DIR 3 1 bi 1 A to B 0 B to A assign IR OE 3 1 BO Clock and Reset assign CLE 66 aa i assign RST reset assign reset reset signal reg Iransfer registers assign transfer out transfer out reg transfer write assign transfer out byte transfer write byte LED3 is used to signify to the user that the Start switch is enabled assign LEDS start stop cntrl l b0 1 hz The reset signal 1
150. ressable modules of each Endterm Immediately after writing to the selected Endterm the value is received at the HDL Endterm in the CPLD Receiving data from the CPLD is made simple by Active Host Active Host transfers data from the CPLD as soon as it is available It stores the transferred data into circular buffer When the transfer is complete Active Host invokes a callback function which is registered in the users application This callback function provides a mechanism to transparently receive data from the CPLD The user application does not need to schedule a read from the USB or call any blocking threads 1 4 Active Transfer EndTerms The Active Transfer Library is a portfolio of HDL modules that provides an easy to use yet powerful USB transfer mechanism The user HDL code communicates with EndTerms in the form of modules These EndTerm modules are commensurate with the Active Host EndTerms There are three types of EndTerms in the Active Transfer Library e Trigger Endterm e Transfer Endterm e Block Endterm Page 12 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual They each have a simple interface that the user HDL code can use to send or receive data across the USB Writing to an EndTerm will cause the data to immediately arrive TRIGGER ENDTERM SINGLE TRANSFER ENDTERM USER CODE CTIVE TRANSFER LIBRARY BL
151. roducts Instal Size Download Size 4 Quartus II Subscription Edition includes Nios II EDS 4 9 G Quartus II software 64 bit 986 M gt Device Families 1 0 PEAK a Quartus II Web Edition Free includes Nios II EDS Quartus II software 64 bit 986 M b Device Families 2 5G ModelSim Altera Starter Edition Free 31G ModelSim Altera Edition 3 1G DSP Builder 267 M Description E Ch A Installs the Quartus II Web Edition software The Quartus II Web Edition software is Select Products a free limited feature version of the Quartus II Subscription Edition software that supports selected FPGA and CPLD device families Includes the free Nios II Embedded Design Suite Install Download Space Required 4 3G Space Available 808 G Click Next to accept the defaults Cj Altera Installer 12 1 Build 177 Installation Summary Review the installation summary to verify your software installation options and then click Next to begin the installation Destination Directory c altera 12 1 Cache Location C Users NELSON 1 AppData Local Temp altera_12 1_177 ram Folder Altera 12 1 Build 177 Copy 2 Selected Products Quartus II Web Edition Free includes Nios II EDS Quartus II Web Edition Free includes Nios II EDS Quartus II software 64 bit Arria II GX Cyclone II Cyclone II II LS Cyclone IV E Cyclone IV GX Cyclone V Legacy Families MAX II
152. rt A Data Register read write PINA The Port A Input Pins Register read only Page 102 E gt EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual The ports and pins for the Data Collection Sampler project must be initialized in the setup function The setup function will only run once after each powerup or reset of the Arduino board void setup 1 DLPA B11111111 soet Port A as outputs PORTA s Bllllllll Turn on Port A pins After the setup function executes the PORTA is ready to be assigned the results of our random function And the AO pin will be used to latch the value on PORTA pins into the CPLD 7 1 4 Coding the Arduino Data Sampler Now that we have the data generator and the ports defined we can add some delays in the loop function and make a simulated data collector Because Start and Stop buttons will be added to the C Windows Form the Data Collector code will need to monitor a single pin output from the EPT 570 AP This output pin from the EPT 570 AP becomes an input to the Arduino and is used in conditional switch void loop i 1 Sample the Start Stop switch trom the EPT 57 0 AP Srtart5topBit digitalReadf inPinsd delay SO0 Delay 500 ms 1f atartatopEit This code will sample the Start Stop switch which is an output from the EPT 570 AP on J5 PIN 3 On the Arduino this is PIN 19 of the Digital pins Each iteration of the loop function the start
153. s 41 KB N extibsa2 E jtagconfig exe 11 7 2028 39PM Application 35 KB libraries n jtagserver exe 11 7 2012 8 39 PM Application 269 KB Ji imf S liblzma dll 11 7 2012 6 57 PM Application extens 128 KB Ji qdesigns E7 Imgrd exe 12 8 2005 4 30 PM Application 1 147 KB Ji sopc_builder E Imtools exe 12 8 2005 5 33PM Application 1 060 KB Hj altera inspector log zip E Imutil exe 12 8 2005 4 30 PM Application 1 113 KB R 91 si Ad aan YU GR 11 NO SA DM Ae clie ion 7n vp jtag hw mbftdi blaster dll Date modified 1 16 2013 10 37 PM Date created 11 23 2012 11 01 AM S Application extension Size 66 5 KB The DLL is installed and the JTAG server should recognize it Go to the section Programming the CPLD of this manual for testing of the programming If the driver is not found in the Programmer Tool gt Hardware Setup box see the JTAG DLL Insert to Quartus II Troubleshooting Guide Page 20 B9 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual If your system is Windows 32 bit follow these directions Windows 32 bit 1 Open the C EPT USB CPLD Development System CD Drivers EPT_Blaster x86 folder Select the file jtag_hw_mbftdi_blaster dll and copy it Browse over to C altera 12 1 quartus bin Right click in the folder and select Paste Click Ok Open the Quartus II application sa a a QU gt Computer gt Gateway C altera 121 quartus gt bin gt b gt
154. s g zx Recent Places 1d Formi resx 4 Program cs Name i Libraries wl Homegroup O Eros jy 0 Warnings i 0 Messages Description The name m hPort does not exist in the current File name active transfer cs v Visual C Files cs remc setti v The name fContinue does not exist in the curre z r j a m Computer m The name FT Close does not exist in the current The name m hPort does not exist in the current Oe The name m hPort does not exist in the current context Forml cs EPT Transfer Test f The name of the Aj Error List PAA Eie i ini Page 89 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual In the C Express Solution Explorer you should be able to browse the files by clicking on them There should be no errors noted in the Error List box Lo mr EPT Transfer Test Micro fox File Edit View Project Debug Data Tools Window Help Ad Gia aw 4 SAY amp dD tooltip Ij mme WW Solution Explorer Bl2AIEE 59 Solution EPT Transfer Test 1 project jnamespace EPT_ emm Test mm E 4 EI EPT Transfer Test Da za Properties Sj References lt summary XE active transfer cs fe li ad designer variable ES Formi cs Pe Properties 2 X partial class EPT Transfer Test 1a401dx3 asegejeg H Formi Designer cs scite EE ComponentModel IContainer components null 3 Formi resx c Program cs lt summary gt
155. s generated by a counter that starts counting upon power up When the counter reaches GLOBAL RESET COUNT NARAAAZAALAAZLZAZAZZZZZIZZZZZZLZZLZSZZSZZZZZSAZAZZAZAZLZZLLLLLLI df Reset Signal ff ER RR EER REE REE EER EER ER ER EE EEE EE EEE EE EEE EE ERE EE RR always posedge CLE IN or negedge aa begin if aa 9 begin reset signal reg lt 1 b0 reset counter lt 0 end else begin if reset counter lt GLOBAL RESET COUNT begin reset signal reg lt l b0 reset counter lt reset counter l bi end else begin reset signal reg lt l bi end end The four LED s are set by the bottom four bits of the active trigger output register These trigger outputs can be set by using a function in the Active Host DLL on the PC The Data Collector project will use LED3 to indicate the state of the Start Stop signal Page 116 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual LED3 is used to signify to the user that the Start switch is enabled assign LEDS start stop cntrl always trigger in byte or led reset or LED or RST begin if RST LED 2 0 3 hz else if led reset LED 2 9 3 hz else if trigger_in byte 5 0 begin case trigger in byte 3 0 3j hl LED O 1 b0 jJ h2 LED i 1 b0 3 h4 LED 2 1 b0 default LED 2 05 LED 2 9 endcase end end The two user switches are connected to the input trigger register Pressing a switch will send a trigger to the P
156. s on the CPLD The Pin Planner Tool from Quartus II will add the pins and check to verify that our pin selections do not violate any restrictions of the device In the case of this example we will import pin assignments that created at an earlier time Under Assignments Select Import Assignments 3 Quartus II 64 Bit C altera 12 1spl quartus qdesigns EPI lest EFI 5 U AP Ma Top EFI 5 U AF D File Edit View Project Processing Tools Window Help 5 Search altera com jv 5 WO Dey OU He PAO F IW Download Subscription Edition Free 30 Day Trial MEASURABLE ADVANTAGE T ena eur DEE OWNLOAD NOW ANTERA QUARTUS II Version 12 1 gt B Analysis amp Synthesis gt Fitter Place amp Route gt B Assembler Generate programming files 7 Buy Software gt B TimeQuest Timing Analysis gt B EDA Netlist Writer View Quartus II Information W Program Device Open Programmer ar A A PP lt lt Search gt gt q Type ID Message At the Import Assignment dialog box Browse to the Projects_HDL EPT_Transfer_Test VAltera EPM570_M4 folder of the EPT USB CPLD Development System CD Select the EPT 570 MA Top qsf file Page 62 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Specify the source and categories of assignments to import File name chnology EPT USB CPLD Development System CD Projects HDL EPT Transfer Test Altera EPM570 M4J EPT 570 AP M4 Top qsf Cop
157. t gt JTAG amp Serial Cable B Receive Byte Ai 2 Select the EPT 570 AP device and click the Open button If the Active Host application connects to the device a label will indicate Device Connected Next select the address of the Active Transfer module in the CPLD In our case it is 2 Page 145 B EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 22 Active Host gum rem EPT USB lt gt JTAG amp Serial Cab Device Connected 3 Address 2 Received Data 7 1 15 Testing the Project To test our Data Collector project just click on the Start button As soon as the device connects the data from the Arduino will appear in the received data textBox EF ul Active Host ca a EX EPT USB lt gt JTAG amp Serial Cab Device Connected Address 2 Received Data start stop FO 36 ja 19 78 aa And that s all there is to the Data Collector Project It s up to the user to use this project as a base to create much larger projects You can easily make a volt meter using this project by turning off the Random number generator in the Arduino and reading the Page 146 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Analog Pins Also reformat the textBox display that it shows in decimal instead of the Hexadecimal display 8 Hyper Serial Port HSP Application Communication with the CPLD code from the PC is effected through the Hyp
158. t bin X64 Release folder on the MEGA_USB_CPLD_PROJECT_CD Choose the 64 Bit folder if your OS supports 64 Bit otherwise choose the 32 Bit folder See the section Assembling Building and Executing a NET Project on the PC for instructions on determining your OS version Double click on the EPT_Transfer_Text exe The application should load with a Windows form Page 5 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual AT EE EPT 570 AP Active Tr Block LoopBack BLOCK 8 Repititions Bytes ransfemed With the application loaded select the USB CPLD board from the dropdown combo box and click on the Open button Page 6 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual oJ EPT Transfer Test OM FEN X EFT USB lt gt Senial amp JTAG Cable B Transfer Controls Send Byte 255 Address 2 Receive Byte Multiple Byte 255 Switches Block Controls Block Send Block Loop Back Switch Controls LED Controls Repititions 1 Infinite Address 4 Length Bytes Transfemed Leave the Address set at 2 for the Transfer Controls Group And leave the Address set at 4 for the Block Controls Group Click on one of the LED buttons in the middle of the window The corresponding LED on the EPT 570 AP U2 board should light up To exercise the Single Byte Transfer EndTerm click the LoopBack button in the Transfer Controls group Type in s
159. t of these sample projects can copied and pasted into a user s project 3 5 Active Host Test Application EPT provides a test application to allow the user to understand the functioning of the EPT USB CPLD Development System The source code is provided for both the PC application side and the CPLD Device side The user can use this code as a starting point to create their own custom applications The windows form is show in Figure 4a Page 35 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Transfer Controls Send Byte 255 Multiple Byte 255 Multi Byte Switch Controls Switches Block Controls Block Send Bytes Transfemed Features of the Active Host interface window include e Select Device Open Device Transfer Single Byte Transfer Single Byte Loopback Trigger In Switches Trigger Out LED s Block Transfer Transfer Block Compare The Active Host can be used as an integral part of the Arduino microcontroller code development process The entire development process software consists of the the EPT Active Transfer Library Quartus II software freely available from the Altera website Page 36 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual the Arduino microcontroller development environment and the Notepad code editor available free from www notepad plus plus org The procedures for using these software systems and their interaction with the hardware described above are
160. tor sending its random word to the CPLD private void btnWriteByte Click object sender EventArgs e i int address to device address to device Convert ToInt32 tbAddress Text EPT AH SendTransferControlByte char 2 char 1 h The btnTransferReset sets the start stop cntrl bit in the Control Register to zero This action will cause the Arduino Data Collector to stop sending the random word to the CPLD private void btnTransferReset Click object sender EventArgs e i int address to device address to device Convert ToInt32 tbAddress Text EPT AH SendTransferControlByte char jaddress to device char 8 T The btnResetBlock button will clear the thDataBytes textblock The Clear method is inherited from the textbox class private void btnResetBlock Click object sender EventArgs e i y tbDataBytes Clear Page 140 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual The btnOk and btnClose buttons are used to end the application It calls the function EPT AH CloseDeviceBylndex to remove the device from the Active Host dll The buttons btnOpen and btnClose have their Enabled parameter set to true and false respectively The Enabled parameter controls whether the button is allowed to launch an event or not If it is not enabled the button is grayed out At the end of each click event the Application Exit method is called This exits the form private void btnOk Click object sender
161. ty of their respective owners and no trademark rights to the same are claimed http www earthpeopletechnology com Page 1 fb EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Table of Contents Introduction and General Description esses 4 1 1 Test Driving the Active Host Test Application sesse sesse ee ee ee ee ee ee ee 5 EN EE RE EE N 8 1 2 1 High Speed USB CommunicatOnS esse esse ee ee ee ee EE ee 10 EE J p ts Ad ie ie AE ON EE E EE NE OE ar 10 MR ii EE EE EE EE Rd 10 124 Fi ELE IECUTE DO id sesse Ge eo EE Ee Ge ee ed Ee eU 11 1 3 A OEA Derik soe Ee EE de nde CUE 12 14 Active Transter End Terms sien Deeper ge E Ge Nero 12 PEN SUME DINO RT 13 2 B DON mr enna one emer er eee eer tee mete ee ere eee ree ee ee 13 2 2 JTAG DLL Msert to Quartus TH soe ee De Re de ee ee ee ee 19 2 3 Active Host Applicatton DLL iu cese sei se eoo ptu EER seen ei se Soo es 21 93 Active HOSE Appli ali n RETE 25 s iS Ran ROUTE 24 za Erd stercB vie End CIUS sies es utis E ee GEE GE 24 29 NOC Ed Eon ri sesse settee SE DE ea ee EE MET 24 Sr MED cu Ns B P P 25 341 JADyeLIOSE Oed heide ie Ee Ee ie UBER UE 25 3 4 2 Active Host Read Callback FunCHOn sesse ss sesse esse see ee ee ee ee ee ee ee ee ee 28 AA elwe Host THESE eN ED en oe AE ee ee Re ne ee 28 344 GAOHye Host Byte Transfers Re OER Ge GR ea De ei DE eg 30 3 4 9 Active Host Block Tratisiers sesse RR ee de RE EN ER Ne Ee se A
162. ucceeded e Error List EI Find Results Build succeeded If the build fails you will have to examine each error in the Error List and fix it accordingly If you cannot fix the error using troubleshooting methods post a topic in the Earth People Technology Forum All topics will be answered by a member of the technical staff as soon as possible At this point the environment has produced an executable file and 1s ready for testing Next we will connect everything together and see it collect data and display it Page 142 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual 7 1 14 Connecting the Project Together Now we will connect the Arduino EPT 570 AP M4 and the PC to make a Data Collector First connect a USB cable from a USB port on the PC to the Arduino Second connect a USB cable from a open USB port on the PC to the EPT 570 AP M4 o Next open the Arduino IDE and select File Open and select your sketch created earlier Arduino Data Collector Code M4 ino ketch Lookin Arduino Data Collector Code Q08 PE Name Date modified Type ___ Arduino Data Collector Code ino 10 23 2012 8 31 AM INO File Recent Places Files of type A8 Fies 7 7 Cm Select the file and click Open The sketch will now populate the Arduino IDE window Compile and Download the sketch into the Arduino microcontroller using the Upload button Page
163. ur driver software Windows has finished installing the driver software for this device USB Serial Converter A Channel A of the EPT 570 AP is ready for use Next repeat the process for Channel B File Action View Help 9 EF 3 Hl 62 i PRS gt sg Disk drives A Display adapters b gi DVD CD ROM drives P 4g IDE ATA ATAPI controllers p W Monitors a Network adapters N NETGEAR WG311v3 54Mbps Wireless PCI Adapter Y Realtek PCIe GBE Family Controller 4 J Other devices jg EPT USB lt gt Serial amp UTAG b JE Ports COM amp LPT Update Driver Software N P D Processors Disable p Sound video and game contro Uninstall b Jl System devices 4 Universal Serial Bus controllers Scan for hardware changes Standard Enhanced PCI to Standard Enhanced PCI to ENDS j g Standard OpenHCD USB Host Controller Standard OpenHCD USB Host Controller be g USB Composite Device i USB Root Hub USB Root Hub i USB Root Hub Qj USBRoot Hub t USB Serial Converter A Launches the Update Driver Software Wizard for the selected device The driver files will automatically install in the System Registry Page 18 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual File Action View Help gl 3 HEI ENS ay HP DeskTop 3005 4I Computer c Disk drives N Display adapters gt 3 DVD CD ROM drives y IDE ATA ATAPI control
164. ution EPT Transfer Test 1 project ve Hos f 1 4 E EPT Transfer Test Pointer E Properties Button ba References CheckBox c active transfer cs CheckedListBox 4 E Forml cs ComboBox Form1 Designer cs Formi resx ct Program cs FEY e aseqejyeqg DateTimePicker Label LinkLabel ListBox ListView MaskedTextBox MonthCalendar Notifylcon NumericUpDown PictureBox Er E E EI E D E El kx bl ER E oe ProgressBar c Solution Explorer B dat MIT Error List O otom AN 2Wamings C 0 Messages Description Fi Line Column Project z 2 Error List REM bcnc Go to the Properties box and locate the Name cell Change the name to btnOpenDevice Locate the Text cell and change the name to Open Page 92 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual File Edit View Project Debug Data Format Tools Window Help Pdl d di amp 3m o c B tooltip J A 9 TAT N ORE a dim 582 dE oge He n 2 t ss et AG Re UIE AT ob l R al 3 BE one We MR 5t Be es Er 2 cu 2 F Solution Explorer X Forml cs Form1 Designer cs Formi cs Design active transfer cs ES s rs Mm 7 gt All Windows Forms ZJ Solution EPT Transfer Test 1 project am 4 EI EPT Transfer Test Pointer Sa Properties bal References CF active_transfer cs EE Formi cs Form1 Designer cs Form1 resx ct Program cs B
165. utton CheckBox CheckedListBox ComboBox 1210 dx3 aseqejeq DateTimePicker Label LinkLabel ListBox ListView MaskedT extBox MonthCalendar NotifyIcon NumericUpDown He mE ERIS e timerUSB PictureBox D E Bel Ex BLES I os ProgressBar Error List Qo Errors N 2 Warnings i 0 Messages Description Column Project 2 Error List SENTE Cc Double click on the Open button The C Explorer will automatically switch to the Forml cs code view The callback function will be inserted with the name of the button along with click appended to it The parameter list includes object sender System EventArgs e These two additions are required for the callback function to initiate when the click event occurs Private void btnOpenDevice_click object sender System EventArgs e There is one more addition to the project files Double click on the Form1 Designer cs file in the Solution Explorer Locate the following section of code btnOpenDevice this btnOpenDevice Location new System Drawing Point 24 13 this btnOpenDevice Mame btnOpenDevice this btnOpenDevice Size new System Drawing 5ize 5 23 this btnOpenDevice TabIndex 2 this btnOpenDevice Text Open this btnOpenDevice UseVisualStyleBackColor true this btnOpenDevice Click new System EventHandler this btnOpenDevice Click This code sets up the button size placement and te
166. ve transfer cs 4 E Forml cs Main object loader Formi Designer cs ja private void Data_Collector_Load object Program cs 7 Call the List Devices function ListDevices L Main connection function e Ted l dade d l 4M In the Configuration Manager window locate the Active solution platform label select New from the drop down box Configuration Manage Active solution configuration Active solution platform Project contexts check the project configurations to build or dep a x Project Configuration Data Collector Release In the New Solution Platform window click on the drop down box under Type Or select the new platform Select x64 Page 132 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Active solution configuration Active solution platform Reese bee 0 0 0 0 0 0 y Project contexts check the project configurations to build or deploy Project Data Collector Type or select the new platform Any CPU Itanium Create new project platforms Ganc Click the Ok button Verify that the Active Solution Platform and the Platform tab are both showing x64 Data_Collector Click Close Then using the Solution Explorer you can right click on the project select Properties and click on the Build tab on the right of the properties window Page 133 EARTHPEOPLE TECHNOLOGY USB CP
167. wire TR DIR 2 output wire TR OE 2 output wire IR DIR 3 output wire IR OE 3 output reg TE DIR 4 output reg IR OE 4 input wire SW USER 1 input wire SW USER 2 output reg 2 0 LED output wire LED3 Next the parameter s are defined These are used as constants in the user code Header Bytes for the Transfer Loopback detection parameter TRANSFER CONTROL BYTE 5 h5 parameter TRANSFER CONTROL BYTE2 3 hC3 parameter TRANSFER CONTROL BYTES 3 h7E S5tate Machine Transfer Loopback detection parameter TRANSFER CONTROL IDLE TRANSFER CONTROL HDR1 1 TRANSFER CONTROL HDR2 2 F TRANSFER DECODE BYTE i TRANSFER CONTROL SET 5 parameter GLOBAL RESET COUNT 12 hOSCA Page 114 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Next is the Internal Signal and Register Declarations ah gf RR ae eee eee EER eee eee eee eee Internal Signals and Registers Declarations f PER eee ERE KERR RE KERR KEE REE EKER RE REE REE RE ARR REA ee ee RR ee ee ee wire CLK 66 wire RST wire 22 0 UC IN wire 21 0 UC OUT Trigger Signals reg 7 0 trigger out wire 7 20 trigger in byte reg 7 0 trigger in store LED registers reg led reset Switch registers reg switch reset Iransfer registers wire transfer out reg transfer out reg wire transfer in received wire 7 0 transfer in byte wire 7 0 transfer out byte reg 3 0 transfer to host counte
168. xt It also declares the System EventHandler This statement sets the click method which is a member of Page 93 ES EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual the button class of the btnOpenDevice button to call the EventHandler btnOpenDevice Click This is where the magic of the button click event happens private void btnOpenDevice Click object sender EventArgs e i Open the Device OpenDevice private void btnCloseDevice Click object sender EventArgs e i if EPT AH CloseDeviceByIndex device index i btnBlkCompares Enabled false btnBlkComparel6 Enabled false btnTriggerl Enabled false btnTrigger2 Enabled false btnTrigger3 Enabled false btnTrigger4 Enabled false btnLEDReset Enabled false btnOpenDevice Enabled true btnCloseDevice Enabled false H When btnOpenDevice Click is called it calls the function OpenDevice This function is defined in the dll and will connect to the device selected in the combo box This is a quick view of how to create add files and add controls to a C project The user is encouraged to spend some time reviewing the online tutorial at http www homeandlearn co uk csharp csharp html to become intimately familiar with Visual C NET programming In the meantime follow the examples from the Earth People Technology to perform some simple reads and writes to the EPT USB CPLD Development System 6 2 4
169. xxx cs e Data Collector csproj Page 141 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual Data Collector csproj user Forml cs Forml Designer cs e Program cs To build the project go to Rea Build Solution lt Data Collector Micros oft yal C 2010 Expres File Edit View Refactor Project Build Debug Data Tools Window Help da G dae aA Build Solution Fe Jes btnop iG wa by a H Rebuild Solution solution Explorer sd Solution Data Collector 1 project 4 Al Data Collector gt Ea Properties af References EE active transfer cs 4 E Forml cs W Formi Designer cs a Program cs fe sm M Publish Data Collector Formi cs Des ign Configuration Manager Husing System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Ling using System Text using System Windows Forms using System Threading using System Runtime InteropServices using System Diagnostics wy xoqjoo n Sa21NOS PIE Elnamespace Data Collector El public partial class Data_Collector Form i H public Data Collector i InitializeComponent The C Express compiler will start the building process If there are no errors with code syntax function usage or linking then the environment responds with Build S
170. y existing assignments into EPT 570 AP Transfer Test qsf bak before importing ec es ee Click Ok Under Assignments Select Pin Planner Verify the pins have been imported correctly Bed EPT 570 AP M4 Top ase ENS i gt Back Annotate Assignments Import Assignments Export Assignments Assignment Groups amp LogicLock Regions Window QUARTUS II ersion 1 gt B Analysis amp Synthesis gt Fitter Place amp Route gt B Assembler Generate programming files gt B TimeQuest Timing Analysis gt B EDANetist Writer RY View Quartus Il Information gt Program Device Open Programmer Documentation ws Buy Software ID Message The pin locations should not need to be changed for EPT USB CPLD Development System However if you need to change any pin location just click on the location Page 63 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual column for the particular node you wish to change Then select the new pin location from the drop down box 57 Pin Planner C altera 12 1spl1 quartus adesigns EPT Transfer Tes EPT 570 AP MA Top EPT 570 AP M4 Top File Edit View Processing Tools Window Help 5 Search altera com lgx rano Report LJ mous m m roma aan 85s N wu 7 eec0 70e0 0 0000000 II Report not available ex 9 Run Analysis and Elaboration 4 Early Pin Planning J C Early Pin Planning 9
171. yIndex EPT AH CloseDeviceByIndex EPT AH SelectActiveDeviceByIndex EPT AH SendTrigger EPT AH SendB yte EPT AH SendBlock EPT AH RegisterReadCallback 3 4 1 Active Host Open Device To use the library functions for data transfer and triggering an Earth People Technology device must be opened The first function called when the Windows Form loads up is the project name Load This function is called automatically upon the completion of the Windows Form so there is no need to do anything to call it Once this Page 25 E95 EARTHPEOPLE TECHNOLOGY USB CPLD Development System User Manual function is called it in turn calls the ListDevices Use the function List Devices to detect all EPT devices connected to the PC Main object loader private void EPT 578 AP Active Transfer Load object sender System EventArgs e Call the List Devices function ListDevices H The ListDevices function calls the EPT_AH_Open function to load up the ActiveHost DII Next it calls EPT_AH_QueryDevices which searches through the registry files to determine the number of EPT devices attached to the PC Next EPT_AH_GetDeviceName is called inside a for loop to return the ASCII name of each device attached to the PC It will automatically populate the combo box cmbDevList with all the EPT devices it finds List Devices function private unsafe Int32 ListDevices 1 Int32 result Int32 num dev

Download Pdf Manuals

image

Related Search

Related Contents

Exhibitor Kit - Cloud Partners  Roland 115X User's Manual      Rubiomonocoat FR OIL SYSTEM (revêtements de sol)  Adobe PDF  KitchenAid KUIC18NNT User's Manual  

Copyright © All rights reserved.
Failed to retrieve file