header

3bit Binary Counter for the Altera DEnano Development Kit

There are four basic steps to using the development kit. One, set up the directories to hold the project. Two, design the project. Three, simulate the project. And four, load the project to the development kit.

3bit_counter.zip - Zip file of all files from this example.

Setting Up the Project

Start Quartus and go to File -> New Project Wizard.

step 1 of setup

Click Next on the first screen.

step 2 of setup

Pick a place to store the project files and give the project a name.

step 3 of setup

If the directory you specify is not present, you'll be prompted to create it.

step 4 of setup

Click Next on the next window.

step 5 of setup

This window is very important. This is where we specify which chip we're using. If you look at our development kits, you should be able to read our chip, which is a MAX II EPM2210F324C3N, so select that chip (don't worry about the last N) in the list. Make sure that you have Family set to MAX II and Devices All.

step 6 of setup

Click Next in the next window.

step 7 of setup

This last window is just the summary of the project that has just been setup. Click Finish.

step 8 of setup

Designing the Project

Now we need to put the design the counter. In this example, we'll do it graphically. So the first step is to open a new schematic file. Go to File -> New and choose Block Diagram/Schematic File from the window that pops up.

step 1 of design
step 2 of design

The next step is to insert symbols. Get to the symbol menu by going to Edit -> Insert Symbol or use the Symbol Tool.

step 3 of design
or
location of symbol tool

The first item to insert is a tff (toggle flipflop). It's located in the storage section. Check the Repeat-insert mode box, since we'll need three of these.

step 4 of design

You should now have three tffs in your design.

step 5 of design

Next, go back to the insert symbols menu and this time choose an input pin.

step 6 of design

We'll need to input pins.

step 7 of design

Now do the same thing and insert three output pins.

step 8 of design

Repeat again and put a vcc in. The vcc will be found under primitives, then other in the symbol menu.

step 9 of design

Those are all the parts that you need. Now you need to connect them according to the following diagram. Use the Orthogonal Node Tool to draw the connections.

showing location of tool to use

And after connecting all the parts, change the names of the input and output pins. Follow the names in the image below.

step 10 of design

Save the project.

save project

Once everything is connected, you can start compilation of the project.

start compilation

If you didn't make any mistakes, you should have a successful compilation. If it's not successful, check the error messages to see what went wrong.

successful compilation

Now you need to assign the pins in your design, to actual pins on the board.

assign pins

Double-click in the Location cell of the pin to bring up the menu of choices.

list of pins

Assign pins according to the following diagram and then RERUN THE COMPILATION.

pin assignments

Simulating the Project

Now that we have our project, we can set up some inputs and see what the outputs would be to see if our design is correct.

The first step is to set up a vector waveform file. Go to File -> New and choose vector waveform file from the list.

new waveform file

Now we need to add our pins to the waveform file.

add inputs

In the "Insert Node or Bus" window, click the Node-Finder button.

Node finder

In the Node Finder, change the Filter to Pins:all and click on the List button to see all the pins.

list pins

Select all the pins in the Nodes Found window and then click on the > button to put them in the Selected Nodes window.

select pins

After you press OK, you should be back at the Insert Node or Bus window and it should look like this. Just press OK.

nodes selected

Your waveform file should now look like this.

waveform file

You now need to assign values to your inputs. For button 1, just assign a clock to it. Click on the symbol with the 0 next to it to highlight the entire line. Then assign a clock signal to it.

assign clock to button 1

Take the default values for the clock that come up.

clock settings

Next highlight the line for button 4 and click the icon to set the signal to 1. (Note the screenshot was taken before the button was pushed.)

select button 4

Save the file.

save waveform

Start the simulation

start simulation

If everything worked, you should get a success message.

simulation success

The simulation results.

simulation results

Programming the Chip

Now the our project has been programmed and simulated and everything is as we expect, it's time to program the chip.

Make sure that the DEnano board is connected to the computer and start the Programmer.

start programmer

This is the programming window. Click on the Hardware Setup button.

programmer window

Select the USB-Blaster from the list and then click close.

select usb blaster

With the USB Blaster selected, check the Program/Configure checkbox.

programmer setup

Click the Start button to start programming. Note that two blue lights should light up on the DEnano board. Also, note that sometimes the programmer window gets pushed beneath the Quartus window. If it disappears, minimize the Quartus window to find it. Once the progress reaches 100%, you're finished. Try pushing button 1 on the board to count in binary and try pushing button 4 to reset the counter.

done programming
18 Jun 2009
Mary Heintz