Line 4: Line 4:
  
 
=File Handling Functions=
 
=File Handling Functions=
 +
The below table shows the list of functions to access the sd card.<br>
 +
{| class="table table-striped table-hover table-condensed table-bordered"
 +
|-class="info"
 +
!Function|| Description
 +
|-
 +
|FILE_Open||This functions opens the specified file in requested mode(READ/WRITE/APPEND).
 +
|-class="active"
 +
|FILE_Close|| This functions closes the file and releases the memory used by the file.
 +
|-
 +
|FILE_Delete|| This functions deletes the file from SD card.
 +
|-class="active"
 +
|PR|| Prescalar Register: This is used to specify the Prescalar value for incrementing the TC.
 +
|-
 +
|FILE_GetCh|| This functions reads a byte of data from the file, Once the End of File is reached it returns EOF(26)
 +
|-class="active"
 +
|FILE_PutCh|| This functions writes a byte of data to the file, EOF(26) needs to be passed to mark the end of file and save it to SD card.
 +
|-
 +
|FILE_GetList|| This functions traverses through the SD card and lists the available files with their size.
 +
|-class="active"
 +
|FILE_GetMemoryStatics|| This functions calculates the total and free memory of the SD card. It takes upto 10secs(for 32GB) to calculate the memory statics depending on the size of CARD
 +
|}
 +
<br><br><br><br>
  
  

Revision as of 10:23, 14 April 2016

Objective:

In this tutorial we will discuss how to interface SD CARD with lpc1768 to read and write the fat32 files.

File Handling Functions

The below table shows the list of functions to access the sd card.

Function Description
FILE_Open This functions opens the specified file in requested mode(READ/WRITE/APPEND).
FILE_Close This functions closes the file and releases the memory used by the file.
FILE_Delete This functions deletes the file from SD card.
PR Prescalar Register: This is used to specify the Prescalar value for incrementing the TC.
FILE_GetCh This functions reads a byte of data from the file, Once the End of File is reached it returns EOF(26)
FILE_PutCh This functions writes a byte of data to the file, EOF(26) needs to be passed to mark the end of file and save it to SD card.
FILE_GetList This functions traverses through the SD card and lists the available files with their size.
FILE_GetMemoryStatics This functions calculates the total and free memory of the SD card. It takes upto 10secs(for 32GB) to calculate the memory statics depending on the size of CARD






Formatting SD Card

Connection Diagram

code

0SdCardInterface.gif