Terasic DE1-SoC User manual

Type
User manual
DE1-SoC User Manual
1
www.terasic.com
March 14, 2014
DE1-SoC User Manual
1
www.terasic.com
March 14, 2014
CONTENTS
Chapter 1 DE1-SoC Development Kit ........................................................................ 4
1.1 Package Contents........................................................................................................................................ 4
1.2 DE1-SoC System CD ................................................................................................................................. 5
1.3 Getting Help ............................................................................................................................................... 5
Chapter 2 Introduction of the DE1-SoC Board ............................................................ 6
2.1 Layout and Components ............................................................................................................................. 6
2.2 Block Diagram of the DE1-SoC Board ...................................................................................................... 8
Chapter 3 Using the DE1-SoC Board ....................................................................... 12
3.1 Settings of FPGA Configuration Mode .................................................................................................... 12
3.2 Configuration of Cyclone V SoC FPGA on DE1-SoC ............................................................................. 13
3.3 Board Status Elements .............................................................................................................................. 19
3.4 Board Reset Elements ............................................................................................................................... 19
3.5 Clock Circuitry ......................................................................................................................................... 21
3.6 Peripherals Connected to the FPGA ......................................................................................................... 22
3.6.1 User Push-buttons, Switches and LEDs ................................................................................................ 23
3.6.2 7-segment Displays ............................................................................................................................... 26
3.6.3 2x20 GPIO Expansion Headers ............................................................................................................. 28
3.6.4 24-bit Audio CODEC ............................................................................................................................ 30
3.6.5 I2C Multiplexer ..................................................................................................................................... 31
3.6.6 VGA ............................................... 32
3.6.7 TV Decoder ........................................................................................................................................... 35
3.6.8 IR Receiver ............................................................................................................................................ 37
3.6.9 IR Emitter LED ..................................................................................................................................... 37
DE1-SoC User Manual
2
www.terasic.com
March 14, 2014
3.6.10 SDRAM Memory ................................................................................................................................ 38
3.6.11 PS/2 Serial Port .................................................................................................................................... 40
3.6.12 A/D Converter and 2x5 Header ........................................................................................................... 42
3.7 Peripherals Connected to Hard Processor System (HPS) ......................................................................... 43
3.7.1 User Push-buttons and LEDs ................................................................................................................. 43
3.7.2 Gigabit Ethernet ..................................................................................................................................... 44
3.7.3 UART ............................................... 45
3.7.4 DDR3 Memory ...................................................................................................................................... 46
3.7.5 Micro SD Card Socket ........................................................................................................................... 48
3.7.6 2-port USB Host .................................................................................................................................... 49
3.7.7 G-sensor ............................................... 50
3.7.8 LTC Connector ...................................................................................................................................... 51
Chapter 4 DE1-SoC System Builder ........................................................................ 53
4.1 Introduction .............................................................................................................................................. 53
4.2 Design Flow ............................................................................................................................................. 53
4.3 Using DE1-SoC System Builder .............................................................................................................. 54
Chapter 5 Examples For FPGA ............................................................................... 60
5.1 DE1-SoC Factory Configuration .............................................................................................................. 60
5.2 Audio Recording and Playing ................................................................................................................... 61
5.3 Karaoke Machine...................................................................................................................................... 64
5.4 SDRAM Test in Nios II ............................................................................................................................ 66
5.5 SDRAM Test in Verilog............................................................................................................................ 69
5.6 TV Box Demonstration ............................................................................................................................ 71
5.7 PS/2 Mouse Demonstration ...................................................................................................................... 74
5.8 IR Emitter LED and Receiver Demonstration .......................................................................................... 76
5.9 ADC Reading............................................................................................................................................ 82
Chapter 6 Examples for HPS SoC ............................................................................. 85
DE1-SoC User Manual
3
www.terasic.com
March 14, 2014
6.1 Hello Program .......................................................................................................................................... 85
6.2 Users LED and KEY ................................................................................................................................ 87
6.3 I2C Interfaced G-sensor ........................................................................................................................... 93
6.4 I2C MUX Test .......................................................................................................................................... 96
Chapter 7 Examples for using both HPS SoC and FGPA ........................................... 99
7.1 HPS Control LED and HEX ..................................................................................................................... 99
7.2 DE1-SoC Control Panel ......................................................................................................................... 103
Chapter 8 Programming the EPCQ Device .............................................................. 104
8.1 Before The Conversion Begins ............................................................................................................... 104
8.2 Convert .SOF File to .JIC File ................................................................................................................ 104
8.3 Write JIC File into the EPCQ Device ..................................................................................................... 109
8.4 Erase the EPCQ Device .......................................................................................................................... 110
8.5 Boot from EPCQ Device in Quartus II v13.1 ......................................................................................... 111
Chapter 9 Appendix ................................................................................................ 112
9.1 Revision History ..................................................................................................................................... 112
9.2 Copyright Statement ............................................................................................................................... 112
DE1-SoC User Manual
4
www.terasic.com
March 14, 2014
Chapter 1
DE1-SoC
Development Kit
The DE1-SoC Development Kit presents a robust hardware design platform built around the Altera
System-on-Chip (SoC) FPGA, which combines the latest dual-core Cortex-A9 embedded cores
with industry-leading programmable logic for ultimate design flexibility. Users can now leverage
the power of tremendous re-configurability paired with a high-performance, low-power processor
system. Altera’s SoC integrates an ARM-based hard processor system (HPS) consisting of processor,
peripherals and memory interfaces tied seamlessly with the FPGA fabric using a high-bandwidth
interconnect backbone. The DE1-SoC development board is equipped with high-speed DDR3
memory, video and audio capabilities, Ethernet networking, and much more that promise many
exciting applications.
The DE1-SoC Development Kit contains all the tools needed to use the board in conjunction with a
computer that runs the Microsoft Windows XP or later.
1
1.
.1
1
P
Pa
ac
ck
ka
ag
ge
e
C
Co
on
nt
te
en
nt
ts
s
Figure 1-1 shows a photograph of the DE1-SoC package.
Figure 1-1 The DE1-SoC package contents
DE1-SoC User Manual
5
www.terasic.com
March 14, 2014
The DE1-SoC package includes:
The DE1-SoC development board
DE1-SoC Quick Start Guide
USB cable (Type A to B) for FPGA programming and control
USB cable (Type A to Mini-B) for UART control
12V DC power adapter
1
1.
.2
2
D
DE
E1
1-
-S
So
oC
C
S
Sy
ys
st
te
em
m
C
CD
D
The DE1-SoC System CD contains all the documents and supporting materials associated with
DE1-SoC, including the user manual, system builder, reference designs, and device datasheets.
Users can download this system CD from the link: http://cd-de1-soc.terasic.com.
1
1.
.3
3
G
Ge
et
tt
ti
in
ng
g
H
He
el
lp
p
Here are the addresses where you can get help if you encounter any problems:
Altera Corporation
101 Innovation Drive San Jose, California, 95134 USA
Terasic Technologies
9F., No.176, Sec.2, Gongdao 5th Rd, East Dist, Hsinchu City, 30070. Taiwan
Tel.: +886-3-575-0880
Website: de1-soc.terasic.com
DE1-SoC User Manual
6
www.terasic.com
March 14, 2014
Chapter 2
Introduction of the
DE1-SoC Board
This chapter provides an introduction to the features and design characteristics of the board.
2
2.
.1
1
L
La
ay
yo
ou
ut
t
a
an
nd
d
C
Co
om
mp
po
on
ne
en
nt
ts
s
Figure 2-1 shows a photograph of the board. It depicts the layout of the board and indicates the
location of the connectors and key components.
DE1-SoC User Manual
7
www.terasic.com
March 14, 2014
Figure 2-1 DE1-SoC development board (top view)
Figure 2-2 De1-SoC development board (bottom view)
The DE1-SoC board has many features that allow users to implement a wide range of designed
circuits, from simple circuits to various multimedia projects.
DE1-SoC User Manual
8
www.terasic.com
March 14, 2014
The following hardware is provided on the board:
FPGA
Altera Cyclone® V SE 5CSEMA5F31C6N device
Altera serial configuration device EPCQ256
USB-Blaster II onboard for programming; JTAG Mode
64MB SDRAM (16-bit data bus)
4 push-buttons
10 slide switches
10 red user LEDs
Six 7-segment displays
Four 50MHz clock sources from the clock generator
24-bit CD-quality audio CODEC with line-in, line-out, and microphone-in jacks
VGA DAC (8-bit high-speed triple DACs) with VGA-out connector
TV decoder (NTSC/PAL/SECAM) and TV-in connector
PS/2 mouse/keyboard connector
IR receiver and IR emitter
Two 40-pin expansion header with diode protection
A/D converter, 4-pin SPI interface with FPGA
HPS (Hard Processor System)
800MHz Dual-core ARM Cortex-A9 MPCore processor
1GB DDR3 SDRAM (32-bit data bus)
1 Gigabit Ethernet PHY with RJ45 connector
2-port USB Host, normal Type-A USB connector
Micro SD card socket
Accelerometer (I2C interface + interrupt)
UART to USB, USB Mini-B connector
Warm reset button and cold reset button
One user button and one user LED
LTC 2x7 expansion header
2
2.
.2
2
B
Bl
lo
oc
ck
k
D
Di
ia
ag
gr
ra
am
m
o
of
f
t
th
he
e
D
DE
E1
1-
-S
So
oC
C
B
Bo
oa
ar
rd
d
Figure 2-3 is the block diagram of the board. All the connections are established through the
Cyclone V SoC FPGA device to provide maximum flexibility for users. Users can configure the
FPGA to implement any system design.
DE1-SoC User Manual
9
www.terasic.com
March 14, 2014
Figure 2-3 Block diagram of DE1-SoC
Detailed information about Figure 2-3 are listed below.
F
FP
PG
GA
A
D
De
ev
vi
ic
ce
e
Cyclone V SoC 5CSEMA5F31 Device
Dual-core ARM Cortex-A9 (HPS)
85K programmable logic elements
4,450 Kbits embedded memory
6 fractional PLLs
2 hard memory controllers
C
Co
on
nf
fi
ig
gu
ur
ra
at
ti
io
on
n
a
an
nd
d
D
De
eb
bu
ug
g
Quad serial configuration device EPCQ256 on FPGA
Onboard USB-Blaster II (normal type B USB connector)
DE1-SoC User Manual
10
www.terasic.com
March 14, 2014
M
Me
em
mo
or
ry
y
D
De
ev
vi
ic
ce
e
64MB (32Mx16) SDRAM on FPGA
1GB (2x256Mx16) DDR3 SDRAM on HPS
Micro SD card socket on HPS
C
Co
om
mm
mu
un
ni
ic
ca
at
ti
io
on
n
Two port USB 2.0 Host (ULPI interface with USB type A connector)
UART to USB (USB Mini-B connector)
10/100/1000 Ethernet
PS/2 mouse/keyboard
IR emitter/receiver
I2C multiplexer
C
Co
on
nn
ne
ec
ct
to
or
rs
s
Two 40-pin expansion headers
One 10-pin ADC input header
One LTC connector (one Serial Peripheral Interface (SPI) Master ,one I2C and one
GPIO interface )
D
Di
is
sp
pl
la
ay
y
24-bit VGA DAC
A
Au
ud
di
io
o
24-bit CODEC, Line-in, Line-out, and microphone-in jacks
V
Vi
id
de
eo
o
I
In
np
pu
ut
t
TV decoder (NTSC/PAL/SECAM) and TV-in connector
A
AD
DC
C
Fast throughput rate: 1 MSPS
Channel number: 8
Resolution: 12-bit
DE1-SoC User Manual
11
www.terasic.com
March 14, 2014
Analog input range : 0 ~ 2.5 V or 0 ~ 5V as selected via the RANGE bit in the control
register
S
Sw
wi
it
tc
ch
he
es
s,
,
B
Bu
ut
tt
to
on
ns
s,
,
a
an
nd
d
I
In
nd
di
ic
ca
at
to
or
rs
s
5 user Keys (FPGA x4, HPS x1)
10 user switches (FPGA x10)
11 user LEDs (FPGA x10, HPS x 1)
2 HPS reset buttons (HPS_RESET_n and HPS_WARM_RST_n)
Six 7-segment displays
S
Se
en
ns
so
or
rs
s
G-Sensor on HPS
P
Po
ow
we
er
r
12V DC input
DE1-SoC User Manual
12
www.terasic.com
March 14, 2014
Chapter 3
Using the DE1-SoC
Board
This chapter provides an instruction to use the board and describes the peripherals.
3
3.
.1
1
S
Se
et
tt
ti
in
ng
gs
s
o
of
f
F
FP
PG
GA
A
C
Co
on
nf
fi
ig
gu
ur
ra
at
ti
io
on
n
M
Mo
od
de
e
When the DE1-SoC board is powered on, the FPGA can be configured from EPCQ or HPS. The
MSEL[4:0] pins are used to select the configuration scheme. It is implemented as a 6-pin DIP
switch SW10 on the DE1-SoC board, as shown in Figure 3-1.
Figure 3-1 DIP switch (SW10) setting of Active Serial (AS) mode at the back of DE1-SoC board
Table 3-1 shows the relation between MSEL[4:0] and DIP switch (SW10).
DE1-SoC User Manual
13
www.terasic.com
March 14, 2014
Table 3-1 FPGA Configuration Mode Switch (SW10)
Board Reference
Signal Name
Description
Default
SW10.1
MSEL0
Use these pins to set the FPGA
Configuration scheme
ON (“0”)
SW10.2
MSEL1
OFF (“1”)
SW10.3
MSEL2
ON (“0”)
SW10.4
MSEL3
ON (“0”)
SW10.5
MSEL4
OFF (“1”)
SW10.6
N/A
N/A
N/A
Figure 3-1 shows MSEL[4:0] setting of AS mode, which is also the default setting on DE1-SoC.
When the board is powered on, the FPGA is configured from EPCQ, which is pre-programmed with
the default code. If developers wish to reconfigure FPGA from an application software running on
Linux, the MSEL[4:0] needs to be set to 01010 before the programming process begins. If
developers using the "Linux Console with frame buffer" or "Linux LXDE Desktop" SD Card image,
the MSEL[4:0] needs to be set to 00000” before the board is powered on.
Table 3-2 MSEL Pin Settings for FPGA Configure of DE1-SoC
MSEL[4:0]
Configure Scheme
Description
10010
AS
FPGA configured from EPCQ (default)
01010
FPPx32
FPGA configured from HPS software: Linux
00000
FPPx16
FPGA configured from HPS software: U-Boot, with
image stored on the SD card, like LXDE Desktop or
console Linux with frame buffer edition.
3
3.
.2
2
C
Co
on
nf
fi
ig
gu
ur
ra
at
ti
io
on
n
o
of
f
C
Cy
yc
cl
lo
on
ne
e
V
V
S
So
oC
C
F
FP
PG
GA
A
o
on
n
D
DE
E1
1-
-S
So
oC
C
There are two types of programming method supported by DE1-SoC:
1. JTAG programming: It is named after the IEEE standards Joint Test Action Group.
The configuration bit stream is downloaded directly into the Cyclone V SoC FPGA. The FPGA will
retain its current status as long as the power keeps applying to the board; the configuration
information will be lost when the power is off.
2. AS programming: The other programming method is Active Serial configuration.
The configuration bit stream is downloaded into the quad serial configuration device (EPCQ256),
which provides non-volatile storage for the bit stream. The information is retained within EPCQ256
DE1-SoC User Manual
14
www.terasic.com
March 14, 2014
even if the DE1-SoC board is turned off. When the board is powered on, the configuration data in
the EPCQ256 device is automatically loaded into the Cyclone V SoC FPGA.
JTAG Chain on DE1-SoC Board
The FPGA device can be configured through JTAG interface on DE1-SoC board, but the JTAG
chain must form a closed loop, which allows Quartus II programmer to the detect FPGA device.
Figure 3-2 illustrates the JTAG chain on DE1-SoC board.
Figure 3-2 Path of the JTAG chain
Configure the FPGA in JTAG Mode
There are two devices (FPGA and HPS) on the JTAG chain. The following shows how the FPGA is
programmed in JTAG mode step by step.
1. Open the Quartus II programmer and click “Auto Detect”, as circled in Figure 3-3
DE1-SoC User Manual
15
www.terasic.com
March 14, 2014
Figure 3-3 Detect FPGA device in JTAG mode
2. Select detected device associated with the board, as circled in Figure 3-4.
Figure 3-4 Select 5CSEMA5 device
3. Both FPGA and HPS are detected, as shown in Figure 3-5.
DE1-SoC User Manual
16
www.terasic.com
March 14, 2014
Figure 3-5 FPGA and HPS detected in Quartus programmer
4. Right click on the FPGA device and open the .sof file to be programmed, as highlighted in
Figure 3-6.
DE1-SoC User Manual
17
www.terasic.com
March 14, 2014
Figure 3-6 Open the .sof file to be programmed into the FPGA device
5. Select the .sof file to be programmed, as shown in Figure 3-7.
Figure 3-7 Select the .sof file to be programmed into the FPGA device
6. Click “Program/Configure” check box and then click “Start” button to download the .sof file
into the FPGA device, as shown in Figure 3-8.
DE1-SoC User Manual
18
www.terasic.com
March 14, 2014
Figure 3-8 Program .sof file into the FPGA device
Configure the FPGA in AS Mode
The DE1-SoC board uses a quad serial configuration device (EPCQ256) to store
configuration data for the Cyclone V SoC FPGA. This configuration data is
automatically loaded from the quad serial configuration device chip into the FPGA
when the board is powered up.
Users need to use Serial Flash Loader (SFL) to program the quad serial configuration
device via JTAG interface. The FPGA-based SFL is a soft intellectual property (IP)
core within the FPGA that bridge the JTAG and Flash interfaces. The SFL
Megafunction is available in Quartus II. Figure 3-9 shows the programming method
when adopting SFL solution.
Please refer to Chapter 9: Steps of Programming the Quad Serial Configuration Device
for the basic programming instruction on the serial configuration device.
DE1-SoC User Manual
19
www.terasic.com
March 14, 2014
Figure 3-9 Programming a quad serial configuration device with SFL solution
3
3.
.3
3
B
Bo
oa
ar
rd
d
S
St
ta
at
tu
us
s
E
El
le
em
me
en
nt
ts
s
DE1-SoC has four status LEDs onboard. Table 3-3 describes the status of these LED indicators.
Table 3-3 LED Indicators
Board Reference
LED Name
Description
D14
12-V Power
Illuminate when 12V power is active.
TXD
UART TXD
Illuminate when data is transferred from FT232R to USB Host.
RXD
UART RXD
Illuminate when data is transferred from USB Host to FT232R.
D5
JTAG_RX
Reserved
D4
JTAG_TX
3
3.
.4
4
B
Bo
oa
ar
rd
d
R
Re
es
se
et
t
E
El
le
em
me
en
nt
ts
s
There are two HPS reset buttons on DE1-SoC, HPS (cold) reset and HPS warm reset, as shown in
Figure 3-10. Table 3-4 describes the purpose of these two HPS reset buttons. Figure 3-11 is the
reset tree for DE1-SoC.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113

Terasic DE1-SoC User manual

Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI