Step 2: With MHC, Configure SD Card Driver, SPI Driver, and File System
Add an SD Card (SPI) driver to your project from the Available Components window.
Expand the Harmony > Drivers > SDCARD tree and select the SD Card (SPI) driver.
The SD Card (SPI) component block will be displayed in the Project Graph window as in the accompanying image.
Highlight the component block by clicking on it. The available configuration setting will be displayed in the Configuration Options window. For this project change the following:
- SD Card Speed (Hz) to 20,000,000
- Transfer Queue Size to 10
- Chip Select Pin to RB14
Attach a DRV_MEDIA to your SD Card driver.
Right-click on the yellow DRV_MEDIA attachment box. From the Satisfiers list, select FILE SYSTEM.
Your Project Graph should now resemble the following screen.
Click on the FILE SYSTEM component box to display the configuration options available for this component. Set Maximum Simultaneous File Access to 2.
Attach an SPI peripheral (PLIB) to your SD Card driver.
Right-click on the red diamond for the SPI Instance 0. From the Satisfiers list, select SPI2. This matches the hardware SPI peripheral that is routed to the SD Card controller on the MEB2 Expansion Card.
Your Project Graph should now resemble the following screen.
Click on the SPI2 peripheral to display the configuration options available for this component. Select Slave select SPI support is disabled and 2,000,000 Baud Rate.