UNIVERSITY
OF BRITISH COLUMBIA
DEPARTMENT
OF ELECTRICAL AND COMPUTER ENGINEERING
Instructions for Programming Altera DE1 Boards
January 14, 2011
Overview
These instructions are for using Quartus II to download a precompiled circuit design into your DE1 board. The circuit design is stored in a file with the extension .pof or .sof. There are two ways of programming your DE1 board: temporary and persistent. The main chip on the board, an Altera Cyclone II FPGA, stores its programming data in its internal SRAM. However SRAM is volatile, meaning it forgets the data each time the chip is turned off. The persistent way stores the programming into a tiny non-volatile Flash memory chip on the DE1 board (it is labeled U16 on my board). This Flash memory copied the FPGAÕs internal SRAM each time it is turned on.
A. Download and Install the Altera Software
The bare minimum you need to program your board is installation of Quartus II and the USB-Blaster Cable device driver. However, you will need the other tools later, so you might as well install everything.
http://courses.ece.ubc.ca/259/homework/installing.htm
B. Programming the DE1
Overview. First, you have to set up the Quartus II software so that it uses the USB-Blaster Cable. Since there are many types of programming hardware, you have to tell it which one to use. After that, you can program your board with either the .pof (persistent) or .sof (temporary) files we provide on the course website.
B1. Software Setup
1) Start Quartus II:
Start ˆ Programs ˆ
Altera ˆ Quartus II 9.1sp2 Web Editionˆ Quartus II 9.1sp2 Web
Edition
2) Start the Programmer feature by choosing Tools ˆ Programmer. Alternatively, there is a shortcut icon below the menu bar – it appears as a cyan diamond a wavy squiggle on top, representing a chip with a cable coming out of it.
3) Choose Hardware Setup at the top-left of the main programmer window.
4) In the hardware setup window, beside Currently Selected Hardware, select USB-Blaster, then close the hardware setup window. If the USB-Blaster option is missing, check that: a) the DE1 is plugged directly into the computer (not a hub) and is turned on, and b) the USB-Blaster device driver was installed.
B2. Programming the EPROM (Persistent)
5) In this section, you will be downloading a .pof file into a programmable EPROM memory chip on the board. On power-up, the contents of this EPROM automatically loaded into the FPGA. This gives you a way to automatically program the FPGA each time you power-up the board.
6) On the left side of the DE1 board there is a toggle switch with PROG and RUN positions. Turn OFF the board, put the switch in the PROG position, and turn it ON again. The LEDs will appear to be dimly lit; this is normal.
7) Back
in the main programmer window, beside the Hardware Setup (which should now
say USB-Blaster), there is a Mode selection box where currently JTAG
is selected. Change JTAG
to Active Serial Programming.
8) Choose Add File from the buttons down the left side of the main programmer window.
9)
Select the .pof file you would like to
program into your board. The
default programming files for your DE1 board are located here:
http://courses.ece.ubc.ca/259/homework/files/default
10) Check the boxes under Program/Configure, so it will actually program your board.
11) Select Start, and the programmer will start downloading the design to your DE1 board. This method is slower than the temporary method, taking on the order of 10 seconds or more.
12) After the
download is complete, power off the board and change the PROG / RUN
switch back to RUN.
13) Power the board back on. Your design will be loaded immediately.
B3. Programming the FPGA (Temporary)
14) In this section, you will be downloading a .sof file directly into the FPGA chip. When you turn off the board, the FPGA loses this programming information. The next time it is turned on, it will reload the last .pof that was stored in the programmable EPROM on the board.
15) Make sure the PROG / RUN switch on the left side of the DE1 is in the RUN position. (Yes, RUN, not PROG. For temporarily programming, keep this switch on RUN.)
16) Back in the main programmer window, beside the Hardware Setup (which should say USB-Blaster), make sure the Mode selection box is on JTAG
17) Choose Add File from the buttons down the left side of the main programmer window.
18) Select the .sof file you would like to program into your board.
19) Check the boxes under Program/Configure, so it will actually program your board.
20) Select Start and the programmer will begin the process of downloading the design to your DE1 board. This normally takes 1 or 2 seconds. When complete, the design will automatically become active.
C. Testing Your DE1 Board
21) The manufacturer of the DE1 board is Terasic. They have a DE1 web page with the latest PDFs and CDROM files:
http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=39&No=83
22) If you want to test your DE1 board, use the ÒDE1 Control PanelÓ application. It is located on the DE1 CDROM.
23) To use the Control Panel application:
a) Program your board with the DE1_USB_API.pof file in persistent mode and exit the Quartus II programmer.
b) Keep your DE1 board plugged into the USB port.
c) Next, run the DE1_Control_Panel.exe program and go to Open ˆ Open USB Port 0 so it can use the USB-Blaster.
d) Change the 7-segment displays to 8888 and check all the LED options, then press Set. Your board should light up all of the red, green, and 7-segment LEDs.
e) If you have a spare keyboard from a PC that uses the PS2 port, connect it to the PS2 port on your board and test it out.
f) You can select the other tabs to test other parts of the board. There are 3 different memories: SRAM, SDRAM, and Flash. Also, you can test the VGA out by connecting your DE1 board to a VGA monitor.
g) Go to the Tools tab and press Board Test. You can check all the tests (but do not bother with the LCD test, since you donÕt have an LCD) and press Start Test. After each test, a dialog box should pop up to say it passed.
h) When you are done, select Open ˆ Close USB port and exit.