You are on page 1of 7

University of British Columbia

Electrical and Computer Engineering


Introduction to Microcomputers
EECE259
DE2-8052 Soft-Core: Getting Started Guide
Copyright 2!"2##$ %esus Calvino"&raga
Introduction
'his document provides step by step instructions on ho( to build$ load$ and run user code
in an !52 soft"core processor configured for the )ltera *E2 board+ 'hese instructions
are also valid for the *E#"!52 board$ as indicated in the te,t belo(+
Configuration Steps
'hese configuration steps need to be e,ecuted only once-
#. *o(nload the /uartus II pro0ect files for the !52 soft"core from the course
1ebC' page+ )ll the re2uired files are compressed in the file DE2_8052.zip
3DE1_8052.zip if you have an )ltera *E# board.+ *ecompress all files in a
folder of your choice+ If you are using the laboratory computers$ remember to
decompress the files in a folder into your net(or4 drive 5-
2. 6tart /uartus II+ 7pen the pro0ect DE2_8052.qpf 3DE1_8052.qpf if you have
an )ltera *E# board.+
8. 9ou may s4ip this step if you (ant$ as the configuration file :DE2_8052.pof
3DE1_8052.pof if you have an )ltera *E# board. is already included in the
pro0ect+ 7ther(ise$ in /uartus II clic4 Processing Start Compiation+ It
may ta4e a fe( minutes for /uartus II to finish synthesi;ing the *E2"!52
processor+
<. Connect the )ltera board to the computer using the U6B cable+ Change 61#9
361#2 in the )ltera *E#. from !"# to P!$%+ 'urn on the )ltera board+
5. 'o do(nload the configuration file to the )ltera board clic4 &oos
Programmer+ In the line (here the file DE2_8052.pof is 3DE1_8052.pof if
you have an )ltera *E# board.$ ma4e sure the selection bo,
Program'Config(re is chec4ed+ 'hen press the Start button+ ) moving
progress bar sho(s that the )ltera board is being configured (ith the !52 soft"
core+ Be patient+ 'his usually ta4es several seconds+ =ote- In /uartus II version
9+$ it ta4es a long time for the bar to start moving>
#
?. 1hen the configuration completes change 61#9 361#2 in the )ltera *E#. from
:@A7BC to :AU=C+ 'he *E2"!52 soft"core processor is no( loaded in the
)ltera board+
Compiling and Loading Programs into the DE2-8052/DE-8052
'he *E2"!52 soft"core processor includes a boot loader that can be used to load and run
user programs+ Before doing that$ (e need to (rite and compile our program-
#. *o(nload and install Crosside from the course (eb page+ Crosside is a te,t
editor (ith assembly and C synta, highlighting+ It also includes a module to
transmit files to the *E2"!52D*E#"!52 processor and Call5#- C compiler$
assembler$ lin4er and librarian for the !5# family of processors+
2. 6tart Crosside+ Create a ne( assembly file by clic4ing )ie*+#e,*+-sm
so(rce fie+ 'ype your assembly program and save it+ 'he figure belo( sho(s
an assembly program saved as .in/0.asm+
2
8. 'o compile the program clic4 1(i2*+-S351+ ) pop"up (indo( appears+
Clic4 the first 1ro,se button and find the program a51.e4e in the .in folder
of your Call5# installation-
Clic4 $5+ If your program has no errors you can proceed to the ne,t step+
7ther(ise you need to fi, the errors and try again+
<. )fter compiling your source file$ a ne( file (ith the same name and e,tension
.6E7 is generated+ 'his is the file (e load or fas8 into the *E2"!52D*E#"
8
!52 soft"core processor+ 'o do that (e need to activate the boot"loader by
follo(ing these steps-
a+ @ress and hold EE9#+
b+ 1hile holding EE9#$ press and release EE9+
c+ Aelease EE9#+
1hen the boot"loader is activated$ FE*B is on and all other FE*s are off+ In
Crosside press f9as8*+DE4*8052+ Ma4e sure the field Port is set to "S1*
1aster+ 37f course you need to 4eep the computer connected to the *E2D*E#
board (ith the U6B cable>. @ress )as8+ 1ait until the program finishes+
5. EE9 is configured as the Aeset button for both the *E2"!52 and *E#"!52
soft"core processors+ @ress EE9 and your program starts running+
<
DE2-8052 Soft-Core Special !unction "egisters #S!"s$
'he !52 soft"core includes all the standard !52 6&As+ 6ome additional 6&As (ere
added to provide access to some of the resources in the )ltera *E2 board+ 'hese are the
additional 6&As-
SFR Address Description
GEH 9#G 6even segment display
GEH# 92G 6even segment display #
GEH2 98G 6even segment display 2
GEH8 9<G 6even segment display 8
GEH< !EG 6even segment display <
GEH5 !&G 6even segment display 5
GEH? 9?G 6even segment display ?
GEHI 9IG 6even segment display I
FE*A) E!G FE*s FE*A to FE*AI 3bit addressable.+
FE*AB 95G FE*s FE*A! to FE*A#5+
FE*AC 9EG FE*s FE*A#?$ FE*A#I$ and FE*B!+
FE*B &!G FE*s FE*B to FE*BI 3bit addressable.+
61) E!G 6(itches 61 to 61I 3bit addressable.+
61B 95G 6(itches 61! to 61#5+
61C 9EG 6(itches 61#? and 61#I+
EE9 &!G EE9#JEE9+#$ EE92JEE9+2$ EE98JEE9+8+
FC*KCM* *!G BitI Bit? Bit5 Bit< Bit8 Bit2 Bit# Bit
H H H Blon 7= A6 E= A1
FC*K*)') *9G InputDoutput port to FC*
FC*KM7* *)G 1rite &&G to ma4e FC*K*)') an output
@M7* 9)G InputD7utput mode bits for port
@#M7* 9BG InputD7utput mode bits for port #
@2M7* 9CG InputD7utput mode bits for port 2
@8M7* 9*G InputD7utput mode bits for port 8
5
DE-8052 Soft-Core Special !unction "egisters #S!"s$
'he *E#"!52 soft"core includes all the standard !52 6&As+ 6ome additional 6&As
(ere added to provide access to some of the resources in the )ltera *E# board+ 'hese
are the additional 6&As-
SFR Address Description
GEH 9#G 6even segment display
GEH# 92G 6even segment display #
GEH2 98G 6even segment display 2
GEH8 9<G 6even segment display 8
FE*A) E!G FE*s FE*A to FE*AI 3bit addressable.+
FE*AB 95G FE*s FE*A! and FE*A9+
FE*B &!G FE*s FE*B to FE*BI 3bit addressable.+
61) E!G 6(itches 61 to 61I 3bit addressable.+
61B 95G 6(itches 61! and 619+
@M7* 9)G InputD7utput mode bits for port
@#M7* 9BG InputD7utput mode bits for port #
@2M7* 9CG InputD7utput mode bits for port 2
@8M7* 9*G InputD7utput mode bits for port 8
?
Pin %ssignments
)ll the standard !52 ID7 pins are assigned to the e,pansion headers of the )ltera
*E2D*E# board+ By default all the port pins 3@ to @8. are configured as inputs+ 'o
configure any of the pins of a port as an output (rite # to the corresponding bit in the
@,M7* register described above+ &or e,ample to ma4e @+ and @+I outputs and leave
@+# to @+? as inputs$ (rite !#G to @M7*+ 'hese are the pin assignments-
%@#
Not used 1 2 Not used
Not used 3 4 Not used
Not used 5 6 Not used
Not used 7 8 Not used
Not used 9 10 Not used
5V 11 12 GND
Not used 13 14 Not used
Not used 15 16 Not used
Not used 17 18 Not used
Not used 19 20 Not used
Not used 21 22 Not used
Not used 23 24 Not used
Not used 25 26 Not used
Not used 27 28 Not used
3.3V 29 30 GND
Not used 31 32 Not used
Not used 33 34 Not used
Not used 35 36 Not used
T0 37 38 T1
T2 39 40 T2EX
%@2
P0.0 1 2 P0.1
P0.2 3 4 P0.3
P0.4 5 6 P0.5
P0.6 7 8 P0.7
P1.0 9 10 P1.1
5V 11 12 GND
P1.2 13 14 P1.3
P1.4 15 16 P1.5
P1.6 17 18 P1.7
P2.0 19 20 P2.1
P2.2 21 22 P2.3
P2.4 23 24 P2.5
P2.6 25 26 P2.7
P3.0 27 28 P3.1
3.3V 29 30 GND
P3.2 31 32 P3.3
P3.4 33 34 P3.5
P3.6 35 36 P3.7
INT0 37 38 INT1
Not Used 39 40 Not used
I

You might also like