Wentworth Institute of Technology

Department of Electrical Engineering and Technology

Elec 667 Advanced Programmable Logic

Assigning Pins using DE2_pin_assignments.csv

  1. Adding pin assignments can become a tedious chore as the NIOS II processors become loaded with more and more features.  In our early labs since there are only a few switches and LEDs we are working with, this typically will be fairly short typing assignment.  However, let’s take the opportunity to introduce a short-cut.  Quartus II will allow users to import assignments using comma-separated-values files (*.csv).  Altera uses COOP students from Canadian universities and one lucky student got to type 400+ assignments into a spreadsheet.  This file is called DE2_pin_assignments.csv and is found on the Altera website:

 

ftp://ftp.altera.com/up/pub/Altera_Material/QII_9.1/Development_Boards/DE2/

 

  1. Save this file where you can find it later.
  2. To import these assignments into Quartus II for use with any project, click Assignments on the main menu and select Import Assignments.  The following screen will appear:

 

 

  1.  Browse to the DE2_Board_pin_assignments.csv location.  ALSO, deselect Copy existing assignments into…. and then click OK. In the Quartus II message window you should see that 425 assignments were written. 
  2. We have to deal with the FPGA unused pins.  Some authors suggest they should be set to “inputs tri-stated with weak pull up”.  Here is the click path to deal with that issue.
    1. Assignments>>Device.
    2. Click “Device and Pin option” button:

 

 

    1. Select the Unused Pins tab then used the pull down to see your options.

 

 

 

  1. Your application may not tolerate the output pushing ground out the I/O’s so consider “As output driving an unspecified signal” or the recommended “As input tri=stated with weak pull-up”.
  2. Also, Dual Purpose Pins, specifically nCEO which is used by the IRDA_TXD, needs to be changed.

 

 

    1. Click on the Dual-Purpose Pins tab
    2. Double-left click in the Value column for NCEO a pull down menu appears
    3. Select “Use as regular I/O”.
    4. Close out of here back to your project

 

  1. Suppose you’ve all ready used some assignment in a previous project and you want to reuse the file but you’ve deleted some IP.    Those pins are still assigned.  Here’s how you can clean them up.
  2. Assignment>>Remove Assignments looks interesting and I did notice some categories related to trouble shooting: Design Assistant, Programmer, Signal Probe, Signal Tap II, Incremental Compilation.  

 

Figure 34 Subjects for further investigation at a later date.

 

  1.  The check box at the bottom “Remove obsolete assignment” may work if we knew what Quartus considers an obsolete assignment.  Click on Help  and type obsolete assignments into the search box.  Two topics come up that appear interesting.  One of them gives us a definition: the removal of design assignments that no longer exist.  We did make assignments for pins that have nothing connected to them externally or internally.  What about the other two removal choices: global and instance?  Include in your lab reports a screen shot of the Remove Assignments text box what boxes you checked to clean up the excessive pin assignments.
  2. Check the results by clicking Assignments>>Assignment Editor.

 

  1. I love this feature.  You can import all the pins then trim away the ones you don’t want.  The assignment of the global 50 MHz clock is correctly assigned to PIN_N2 and KEY(0) goes to the pin (PIN_G26) for the blue push button.  The switches are assigned starting from the right end of the row and using the next 7 consecutively.  LEDG go the right pins to turn on the green LEDs.  Everything is correct.
  2. Include in your lab reports a screen shot of some of the pin assignments with the message about the number of assignments written.