1.24 SDMMC driver asynchronous - SDIO Read Write

This example application shows how to use the SDIO driver in asynchronous mode to perform read/write operations on the ATWILC1000 SDIO card.

Description

  • This example uses the SDIO driver in asynchronous mode and demonstrates read/write operations using CMD52 (single byte read/write) and CMD53 (multi-byte and block transfers).
  • The application reads and writes following registers:

    1. Read Card Capability Register using CMD52

    2. Read FN0 Block Size Register (16-bits) using CMD53

    3. Write FN0 Block Size Register to 256 using CMD53

    4. Read back and confirm if the FN0 Block Size Register is updated to 256

    5. Write FN0 Block Size Register back to 512 using two CMD52 commands and Read after Write enabled

    6. Confirm that FN0 Block Size Register is set back to 512

    7. Read all 512 bytes of Card Common Control Register (CCCR) using CMD53 Block transfer

    8. Enable FN1 CSA - Code Storage Area - by writing to address 0x100 in Function Basic Registers (FBR) region using CMD52

    9. Read back and verify the value of FBR register at address 0x100

    10. Write 3 bytes of Function 1 Code Storage Area (CSA) at address 0x10C to value 0x1000 using CMD52

    11. Read 4 bytes of Chip ID from address 0x1000 using CMD53. The read chip ID must be 0x1003A0

Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/driver/sdmmc/async/sdio_read_write/.

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
sam_e54_xpro.XMPLABX project for SAM E54 Xplained Pro Evaluation Kit

Setting Up the Hardware

The following table shows the target hardware for the application projects.

Project NameDescription
sam_e54_xpro.XSAM E54 Xplained Pro Evaluation Kit

Setting Up SAM E54 Xplained Pro Evaluation Kit

  • To run the demo, the following additional hardware are required:
  • Connect the Debug USB port on the board to the computer using a micro USB cable
  • Insert ATWILC1000 SD Evaluation Kit in the SD Card slot on the evaluation kit

Running the Application

  1. Open the Terminal application (Ex.:Tera term) on the computer
  2. Connect to the EDBG Virtual COM port and configure the serial settings as follows:
    • Baud : 115200
    • Data : 8 Bits
    • Parity : None
    • Stop : 1 Bit
    • Flow Control : None
  3. Build and Program the application using its IDE
  4. Insert the ATWILC1000 SD Evaluation Kit and observe the following output on the terminal