Assigning Pins:

Select Assignments | Pin Planner  from the pull-down menu.

assigning pins

You'll see a schematic of your device which shows the satus of various pins, with a list of your inputs and outputs below.

assigned pinout

You will notice that the pins around the edges of the chip have different symbols. The plain round circles with nothing written inside of them are used for input and output.

Assign all of your pins to fit in one "bank" of CPLD connections, so only one jumper cable is required. Banks are:

For example, here is bank one.

pld board bank
[click image to get a larger image]

Here is bank two.

pld board bank
[click image to get a larger image]

Select each input and output from the bottom of the screen and drag it on top of the pin you would like to use - make sure you click on the name. (ie. if you want h to be pin 4, click h on the bottom of the screen and drag it on top of the circle under the label 4). Remember, use ONLY the plain round circles!!
You only need to assign your inputs and outputs; you will probably see some other signals listed that you didn't specify. Leave them as they are.

When you are finished you can close the window.

Recompile Design

You will need to compile your design again to fit your design on the PLD board.

Click on Processing | Start Compilation to start compilation.

Setting up Programming Hardware in Quartus II Software:

Connect your USB-Blaster cable to one of the USB ports on your computer.

Note: Under linux, for the programmer to connect, do the following as root once the programmer is plugged into the computer:
From your Quartus II binary directory, (i.e. where the quartus executable is located), run

  1. jtagd
  2. jtagconfig

After this, the programmer should work.

Choose Tools | Programmer. The Programmer window will open.

selecting programmer

The selected programming hardware is identified as. If it says "USB-Blaster [USB-0] mode JTAG" you have the correct hardware (skip to the connection step).

select programmer

Click the Hardware Setup button to open the Hardware Setup window.

Programming hardware that is already set up appears in the Available hardware items window.

usb blaster

If the USB-Blaster is not listed as the Currently selected hardware, select it and click the Add Hardware.

usb blaster 
selected

Click Close.

At the main window, ensure it displays USB-Blaster[USB-0] mode JTAG (see figure below)

Connecting Programming Hardware to the Device:

Connect CPLD board to USB-Blaster cable (connected to a USB port on your PC).

The cable should be attached so that the red edge of the USB-Blaster cable is next to the number (usually a "1" or a "2") that has been written on the board with a marker. IF YOU'RE NOT SURE, ASK!!!

JTAG cable

pld board with JTAG library
[click image to get a larger image]

Connect the ground and power (5v) to the CPLD board and turn the power on.

Click Auto Detect, your program should detect the CPLD.
If it doesn't, there are three possibilities:

  1. You haven't chosen the correct device.
  2. Your cables aren't connected correctly.
  3. Your CPLD is faulty.
Problem Solution
Unable to scan device chain.

This is generally a problem with power. Check:

  1. Is the power and ground connected properly and turned on?
  2. Is the red strip on the USB-Blaster cable connected to the proper side of the board?
JTAG error

This is generally a problem with the connection. Try:

  1. Make sure you have the correct device selected
    • ensure 7064 (not 7032)
    • ensure SLC (not STC)
  2. Unplug the USB-Blaster cable and reconnect.
  3. Try a new USB-Blaster cable.
  4. Try a new CPLD board
License error

This is generally a problem if you haven't done anything with the software recently. The server times out and loses the connection to the licencing file.

  1. Close Quartus and reopen.

Once it autodetects correctly, you can proceed.

auto detect device

Delete the file that shows up.

Click Add File choose 'pof' file

select 
programmer

Check Program/Configure

Select Start, you should see the progress indicator increasing slowly (fast means problem).

Wiring the Input and Output

You can unplug the USB-Blaster cable and turn off the power while you are wiring your circuit. You will not lose your program.

Use the debugger board to wire the input (use the control mode) and the output (use the display mode). (ie. c, h, p & f)

Troubleshooting

If you smell smoke turn off the power immediately and DO NOT touch the Altera chip. It gets extremely hot if it is short circuited. Check all your power and grounds, have someone else check your power and grounds - something IS wrong!! Hopefully, your chip will still work. :)

  1. First, double check your simulation to ensure that your Quartus design is correct. If it is not correct then you will not get the correct output no matter how well everything else is connected.
  2. Next, check your device, even if you think it's right... double check. If you need to change it make sure you recompile.
  3. Check your pin assignments and make sure you have not assigned any of your inputs or outputs to reserved pins or specialized pins. Plain circles only (with no writing inside).
  4. Make sure you have power and ground to your boards (CPLD, debugger, breadboard).
  5. Make sure you have the debugger board set up for input and output correctly.
  6. If some signals seem to be right and some seem to be wrong, check your pins to make sure you are in the correct place and use the multimeter to ensure you have good connections.