126
7
7
.
.
7
7
W
W
h
h
y
y
t
t
h
h
e
e
L
L
E
E
D
D
B
B
l
l
i
i
n
n
k
k
s
s
The Nios II system description header file,
system.h
, contains the software definitions, name,
locations, base addresses, and settings for all of the components in the Nios II hardware system. The
system.h
file is located in the in the
hello_world_0_syslib\Debug\system_description
directory,
and is shown in
Figure 7-59
.
Figure 7-59 The system.h file
If you look in the
system.h
file for the Nios II project example used in this tutorial, you will notice
the
pio_led
function. This function controls the LEDs. The Nios II processor controls the PIO ports
(and thereby the LEDs) by reading and writing to the register map. For the PIO, there are four
registers:
data, direction, interruptmask, and edgecapture
. To turn the LED on and off, the
application writes to the PIO’s data register.
The PIO core has an associated software file
altera_avalon_pio_regs.h
. This file defines the core’s
register map, providing symbolic constants to access the low-level hardware. The
altera_avalon_pio_regs.h
file is located in the directory,
altera\10.1\ip\sopc_builder_ip\altera_avalon_pio
.
When you include the
altera_avalon_pio_regs.h
file, several useful functions that manipulate the
PIO core registers are available to your program. In particular, the macro
IOWR_ALTERA_AVALON_PIO_DATA(base, data)
Содержание De0-Nano
Страница 1: ...1 ...
Страница 4: ...4 9 3 Revision History 155 9 4 Copyright Statement 155 ...
Страница 44: ...44 Figure 6 5 Browse to find the location Figure 6 6 There is no need to test the driver ...
Страница 90: ...90 Figure 7 14 Add NIOS II Processor ...
Страница 91: ...91 Figure 7 15 Nios II Processor 9 Click Finish to return to main window as shown in Figure 7 16 ...
Страница 93: ...93 Figure 7 17 Rename the CPU 1 Figure 7 18 Rename the CPU 2 ...
Страница 98: ...98 Figure 7 23 Add On Chip Memory ...
Страница 100: ...100 Figure 7 25 Update Total memory size ...
Страница 102: ...102 Figure 7 28 Update CPU settings ...
Страница 104: ...104 Figure 7 30 Add PIO ...
Страница 106: ...106 Figure 7 32 PIO 21 Rename pio_0 to pio_led as shown in Figure 7 33 Figure 7 33 Rename PIO ...
Страница 113: ...113 Figure 7 43 Input verilog Text Figure 7 44 Open DE0_NANO_SOPC v ...
Страница 146: ...146 Figure 8 16 Display Progress and Result Information for the SDRAM Demonstration ...
Страница 150: ...150 Figure 9 3 Select Devices Page ...
Страница 151: ...151 Figure 9 4 Convert Programming Files Page ...