DE4 User Manual
128
www.terasic.com
June 20, 2018
Figure 5
–18 Block diagram of the SD card demonstration
Figure 5–19
shows the software stack of this demonstration. The NIOS PIO block provides basic
IO functions to access hardware directly. The functions are provided from NIOS II system and the
function prototype is defined in the header file <io.h>. The SD-CARD block implements SD 4-bit
mode protocol for communication with SD cards. The FAT File System block implements reading
function for FAT16 and FAT 32 file system. Long filename is supported. By calling the exported
FAT functions, users can browse files under the root directory of the SD card. Furthermore, users
can open a specified file and read the contents of the file.
The main block implements main control of this demonstration. When the program is executed, it
detects whether a SD card is inserted. If a SD card is found, it will check whether the SD card is
formatted as FAT file system. If a FAT file system is found, it searches all files in the root directory
of the FAT file system and displays their names in the nios2-terminal. If a text file named “test.txt”
is found, it will dump the file contents. If users press BUTTON3 of the DE4 board, the program
will perform above process again.
Summary of Contents for ALTERA DE4
Page 1: ...DE4 User Manual 1 www terasic com June 20 2018 ...
Page 54: ...DE4 User Manual 54 www terasic com June 20 2018 ...
Page 83: ...DE4 User Manual 83 www terasic com June 20 2018 Figure 3 8 Access DDR2 SO DIMM memory ...
Page 92: ...DE4 User Manual 92 www terasic com June 20 2018 Figure 3 17 Fan Control of the DE4 ...
Page 150: ...DE4 User Manual 150 www terasic com June 20 2018 Figure 5 35 SOPC builder ...