Changes

Jump to navigation Jump to search
92 bytes added ,  06:55, 5 February 2017
Added Satellites category tag
Line 2: Line 2:     
This project demonstrates the use of the SPI interface to communicate with SD Cards using the TMS570 board.  SD cards may be useful on the satellite for data logging purposes.  In addition, the code is a successful demonstration of the spi interface on the board.
 
This project demonstrates the use of the SPI interface to communicate with SD Cards using the TMS570 board.  SD cards may be useful on the satellite for data logging purposes.  In addition, the code is a successful demonstration of the spi interface on the board.
 +
 +
[[File:SDCard.jpg|300px]]
    
== Contents ==
 
== Contents ==
Line 15: Line 17:  
3. Any files labelled diskio or mmc-hdk-hercules are related to sending commands to the "disk" (sd card), with the key commands being readsector and writesector.
 
3. Any files labelled diskio or mmc-hdk-hercules are related to sending commands to the "disk" (sd card), with the key commands being readsector and writesector.
   −
'''This code can attributed almost completely to https://www.element14.com/community/people/jancumps/blog/2015/10/03/ti-hercules-launchpad-using-an-sd-card'''
+
'''This code can be attributed almost completely to https://www.element14.com/community/people/jancumps/blog/2015/10/03/ti-hercules-launchpad-using-an-sd-card'''
    
== Usage ==
 
== Usage ==
Line 40: Line 42:     
and see what they do.
 
and see what they do.
 +
 +
[[File:SDCardShell.jpg|300px]]
    
== Usage (code) ==
 
== Usage (code) ==
Line 51: Line 55:  
mmcSelectSpi(spiPORT1, spiREG1);  // Initialize sdcard code to work on mibspi[1]
 
mmcSelectSpi(spiPORT1, spiREG1);  // Initialize sdcard code to work on mibspi[1]
   −
""Read from file""
+
'''Read from file'''
    
FIL file;
 
FIL file;
Line 59: Line 63:  
iFResult = f_read(&file, buffer, sizeof(buffer) - 1, (UINT *)&bytesRead);  // Read one block of data from the file.  bytesRead is populated with the number of bytes read.
 
iFResult = f_read(&file, buffer, sizeof(buffer) - 1, (UINT *)&bytesRead);  // Read one block of data from the file.  bytesRead is populated with the number of bytes read.
   −
""Write to file""
+
'''Write to file'''
    
FIL file;
 
FIL file;
Line 68: Line 72:     
res = f_close(&file); // If you don't do this the file might not save
 
res = f_close(&file); // If you don't do this the file might not save
 +
 +
[[Category: Satellites]]
767

edits

Navigation menu