Quick Quartus: Schematic Entry

← Back to E15 Lab page ←

Please contact me if you find any errors or other problems (e.g., something is unclearly stated) in this web page

This document presents a (very) quick introduction to the use of Quartus to design a system for schematic entry.

The Basics
Automatic Pin Assignment
Adding other parts
Common Problems

The Basics

  1. Start Quartus (it is in the "Altera" folder in the Windows Start menu).
  2. Select "Create a New Project (New Project Wizard)"
  3. Hit "Next >" to get past "Introduction" page.
  4. On the next page ("Directory, Name, Top-Level Entity [page 1 of 5]") choose a working directory (preferably one you can access from anywhere on campus) and choose a project name.  Then hit "Next >"
  5. Hit "Next >" (from "Add Files [page 2 of 5]").
  6. On the next page ("Family and Device Settings [page 3 of 5]"):
    1. choose Family: "Cyclone II"
    2. choose Available Devices: "EP2C35F672C6" (the number on the large chip on the DE2 Altera board).  Note, these are not alphabetical, so you need to scroll through the choices.
    3. hit "Next >"
  7. Hit "Next >" ("EDA Tool Settings [page 4 of 5]")
  8. Hit "Finish" ("Summary [page 5 of 5]")
  9. From the Quartus main menu choose "File→New→Block Diagram/Schematic File" then "OK"
  10. To add a circuit element, choose the Add Circuit Element Icon icon from the menu bar.  Expand the libraries entry and choose "Primitives/logic/or2"  Hit "OK" and place it on the open page.  Hit "Esc" after placing one element.
  11. Repeat the above with "Primitives/pin/output" (1 of these) and "Primitives/pin/input" (2 of these).
  12. Connect the input pins to the input of the or gate (click and drag to add wires).  You should have a diagram something like the one shown below.
    SimpleOrGate
  13. Save your design.
  14. From the main Quartus menu go to "Processing→StartAnalysis & Elaboration."  This is the first step in compiling your design and determines inputs and output to your design.  After this is successfully completed, move on to the next step.
  15. To demonstrate this circuit in action, we need to assign the inputs and outputs to physical devices on the DE2 board.  To do this, relabel the inputs as "A" and "B" (it doesn't matter which is which) and label the output "X".  Hit "Processing→StartAnalysis & Elaboration" again.  Now, from the main Quartus menu, go to "Assignment→Pin Planner. " This shows a rather complicated diagram representing all of the outputs available on the EP2C35F672C6 device (the pins are on the bottom of the chip, so you can't see them).  Towards the bottom of the window, your inputs and outputs are defined.  We need to specify the "location" of each of your inputs and outputs on the chip.  Refer to the file DE2_Pin_Table.pdf for a description of each.  We will connect the inputs to two of the pushbuttons on the DE2 board and the output to an LED.
    1. For the input "A" go to the "Location" column and choose "PIN_G26" which is connected to KEY[0] (the rightmost pushbutton).
    2. Set "B" to "PIN_N23" (KEY[1]).
    3. Set "X" to "PIN_U18" (LEDG[4]).
    4. Close the "Pin Planner" window.
    5. Your design should show the pin assignments.
      Design with pin assignments
  16. Now let's compile the design, with the pin assignments. Go to "Processing→Start Compilation".  You will get several warnings - ignore these.
  17. Make sure the DE2 board is turned on and connected to the computer through the USB port labeled "Blaster" (there are two USB ports on the DE2 board. Go to "Tools→Programmer"  The "Hardware Setup" should show "USB-Blaster".  If so, hit "Start".  If not you'll have to setup the hardware.
  18. Your design is now running, with the inputs connected to KEY[0] and KEY[1], and the output to LEDG[4].  Note that the buttons are active low (i.e., they are at a logic high when not pushed, and logic low when pushed), so you'll have to push in both buttons to turn the LED off.  Make sure the circuit works as expected.

A Simpler way to assign pins

There is an easier way to define input/output (I/O) pins using the definitions in the file E15DE2_IO.qsf.  This file predefines all of the pins with the names given in DE2_Pin_Table.pdf.  To see how this works, copy E15DE2_IO.qsf to your working directory.

  1. Change the labels on the inputs to SW[16] and SW[17] (the two leftmost toggle switches) and the output to LEDR[0].
  2. Go to "Assignment→Import Assignments..." and choose the E15DE2_IO.qsf file.  This should automatically assign the proper pins.
  3. Compile and download the design to verify that it works.  Note that SW[16] and SW[17] are on the far left of the DE2 board.  Sometimes the pin assignments don't show up (even though they are there).  In this case just close the schematic file and reopen it - the pin assignments should be visible.

Adding A Predefined Circuit Element

We can also add our own circuits to those supplied by Altera.  In particular, it will sometimes be useful to add a counter so that we can cylce through multiple inputs.

  1. Add the files E15Counter1Hz.bsf and E15Counter1Hz.v to your working directory (note: we could have added these at the start and included them as part of the project using the project wizard).  You'll learn what's in the .v file later.
  2. Go to "Project→Add/Remove Files in Project..." and add E15Counter1Hz.v to the project.
  3. Now go the the schematic, choose Add Circuit Element Icon and select the part "E15Counter1Hz" from the "Project" library.   This is a counter with 4 output bits (Q3...Q0, with Q3 being the Most Significant Bit and Q0 the least) that takes a 50MHz input (available on the DE2) and counts at 1 Hz until the output reaches the number on the inputs (D3...D0).
  4. Connect as shown below.  Note the "Vcc" (logic 1) and "GND" (logic 0) parts are found by choosing Add Circuit Element Icon, and then going to "primitives/other" in the Altera library.  The pin labeled "CLOCK_50" (i.e., PIN_N2) is set to a signal (called a clock) that oscillates at 50 MegaHertz (50 MHz = 50 million times per second).
    Circuit with counter
  5. Compile and run.  Four of the green LED's will count up in binary for 12 counts (from 0 to 11; D3...D0=10112(binary)=1110(decimal)), and the red LED should be off only when the two least significant bits (Q0 and Q1) are off.

Common Problems (and their solution)

← Back to E15 Lab page ←

Please contact me if you find any errors or other problems (e.g., something is unclearly stated) in this web page