SoCKit User Manual
69
www.terasic.com
December 1, 2015
The sensor connects the FPGA device through a SPI interface. In this demonstration, a SPI master
core is used by Nios II software to access the sensor’s Temperature Value registers. Based on the
register’s values reading out in every five seconds, the program calculates the centigrade degree.
The relative values are finally displayed onto the nios2-terminal window, in order to let the user
monitor the board real-time temperature.
Figure 5-15 Block diagram of the Temperature Demonstration
D
D
e
e
m
m
o
o
n
n
s
s
t
t
r
r
a
a
t
t
i
i
o
o
n
n
S
S
o
o
u
u
r
r
c
c
e
e
C
C
o
o
d
d
e
e
Project directory: SoCKit_TEMP
Bit stream used: S0Ckit_TEMP.sof
Nios II Workspace: SoCKit_TEMP\Software
D
D
e
e
m
m
o
o
n
n
s
s
t
t
r
r
a
a
t
t
i
i
o
o
n
n
B
B
a
a
t
t
c
c
h
h
F
F
i
i
l
l
e
e
Demo Batch File Folder: SoCKit_TEMP\demo_batch
The demo batch file includes the following files:
Batch File: SoCKit_TEMP.bat, SoCKit_TEMP_bashrc
FPGA Configure File : SoCKit_TEMP.sof
Nios II Program: SoCKit _TEMP.elf