Altera DE2-115 User Manual Page 90

  • Download
  • Add to my manuals
  • Print
  • Page
    / 121
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 89
89
Figure 6-9 Block Diagram of the SD Card Demonstration
Figure 6-10 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 public 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 an SD Card is inserted. If an SD Card is found, it will check whether the SD Card is
formatted as FAT file system. If so, 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 it successfully recognizes the FAT file system, it will turn on the green LED. On
the other hand, it will turn on the red LED if it fails to parse the FAT file system or if there is no SD
Card found in the SD Card socket of the DE2-115 board. If users press KEY3 of the DE2-115 board,
the program will perform above process again.
Page view 89
1 2 ... 85 86 87 88 89 90 91 92 93 94 95 ... 120 121

Comments to this Manuals

No comments